KeyData format

This section defines the wire format for M_KeyData and its descendant types.

In a key attestation bundle as described in Key attestation bundle construction, the following fields will use this format:

  • pubkeydata

  • knsopub

M_KeyData

This represents a structure with the following fields:

Field Size Format

type

4 bytes

Little-endian unsigned integer. See M_KeyType

data

variable

Depends on field type. See below.

M_KeyData.data representations

This depends on the value of the type field, as follows:

Name of type Value of type Format of data

KeyType_RSAPublic

1

M_KeyType_RSAPublic_Data

KeyType_RSAPrivate

2

M_KeyType_RSAPrivate_Data

KeyType_DSAPublic

3

M_KeyType_DSAPublic_Data

KeyType_DSAPrivate

19

M_KeyType_DSAPrivate_Data

KeyType_KCDSAPublic

39

M_KeyType_KCDSAPublic_Data

KeyType_KCDSAPrivate

40

M_KeyType_KCDSAPrivate_Data

KeyType_ECPublic

44

M_KeyType_ECPublic_Data

KeyType_ECPrivate

45

M_KeyType_ECPrivate_Data

KeyType_ECDSAPublic

46

M_KeyType_ECPublic_Data

KeyType_ECDSAPrivate

47

M_KeyType_ECPrivate_Data

KeyType_Ed25519Public

65

M_KeyType_Random_Data

KeyType_Ed25519Private

66

M_KeyType_Random_Data

Any supported values of type not present in the table correspond to an empty (zero-length) data field.

M_ECPoint

This represents a structure with the following fields:

Field Size Format

flags

4 bytes

Little-endian unsigned integer. See M_ECPoint_flags

x

variable

See M_Bignum

y

variable

See M_Bignum

M_ECPoint_flags

A bitmap type, represented as a 4-byte little-endian unsigned integer. Individual bit values are:

Value Name

0x00000001

Infinity

M_KeyType_DSAPrivate_Data

This represents a structure with the following fields:

Field Size Format

dlg

variable

See M_DSADiscreteLogGroup

x

variable

See M_Bignum

M_KeyType_DSAPublic_Data

This represents a structure with the following fields:

Field Size Format

dlg

variable

See M_DSADiscreteLogGroup

y

variable

See M_Bignum

M_KeyType_ECPrivate_Data

This represents a structure with the following fields:

Field Size Format

curve

variable

See M_EllipticCurve

d

variable

See M_Bignum

M_KeyType_ECPublic_Data

This represents a structure with the following fields:

Field Size Format

curve

variable

See M_EllipticCurve

Q

variable

See M_ECPoint

M_KeyType_KCDSAPrivate_Data

This represents a structure with the following fields:

Field Size Format

dlg

variable

See M_DSADiscreteLogGroup

y

variable

See M_Bignum

x

variable

See M_Bignum

M_KeyType_KCDSAPublic_Data

This represents a structure with the following fields:

Field Size Format

dlg

variable

See M_DSADiscreteLogGroup

y

variable

See M_Bignum

M_KeyType_RSAPrivate_Data

This represents a structure with the following fields:

Field Size Format

p

variable

See M_Bignum

q

variable

See M_Bignum

dmp1

variable

See M_Bignum

dmq1

variable

See M_Bignum

iqmp

variable

See M_Bignum

e

variable

See M_Bignum

M_KeyType_RSAPublic_Data

This represents a structure with the following fields:

Field Size Format

e

variable

See M_Bignum

n

variable

See M_Bignum

M_KeyType_Random_Data

This represents a structure with the following fields:

Field Size Format

k

variable

See M_ByteBlock