GenerateDsaKeyPair

Generate DSA key pair.

Synopsis

CK_RV GenerateDsaKeyPair(
CK_SESSION_HANDLE hSession,
char * txt,
int ftok,
int priv,
int param,
CK_SIZE valueBits,
CK_OBJECT_HANDLE * phPublicKey,
CK_OBJECT_HANDLE * phPrivateKey);
Parameter Description
hSession Open session handle
txt Optional label
ftok 1 for a Token object, 0 for Session object
priv 1 for private object, 0 for public object
param 1 to generate new DSA parameters, 0 to use defaults (see below)
valueBits Number of bits in Prime
phPublicKey Reference to object handle to hold created public key
phPrivateKey Reference to object handle to hold created private key

On Successful Return

*phPublicKey — handle to newly created public key

*phPrivateKey — handle to newly created private key

In addition to the Public key attributes set via the parameters, the following are set:

CKA_CLASS CKO_PUBLIC_KEY 
CKA_KEY_TYPE CKK_DSA
CKA_VERIFY TRUE
CKA_EXTRACTABLE TRUE

In addition to the Private key attributes set via the parameters, the following are set:

CKA_CLASS CKO_PRIVATE_KEY 
CKA_KEY_TYPE CKK_DSA
CKA_SUBJECT_STR “SUBJECT”
CKA_ID 123
CKA_SENSITIVE TRUE
CKA_SIGN TRUE
CKA_EXTRACTABLE TRUE

The default values for the DSA parameters are:

512 P = fca682ce8e12caba26efccf7110e526db078b05edecbcd1eb4a208f3ae1617ae01f35b91a47e6df6 3413c5e12ed0899bcd132acd50d99151bdc43ee737592e17

512 Q = 962eddcc369cba8ebb260ee6b6a126d9346e38c5

512 G = 678471b27a9cf44ee91a49c5147db1a9aaf244f05a434d6486931d2d14271b9e35030b71fd73da 179069b32e2935630e1c2062354d0da20a6c416e50be794ca4

1024 P = e2662c8df32db56309ccb7f8f419e73263c55c1a89954fa68d85d8b09c720618532bd05dc0994b e245526367b08888f4ef07bb0977ac6aa3c4653f6d70151027fb73a9d7f99e63a63ea5c89de1b1 5b35ecc0beae18a89ee4aac0f75b2c364026c3b6ef8ad13cdd6886d93f9b86c71cb2537b449643 4412033ab3002de749d963

1024 Q = fd5274d166045c96e5f180ab181ccde55804a9c7

1024 G = 0c8392be4b9c222526fc2160864b117b7c8d9e3bec9faa1f7e4d8cfcecbfbf521a0aca11620aaaf0 f847068e8f6c936438bd482cd2d6ee2bbac519b63f5809c412dbd39664fa4e05567fc9bf01f83e3 f816aa945304f31e832a243e138b7b776bb519411d5669b4c6e38c840c2b9ae195f84f04b8b508 7271613c12d938720cc