KM_ImportToken

Import exported token data previously imported with KM_ExportToken() At this stage, only symmetric keys can be exported via this function.

Synopsis

#include <kmlib.h>

CK_RV KM_ImportToken ( 
   CK_SESSION_HANDLEhSession, 
   const CK_BYTE *tokenData,
   CK_ULONGtokenDataLen
);
Parameter Description
hSession Handle to a USER logged in session on the token to be imported.
tokenData The token data to import.
tokenDataLen The size of the tokenData buffer.

Returns

CKR_ARGUMENTS_BAD
CKR_ATTRIBUTE_READ_ONLY
CKR_ATTRIBUTE_TYPE_INVALID
CKR_ATTRIBUTE_VALUE_INVALID
CKR_BUFFER_TOO_SMALL
CKR_CRYPTOKI_NOT_INITIALIZED
CKR_DEVICE_ERROR
CKR_DEVICE_MEMORY
CKR_DEVICE_REMOVED
CKR_FUNCTION_CANCELED
CKR_FUNCTION_FAILED
CKR_GENERAL_ERROR
CKR_HOST_MEMORY
CKR_MECHANISM_INVALID
CKR_MECHANISM_PARAM_INVALID
CKR_OK
CKR_OPERATION_ACTIVE
CKR_SESSION_CLOSED
CKR_SESSION_HANDLE_INVALID
CKR_SESSION_READ_ONLY
CKR_TEMPLATE_INCOMPLETE
CKR_TEMPLATE_INCONSISTENT
CKR_TOKEN_WRITE_PROTECTED
CKR_UNWRAPPING_KEY_HANDLE_INVALID
CKR_UNWRAPPING_KEY_SIZE_RANGE
CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT
CKR_USER_NOT_LOGGED_IN
CKR_WRAPPED_KEY_INVALID
CKR_WRAPPED_KEY_LEN_RANGE