RSA_CSP_PUBLICKEYBLOB

When RSA_CSP_PUBLICKEYBLOB is used for the lpszStructType with CryptEncodeObject, CryptEncodeObjectEx, CryptDecodeObject, or CryptDecodeObjectEx the following details apply.

Object Identifier String

N/A

Corresponding Data Structure being encoded or decoded

For CryptDecodeObject and CryptDecodeObjectEx:
pvStructInfo points to a Public Key Blob Format immediately followed by a RSAPUBKEY and the modulus bytes.
For CryptEncodeObject and CryptEncodeObjectEx:
pvStructInfo points to a Public Key Blob Format.

Additional Details

For CryptDecodeObject and CryptDecodeObjectEx:
CryptExportKey outputs the StructInfo for a dwBlobType of PUBLICKEYBLOB. CryptImportKey expects the StructInfo when importing a public key.

For dwCertEncodingType = X509_ASN_ENCODING, the RSA_CSP_PUBLICKEYBLOB is encoded as a PKCS #1 RSAPublicKey consisting of a SEQUENCE of a modulus INTEGER and a publicExponent INTEGER. When decoded, if the modulus was encoded as an unsigned integer with a leading 0 byte, the 0 byte is removed before converting to the CSP modulus bytes. Since PKCS#1 doesn't have any intended key usage information, the aiKeyAlg field of the BLOBHEADER structure is always set to CALG_RSA_KEYX.

For CryptEncodeObject and CryptEncodeObjectEx:
CryptExportKey outputs the above StructInfo for a dwBlobType of PUBLICKEYBLOB. CryptImportKey expects the above StructInfo when importing a public key.

For dwCertEncodingType = X509_ASN_ENCODING, the RSA_CSP_PUBLICKEYBLOB is encoded as a PKCS #1 RSAPublicKey consisting of a SEQUENCE of a modulus INTEGER and a publicExponent INTEGER. The modulus is encoded as being an unsigned integer.