KI_RSAPublicBER

KI_RSAPublicBER

Purpose:

This KI is similar to KI_RSAPublic except that it uses the ASN.1 BER format. This KI allows you to parse and create an ASN.1 key info type that is encoded with the X.509 standard of SubjectPublicKeyInfo. You call B_SetKeyInfo to initialize a key object from the encoded key info type that includes the modulus and public exponent. You call B_GetKeyInfo with this KI to create an encoded key info type from a key object that was created using KI_RSAPublic, KI_RSAPublicBER, KI_PKCS_RSAPrivate or KI_PKCS_RSAPrivateBER. The OID for RSA PKCS #1 encryption, excluding the tag and length bytes, in decimal, is “42, 134, 72, 134, 247, 13, 1, 1, 1”. Also see KI_RSAPublic.

Type of information this allows you to use:

the encoding of an RSA public key that is encoded as an X.509 SubjectPublicKeyInfo type that contains an X.509 RSAPublicKey type (also defined in PKCS #1). Note that this encoding contains all of the information specified by KI_RSAPublic.

Format of info supplied to B_SetKeyInfo:

pointer to an ITEM structure that gives the address and length of the BER encoding. The encoding is converted to DER before it is copied to the key object. B_SetKeyInfo returns BE_WRONG_KEY_INFO if the public key info specifies a public key for an algorithm other than the RSA algorithm. Note that B_SetKeyInfo will accept an encoding that contains an object identifier for rsa as well as rsaEncryption (defined in PKCS #1).

Format of info returned by B_GetKeyInfo:

pointer to an ITEM structure that gives the address and length of the DER encoding. Note that B_GetKeyInfo returns an encoding that contains the object identifier for rsaEncryption (defined in PKCS #1) as opposed to rsa.

Can get this info type if key object already has:

KI_RSAPublicBER, KI_RSAPublic, KI_PKCS_RSAPrivate, or KI_PKCS_RSAPrivateBER.

2 8 6

R S A B S A F E C r y p t o - C L i b r a r y R e f e r e n c e M a n u a l

Page 296
Image 296
RSA Security 5 manual KIRSAPublicBER