Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
virtual P6R::P6ERR P6R::p6ITokenImpl2::generateKeyPair ( CK_RV pRV,
CK_SESSION_HANDLE  hSession,
CK_MECHANISM_PTR  pMechanism,
CK_ATTRIBUTE_PTR  pPublicKeyTemplate,
CK_ULONG  ulPublicKeyAttributeCount,
CK_ATTRIBUTE_PTR  pPrivateKeyTemplate,
CK_ULONG  ulPrivateKeyAttributeCount,
CK_OBJECT_HANDLE_PTR  phPublicKey,
CK_OBJECT_HANDLE_PTR  phPrivateKey 
)
pure virtual

Invoked when the PKCS 11 C_GenerateKeyPair() function is called.

All other parameters are as defined by the PKCS 11 Version 2.40 specification (see reference 1). The function return code is meant to convey an error to the enclosing PKCS 11 library, while the pRV parameter returns specific PKCS 11 error codes to the calling application.

From PKCS 11 (version 2.40) spec, Section C_GenerateKeyPair: "A call to C_GenerateKeyPair will never create just one key and return. A call can fail, and create no keys; or it can succeed, and create a matching public/private key pair." The implementation of this function must comply with this requirement.

Parameters
pRV[ out ] PKCS 11 return value to be returned to the caller. CKR_FUNCTION_NOT_SUPPORTED is returned if the function is not implemented.
Returns
SuccessP6R::eOk 
FailureP6R::eNotInitializedA call to initialize() has not been made.
P6R::eInvalidState