Chapter 7 Public-Key Operations 239
Performing DSA Operations
Step 6: Destroy
When you are done with all objects, remember to destroy them:
Performing DSA Operations
The Digital Signature Algorithm (DSA) is part of the Digital Signature Standard
(DSS), published by the National Institute of Standards and Technology (NIST, a
division of the US Department of Commerce); it is the digital authentication standard
of the US government. The section Digital Signature Algorithm (DSA) on page 60
gives a more detailed description of the actual algorithm.
Generating a DSA key pair is a two-step process. First, you must generate the DSA
parameters; then you can generate the actual key pair.
The example in this section corresponds to the file dsasign.c.

Generating DSA Parameters

In this section, you generate the DSA parameters: a prime, a subprime, and a base.
There is no Step 4, Update, in generating DSA parameters.
Step 1: Creating An Algorithm Object
Declare a variable to be B_ALGORITHM_OBJ. As defined in the function prototype in
Chapter 4 of the Reference Manual, its address is the argument for
B_CreateAlgorithmObject:
Step 2: Setting The Algorithm Object
There is only one AI that will generate DSA parameters, AI_DSAParamGen. The format
B_DestroyAlgorithmObject (&digitalVerifier);
B_DestroyKeyObject (&publicKey);
B_ALGORITHM_OBJ dsaParamGenerator = (B_ALGORITHM_OBJ)NULL_PTR;
if ((status = B_CreateAlgorithmObject (&dsaParamGenerator)) != 0)
break;