A SERVICE OF

logo

AI_RSAKeyGen
208 RSA BSAFE Crypto-C Library Reference Manual
AI_RSAKeyGen
Purpose:
This AI allows you to specify the parameters for generating an RSA public/private
key pair as defined in PKCS #1. You may also use
AI_RSAStrongKeyGen to generate
RSA key pairs.
Type of information this allows you to use:
the parameters for generating an RSA public/private key pair as defined in PKCS #1,
where the modulus size and public exponent are specified.
Format of info supplied to B_SetAlgorithmInfo:
pointer to an A_RSA_KEY_GEN_PARAMS structure:
The
publicExponent
ITEM supplies an integer in canonical format, where the ITEM’s
data
points to an unsigned byte array—most significant byte first—and the ITEM’s
len
gives its length. All leading zeros are stripped from the integer before it is copied to
the algorithm object.
Format of info returned by B_GetAlgorithmInfo:
pointer to an A_RSA_KEY_GEN_PARAMS structure (see above). All leading zeros have
been stripped from the
publicExponent
integer.
Crypto-C procedures to use with algorithm object:
B_GenerateInit and B_GenerateKeypair. B_GenerateKeypair sets the
publicKey
key
object with the
KI_RSAPublic information and the
privateKey
key object with the
KI_PKCS_RSAPrivate information. You must pass an initialized random algorithm to
B_GenerateKeypair.
typedef struct {
unsigned int modulusBits; /* size of modulus in bits */
ITEM publicExponent; /* fixed public exponent */
} A_RSA_KEY_GEN_PARAMS;