Description This function takes the account information and a PIN entered by the user to build a formatted PIN. Encrypting this formatted PIN once or twice returns a PIN block which can be written on a magnetic card or sent to a host. The PIN block can be calculated using one of the formats specified in the WFS_INF_PIN_CAPABILITIES command. This command clears the PIN.
Input Param LPWFSPINBLOCK lpPinBlock;
typedef struct _wfs_pin_block
{
LPSTR lpsCustomerData;
LPSTR lpsXORData;
BYTE bPadding;
WORD wFormat;
LPSTR lpsKey;
LPSTR lpsKeyEncKey;
} WFSPINBLOCK, * LPWFSPINBLOCK;
lpsCustomerData
Used for ANSI, ISO-0 and ISO-1 algorithm to build the formatted PIN. For ANSI and ISO-0 the PAN (Primary Account Number) is used, for ISO-1 a ten digit transaction field is required. If not used a NULL is required.
Used for DIEBOLD with coordination number, as a two digit coordination number.
lpsXORData
If the formatted PIN is encrypted twice to build the resulting PIN block, this data can be used to modify the result of the first encryption by an XOR-operation.
bPadding
Specifies the padding character.
wFormat
Specifies the format of the PIN block. Possible values are:
(see command WFS_INF_PIN_CAPABILITIES)
lpsKey
Specifies the key used to encrypt the formatted pin for the first time, NULL if no encryption is required.
lpsEncKey
Specifies the key used to format the once encrypted formatted PIN, NULL if no second encryption required.
Output Param LPWFSXDATA lpxPinBlock;
lpxPinBlock
Pointer to the encrypted/decrypted data.
Error Codes The following additional error codes can be generated by this command:
Value Meaning
WFS_ERR_PIN_KEYNOTFOUND The specified key was not found
WFS_ERR_PIN_KEYNOVALUE The specified key is not loaded.
WFS_ERR_PIN_USEVIOLATION The specified use is not supported by this key.
WFS_ERR_PIN_MODENOTSUPPORTED The specified mode is not supported.
WFS_ERR_PIN_ACCESSDENIED The encryption module is either not initialized or not ready for any vendor specific reason.
WFS_ERR_PIN_NOPIN PIN has been cleared.
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.