2.2.11.2.1 RSA Key Pair

The RSA Key Pair structure is used to store a key pair (a public key and corresponding private key) for use with the RSA digital signature algorithm.


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

Reserved1

ModulusBitLength

LengthOfPublicExponent

LengthOfModulus

LengthOfPrime1

LengthOfPrime2

PublicExponent (variable)

...

Modulus (variable)

...

Prime1 (variable)

...

Prime2 (variable)

...

Reserved1 (4 bytes): MUST be 0x32415352.

ModulusBitLength (4 bytes): This MUST be a 32-bit unsigned integer in little-endian format. It MUST be the length of the RSA modulus, in bits, equal to 8 times the quantity referred to as k in [RFC8017] section 2.

LengthOfPublicExponent (4 bytes): This MUST be a 32-bit unsigned integer in little-endian format. It MUST be the length of the PublicExponent field, in bytes.

LengthOfModulus (4 bytes): This MUST be a 32-bit unsigned integer in little-endian format. It MUST be the length of the Modulus field, in bytes.

LengthOfPrime1 (4 bytes): This MUST be a 32-bit unsigned integer in little-endian format. It MUST be the length of the Prime1 field, in bytes.

LengthOfPrime2 (4 bytes): This MUST be a 32-bit unsigned integer in little-endian format. It MUST be the length of the Prime2 field, in bytes.

PublicExponent (variable): This MUST be the public exponent of the key pair, referred to as e in [RFC8017] section 2. It MUST be encoded in big-endian format.

Modulus (variable): This MUST be the RSA modulus, referred to as n in [RFC8017] section 2. It MUST be equal to Prime1 * Prime2. It MUST be encoded in big-endian format.

Prime1 (variable): This MUST be the first prime factor of the RSA modulus, referred to as p in [RFC8017] section 2. It MUST be encoded in big-endian format.

Prime2 (variable): This MUST be the second prime factor of the RSA modulus, referred to as q in [RFC8017] section 2. It MUST be encoded in big-endian format.