AI_DSAKeyGen
52 RSA BSAFE Crypto-C Library Reference Manual
AI_DSAKeyGen
Purpose:
This AI allows you to generate a DSA key pair. First, you pass the system parameters
to B_SetAlgorithmInfo. Then you generate the keys by calling B_GenerateInit and
B_GenerateKeypair. Alternatively, you may use the AI_DSAParamGen algorithm type
to generate the system parameters needed in DSA key generation. Also see
AI_DSAParamGen.
Type of information this allows you to use:
the parameters for generating a compatible DSA key pair as defined in FIPS PUB 186.
Format of info supplied to B_SetAlgorithmInfo:
pointer to an A_DSA_PARAMS structure:
An 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_DSA_PARAMS structure (see above).
Crypto-C procedures to use with algorithm object:
B_GenerateInit and B_GenerateKeypair. B_GenerateKeypair sets the
publicKey
key
object with the KI_DSAPublic information and the
privateKey
key object with the
KI_DSAPrivate information. You must pass an initialized random algorithm to
B_GenerateKeypair.
typedef struct {
ITEM prime; /* the prime p */
ITEM subPrime; /* the subprime q */
ITEM base; /* the base g */
} A_DSA_PARAMS;