000025866 - How to interpret format of RSA keys exported by RSA BSAFE 1.x

Document created by RSA Customer Support Employee on Jun 16, 2016Last modified by RSA Customer Support Employee on Apr 21, 2017
Version 2Show Document
  • View in full screen mode

Article Content

Article Number000025866
Applies ToRSA BSAFE Crypto-C
Using KI_RSAPrivateBSAFE1 or KI_RSAPublicBSAFE1 with B_GetKeyInfo
In RSA BSAFE Crypto-C, there is a BSAFE1 key format for RSA public and private keys. This key format has been deprecated and should not be used; however, it is still included for backwards compatibility. The information in this format is stored in a char array. The format of this array is as follows:

For RSA Private Keys:

The bits in hex are:

42 56 - followed by the BSAFE_VERSION value

42 43 - followed by the key class (ie Private or Public)

42 41 - followed by the algorithm (RSA)

42 4C - followed by the key length

4e 4e - followed by the modulus

45 4e - followed by the public exponent

50 4e - followed by the prime[0]

51 4e - followed by the prime [1]

44 50 - followed by the prime exponent [0]

44 51 - followed by the prime exponent [1]

43 52 - followed by the coefficient

40 41 - followed by the MAC of the key data

52 53 41 46 - (these are the end bytes)

For RSA Public keys:

The bits in hex are:

42 56 - followed by the BSAFE_VERSION value

42 43 - followed by the key class (ie Private or Public)

42 41 - followed by the algorithm (RSA)

42 4C - followed by the key length

4e 4e - followed by the modulus

45 4e - followed by the public exponent

40 41 - followed by the MAC of the key data

52 53 41 46 - (these are the end bytes)
IssueHow to interpret format of RSA keys exported by RSA BSAFE 1.x
ResolutionThose KI's have been deprecated.  Instead of using those KI's we recommend that you use the following key info types with B_GetKeyInfo to retrieve the key data from a key object:

KI_PKCS_RSAPrivateBER or KI_PKCS_RSAPrivate for RSA private keys

KI_RSAPublicBER or KI_RSAPublic for RSA public keys.
Legacy Article IDa6756

Attachments

    Outcomes