2.2.1.4.3.1.1.1 RSA Public Key (RSA_PUBLIC_KEY)

The structure used to describe a public key in a Proprietary Certificate (section 2.2.1.4.3.1.1).


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

magic

keylen

bitlen

datalen

pubExp

modulus (variable)

...

magic (4 bytes): A 32-bit, unsigned integer. The sentinel value. This field MUST be set to 0x31415352.

keylen (4 bytes): A 32-bit, unsigned integer. The size in bytes of the modulus field. This value is directly related to the bitlen field and MUST be ((bitlen / 8) + 8) bytes.

bitlen (4 bytes): A 32-bit, unsigned integer. The number of bits in the public key modulus.

datalen (4 bytes): A 32-bit, unsigned integer. The maximum number of bytes that can be encoded using the public key. This value is directly related to the bitlen field and MUST be ((bitlen / 8) - 1) bytes.

pubExp (4 bytes): A 32-bit, unsigned integer. The public exponent of the public key.

modulus (variable): A variable-length array of bytes containing the public key modulus. The length in bytes of this field is given by the keylen field. The modulus field contains all (bitlen / 8) bytes of the public key modulus and 8 bytes of zero padding (which MUST follow after the modulus bytes).