BuildRsaCrtKeyPair

Synopsis

CK_RV BuildRsaCrtKeyPair(
CK_SESSION_HANDLE hSession,
char * txt,
int tok,
int priv,
CK_OBJECT_HANDLE * phPub,
CK_OBJECT_HANDLE * phPri,
char * modulusStr,
char * pubExpStr,
char * priExpStr,
char * priPStr,
char * priQStr,
char * priE1Str,
char * priE2Str,
char * priUStr);

Description

Create an RSA key pair given the modulus and exponents, as well as the additional arguments used in Chinese Remainder Theorem processing. If the values for P, Q, E1, E2 and U are not specified, a normal RSA key pair is created.

Parameters

hSession

Open session handle

txt

Optional label

tok

1 for a Token object, 0 for Session object

priv

1 for Private object, 0 for Public object

phPub

Reference to object handle to hold created public key

phPri

Reference to object handle to hold created private key

modulusStr

Key modulus

pubExpStr

Public key exponent

priExpStr

Private key exponent

priPStr

Optional Private key Prime1

priQStr

Optional (optionality set by priPStr) Private key Prime2

priE1Str

Optional (optionality set by priPStr) Private key Exponent1

priE2Str

Optional (optionality set by priPStr) Private key Exponent2

priUStr

Optional (optionality set by priPStr) Private key Coefficient

On successful return

*phPub — handle to newly created public key

*phPri — 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_RSA CKA_VERIFY TRUE CKA_SIGN FALSE CKA_DECRYPT FALSE CKA_ENCRYPT TRUE CKA_EXTRACTABLE TRUE CKA_WRAP FALSE 

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

CKA_CLASS CKO_PRIVATE_KEY CKA_KEY_TYPE CKK_RSA CKA_VERIFY FALSE CKA_SIGN TRUE CKA_DECRYPT TRUE CKA_ENCRYPT FALSE CKA_EXTRACTABLE TRUE CKA_WRAP FALSE