KI_DSAPrivate
KI_DSAPrivate
Purpose:
This KI allows you to specify a private key used by the DSA algorithm. The information consists of a private component and the three parameters: p, q, and g, which are explained below. See KI_DSAPrivateBER or KI_DSAPrivateX957BER for the same key type with BER encoding.
Type of information this allows you to use:
a DSA private key. The parameters of the key are specified as the following: private component (x), the prime (p), the subprime (q) and the base (g).
Format of info supplied to B_SetKeyInfo:
pointer to an A_DSA_PRIVATE_KEY structure:
typedef struct | { |
|
ITEM x; |
| /* private component */ |
A_DSA_PARAMS | params; | /* the DSA parameters, p, q and g */ |
}A_DSA_PRIVATE_KEY;
where A_DSA_PARAMS is defined as
typedef struct { |
|
|
ITEM prime; | /* the prime | p */ |
ITEM subPrime; | /* the subprime q */ | |
ITEM base; | /* the base | g */ |
} A_DSA_PARAMS; |
|
|
|
|
|
Each 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 each integer before it is copied to the key object.
Format of info returned by B_GetKeyInfo:
pointer to an A_DSA_PRIVATE_KEY structure (see above). All leading zeros have been stripped from each integer in the structure.
C h a p t e r 3 K e y I n f o Ty p e s | 255 |