The Base Provider Public-Key Blob

Public-key blobs (type PUBLICKEYBLOB) are used to store public keys. They have the following format:

BLOBHEADER blobheader;
RSAPUBKEY rsapubkey;
BYTE modulus[rsapubkey.bitlen/8];
 

The following table describes each public-key component. All values are in little-endian format.

Field Description
blobheader A BLOBHEADER structure. The bType member must have a value of PUBLICKEYBLOB.
rsapubkey A RSAPUBKEY structure. The magic member should be set to "RSA1" (0x31415352) for public keys and to "RSA2" (0x32415352) for private keys.

Notice that the hex values are just an ASCII encoding of "RSA1" and "RSA2."

modulus The public-key modulus data is located directly after the RSAPUBKEY structure. The size of this data will vary, depending on the size of the public key. The number of bytes can be determined by dividing the value of RSAPUBKEY's bitlen field by eight.

Notice that public-key blobs are not encrypted, but contain public keys in plaintext form.

For more detailed information on the Base Provider key blobs, see Interoperability with RSA CSPs.