Performing DSA Operations

Step 6: Destroy

When you are done with all objects, remember to destroy them:

B_DestroyAlgorithmObject (&digitalVerifier);

B_DestroyKeyObject (&publicKey);

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:

B_ALGORITHM_OBJ dsaParamGenerator = (B_ALGORITHM_OBJ)NULL_PTR;

if ((status = B_CreateAlgorithmObject (&dsaParamGenerator)) != 0) break;

Step 2: Setting The Algorithm Object

There is only one AI that will generate DSA parameters, AI_DSAParamGen. The format

C h a p t e r 7 P u b l i c - K e y O p e r a t i o n s

2 3 9

Page 261
Image 261
RSA Security 5.2.2 manual Performing DSA Operations, Generating DSA Parameters