4.2 WFS_CMD_PIN_IMPORT_KEY

Description The key passed by the application is loaded in the encryption module. The key can be passed in clear text mode or encrypted with an accompanying “key encryption key”.

Input Param LPWFSPINIMPORT lpImport;

typedef struct _wfs_pin_import
{
LPSTR lpsKey;
LPSTR lpsEncKey;
LPWFSXDATA lpxIdent;
LPWFSXDATA lpxValue;
WORD fwUse;
} WFSPINIMPORT, * LPWFSPINIMPORT;

lpsKey
Specifies the name of key being loaded.

lpsEncKey
If lpsEncKey is NULL the key is loaded directly into the encryption module. Otherwise, lpsEncKey specifies a key name or a format name which were used to encrypt the key string passed in lpxValue.

lpxIdent
Specifies the key owner identification. The use of this parameter is vendor dependent.

lpxValue
Specifies the value of key to be loaded.

fwUse
Specifies the type of access for which the key can be used as a combination of the following flags:

Value Meaning

WFS_PIN_USECRYPT key can be used for encryption/decryption

WFS_PIN_USEFUNCTION key can be used for PIN functions

WFS_PIN_USEMACING key can be used for MACing

WFS_PIN_USEKEYENCKEY key is used as key encryption key

WFS_PIN_USESVENCKEY key is used as CBC Start Value encryption key

WFS_PIN_USENODUPLICATE key can be imported only once

Output Param LPWFSXDATA lpxKVC;

lpxKVC
pointer to the key verification code data that can be used for verification of the loaded key, NULL if device does not have that capability.

Error Codes The following additional error codes can be generated by this command:

Value Meaning

WFS_ERR_PIN_KEYNOTFOUND The specified key encryption key was not found.

WFS_ERR_PIN_KEYNOVALUE The specified key encryption key is not loaded.

WFS_ERR_PIN_USEVIOLATION The specified use is not supported by this key.

WFS_ERR_PIN_ACCESSDENIED The encryption module is either not initialized or not ready for any vendor specific reason.

WFS_ERR_PIN_INVALIDID The ID passed was not valid.

WFS_ERR_PIN_DUPLICATEKEY A key exists with that name and cannot be overwritten.

WFS_ERR_PIN_INVALIDKEYLENGTH The length of lpxValue is not supported.

Events The following additional events can be generated by this command:

Value Meaning

WFS_SRVE_PIN_ILLEGAL_KEY_ACCESS An error occured accessing an encryption key.

Comments None.