![](https://pdfstore-manualsonline.prod.a.ki/pdfasset/8/e1/8e19318c-ae01-425c-b15f-c70b26f2bca2/8e19318c-ae01-425c-b15f-c70b26f2bca2-bge4.png)
AI_RSAStrongKeyGen
218 RSA BSAFE Crypto-C Library Reference Manual
AI_RSAStrongKeyGen
Purpose:
This AI allows you to specify the parameters for generating an RSA public/private
key pair as defined in PKCS #1. The moduli generated are in conformance with the
strength criteria of X9.31. If you do not want this level of conformance, you may use a
faster
AI_RSAKeyGen 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. The moduli generated are
in conformance with the strength criteria of X9.31.
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.
modulusBits
must be at least 512 and must be a multiple of 16.
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;