Operations for Electronic Funds Transfer.
See HSM technical documentation about operating details, specifications used, licenses and module trade name.
Electronic Funds Transfer Operations. More...
Functions | |
| String | generateDUKPT (byte[] baKSI, byte[] baDID_CTR, int dwParam) throws TacException |
| Generates a DUKPT key within the HSM using a KSI (Key Serial Identification), a DID (Device ID), and a CTR (Transaction Counter) from the same KSN (Key Serial Number). | |
| String | generateDUKPTName (byte[] baKSI, byte[] baDID_CTR) throws TacException |
| Generates the DUKPT name from the provided KSI and CTR. | |
| String | generateBDKName (byte[] baKSI) throws TacException |
| Generates the BDK name from a KSI (Key Serial Identification). | |
| byte[] | translatePINBlock (String srcPEK, String dstPEK, int transBlockType, String PAN, byte[] inPINBlock) throws TacException |
| Translates a PIN Block by decrypting the block with one key and encrypting it with another. | |
| byte[] | exportTR31 (String kbpk, String key, int usage, byte mode, byte export) throws TacException |
| Exports a key in TR-31 format according to the ASC X9 TR 31-2018 standard. | |
| void | importTR31 (String kbpk, String key, int keyAttributes, byte[] keyBlock) throws TacException |
| Imports a key in TR-31 format according to the ASC X9 TR 31-2018 standard. | |
| void | mergeX9_24KeyParts (String destKey, int attributes, String part1, String part2, String part3, byte[] expectedKcv) throws TacException |
| Generates a symmetric key by combining 2 or 3 key components using XOR, as defined in the ANSI X9.24 standard. | |
| EftKeyParts | exportKeyParts (String keyId, int flags) throws TacException |
| Export a ZPK (Zone PIN Key) or ZMK (Zone Master Key) key. | |
| void | importKeyParts (String keyId, int keyAlg, EftKeyParts parts, int flags) throws TacException |
| String | generateCVV (String keyId, String pan, String expirationDate, String serviceCode, int params) throws TacException |
| Generates a CVV (Card Verification Value), CVV2, or iCVV using a key within the HSM. | |
| boolean | verifyCVV (String keyId, String pan, String expirationDate, String serviceCode, String cvv, int params) throws TacException |
| Checks a CVV (Card Verification Value), CVV2 or iCVV using a key inside the HSM. | |
| boolean | verifyPINBlock (String ptk, String pgk, String pan, String offset, byte[] pinBlock, int param) throws TacException |
| Checks the validity of a PIN in a PIN Block. | |
| String generateDUKPT | ( | byte[] | baKSI, |
| byte[] | baDID_CTR, | ||
| int | dwParam ) throws TacException |
Generates a DUKPT key within the HSM using a KSI (Key Serial Identification), a DID (Device ID), and a CTR (Transaction Counter) from the same KSN (Key Serial Number).
| baKSI | Buffer of size TacNDJavaLib.MIN_KSI_LEN containing the KSI (first 05 bytes of the KSN). | ||||||||||||||
| baDID_CTR | Buffer of size TacNDJavaLib.MIN_CTR_LEN containing the DID and CTR (last 05 bytes of the KSN). | ||||||||||||||
| dwParam | Operation flags according to the table below.
|
| TacException |
| String generateDUKPTName | ( | byte[] | baKSI, |
| byte[] | baDID_CTR ) throws TacException |
Generates the DUKPT name from the provided KSI and CTR.
| baKSI | Buffer of size TacNDJavaLib.MIN_KSI_LEN containing the KSI (first 05 bytes of the KSN). |
| baDID_CTR | Buffer of size TacNDJavaLib.MIN_CTR_LEN containing the DID and CTR (last 05 bytes of the KSN). |
| TacException |
| String generateBDKName | ( | byte[] | baKSI | ) | throws TacException |
Generates the BDK name from a KSI (Key Serial Identification).
| baKSI | Buffer of size TacNDJavaLib.MIN_KSI_LEN containing the KSI (first 05 bytes of the KSN). |
| TacException |
| byte[] translatePINBlock | ( | String | srcPEK, |
| String | dstPEK, | ||
| int | transBlockType, | ||
| String | PAN, | ||
| byte[] | inPINBlock ) throws TacException |
Translates a PIN Block by decrypting the block with one key and encrypting it with another.
The input block format is automatically identified, and the output block format can be defined by the caller, provided that the format change is not from a PAN Unbound to a PAN Bound. PAN Bound formats are those that incorporate PAN information in their structure. Therefore, both key translation and format translation are possible. The caller can enforce format validation by specifying the same output format as used in the input PIN Block.
| srcPEK | Identifier for the decryption key within the HSM. | ||||||||||||
| dstPEK | Identifier for the encryption key within the HSM. | ||||||||||||
| transBlockType | Identifier for the output block format. As per the table below.
| ||||||||||||
| PAN | PAN (Primary Account Number). | ||||||||||||
| inPINBlock | PIN Block input. The buffer must have the size of a PIN Block, TacNDJavaLib.DES_BLOCK (8 bytes) |
| TacException |
| byte[] exportTR31 | ( | String | kbpk, |
| String | key, | ||
| int | usage, | ||
| byte | mode, | ||
| byte | export ) throws TacException |
Exports a key in TR-31 format according to the ASC X9 TR 31-2018 standard.
| kbpk | Name of the KBPK (Key Block Protection Key) used to derive encryption and authentication keys. | ||||||||||||||||||||||||||
| key | Name of the key to be exported from the HSM. | ||||||||||||||||||||||||||
| usage | Key usage identifier, as described in ASC X9 TR 31-2018 Section A.5.1 table 6. The following options are accepted. | ||||||||||||||||||||||||||
| mode | Key usage mode identifier, as described in ASC X9 TR 31-2018 Section A.5.3 Table 8. The following options are accepted.
| ||||||||||||||||||||||||||
| export | Key exportability identifier, as described in ASC X9 TR 31-2018 Section A.5.5 Table 10. The following options are accepted.
|
| TacException |
| KBPK Algorithm | Export Method |
|---|---|
| 3DES | 5.3.2.1 Key Derivation Binding Method - TDEA |
| AES | 5.3.2.3 Key Block Binding Method – AES |
| void importTR31 | ( | String | kbpk, |
| String | key, | ||
| int | keyAttributes, | ||
| byte[] | keyBlock ) throws TacException |
Imports a key in TR-31 format according to the ASC X9 TR 31-2018 standard.
| kbpk | Name of the KBPK (Key Block Protection Key) used to derive encryption and authentication keys. |
| key | Name of the key to be imported into the HSM. |
| keyAttributes | Additional key parameters. See the options in the createKey() method. |
| keyBlock | key block |
| TacException |
| KBPK Algorithm | Method |
|---|---|
| 3DES | 5.3.2.1 Key Derivation Binding Method - TDEA |
| AES | 5.3.2.3 Key Block Binding Method – AES |
| void mergeX9_24KeyParts | ( | String | destKey, |
| int | attributes, | ||
| String | part1, | ||
| String | part2, | ||
| String | part3, | ||
| byte[] | expectedKcv ) throws TacException |
Generates a symmetric key by combining 2 or 3 key components using XOR, as defined in the ANSI X9.24 standard.
After generation, the KCV of the generated key is compared with expectedKcv. If they do not match, the generated key is removed and the function returns an error.
| destKey | Name of the destination key to be created on the HSM. |
| attributes | Attributes of the generated key. See the options in createKey(). TacNDJavaLib#EXPORTABLE_KEY is prohibited. |
| part1 | Name of the first key component in the HSM. Must have the attribute TacNDJavaLib#AUP_EFT_X9_24_PART. |
| part2 | Name of the second key component in the HSM. Must have the attribute TacNDJavaLib#AUP_EFT_X9_24_PART. |
| part3 | Name of the third key component in the HSM. May be null for operations with only two components. Must have the attribute TacNDJavaLib#AUP_EFT_X9_24_PART. |
| expectedKcv | Buffer of TacNDJavaLib#DN_EFT_KCV_TYPE_X9_24_LEN bytes with the expected KCV of the resulting key, as per ANSI X9.24. |
| TacException | If the KCV does not match the expected value or in the event of an error. |
| EftKeyParts exportKeyParts | ( | String | keyId, |
| int | flags ) throws TacException |
Export a ZPK (Zone PIN Key) or ZMK (Zone Master Key) key.
The export is done in parts, with their respective check values as described in the VISA Payment Technology Standards Manual, October 2007.
| keyId | Name of the key to be exported. | ||||||
| flags | The following options are accepted.
|
| TacException |
| void importKeyParts | ( | String | keyId, |
| int | keyAlg, | ||
| EftKeyParts | parts, | ||
| int | flags ) throws TacException |
| String generateCVV | ( | String | keyId, |
| String | pan, | ||
| String | expirationDate, | ||
| String | serviceCode, | ||
| int | params ) throws TacException |
Generates a CVV (Card Verification Value), CVV2, or iCVV using a key within the HSM.
This API can also be used for generating card verification codes that support the 3-D Secure protocol. For Visa, the service implementing the protocol is Verified by Visa, and the HSM supports the CAVV (Cardholder Authentication Verification Value) standard, which is CVV2 with the ATN method. For Mastercard, the 3-D Secure protocol is implemented in the SecureCode service, and the HSM supports the CVC2 (Card Verification Code 2) and HMAC SHA1 standards.
| keyId | Key name. This key is the CVK (Card Verification Key), a 112-bit 3DES key, and must be the same as the one used for CVV verification. This key can be generated internally in the HSM or imported manually. Normally this key is also used at Visa, sent encrypted by ZCMK (Zone Contro Master Key). As determined in the Visa manual, the 3DES 112 key used as a CVK must be different from the key used for PIN generation and verification and must not be used for other issuer applications, with the exception of CVV2 and iCVV. |
| pan | PAN (Primary Account Number). Size from 12 to 19 characters. For the calculation of CVV, CVV2, and iCVV, according to the Visa standard in the 2007 Payment Technology Standards Manual, the PAN size is independent. For the calculation of CVC2, according to the Mastercard document "SPA Algorithm for the MasterCard Implementation of 3-D Secure – v1.04", the PAN size must be exactly 16 digits; if shorter, it must be padded with leading zeros, and if longer, only the 16 rightmost digits should be used. |
| expirationDate | Expiration date. 4-digit size. For CVV and iCVV generation, the format must be YYMM. For CVV2 generation, the format must be MMYY. In CVC2 calculation, this field must be a null-terminated string containing the 4 least significant digits of the Transaction Sequence Number, found in the AVV (Accountholder Authentication Value) converted to its BCD decimal equivalent. Any value less than 4 digits must be padded with leading zeros to complete the 4 digits. For more details, consult the Mastercard document "SPA Algorithm for the MasterCard Implementation of 3-D Secure – v1.04". In CAVV calculation (CVV2 with the ATN Method), this field must be a null-terminated string containing the 4 least significant digits of the ATN (Authentication Tracking Number). For more details, consult the Visa document "3-D Secure Functional Requirements Access Control Server v. 1.0.2". |
| serviceCode | Service Code. 3-digit size. For iCVV (Alternate Card Verification Value) generation, the Service Code must be 999. For CVV2 generation, the Service Code must be 000. For traditional CVV generation, the Service Code is typically 101. |
| params | Reserved for future use (must be 0). |
| TacException |
| boolean verifyCVV | ( | String | keyId, |
| String | pan, | ||
| String | expirationDate, | ||
| String | serviceCode, | ||
| String | cvv, | ||
| int | params ) throws TacException |
Checks a CVV (Card Verification Value), CVV2 or iCVV using a key inside the HSM.
The API can also be used to verify card verification codes that support the 3-D Secure protocol. See more details in the generateCVV() API.
| keyId | Key name. This key is the CVK (Card Verification Key), a 112-bit 3DES key, and must be the same as the one used to generate the CVV. |
| pan | PAN (Primary Account Number). Length from 12 to 19 characters. See more details about this field in the generateCVV() API. |
| expirationDate | Expiration date. 4-digit length. For CVV and iCVV verification, the format must be YYMM. For CVV 2 verification the format must be MMYY. For information on support for 3-D Secure protocol algorithms, see more details on this field in the generateCVV() API. |
| serviceCode | Service Code. 3-digit length. For iCVV (Alternate Card Verification Value) verification, the Service Code must be 999. For CVV 2 verification, the Service Code must be 000. |
| cvv | CVV to be validated. 3 digits long. The provided value can also be a CVV2 or iCVV, depending on the provided Service Code values. |
| params | Reserved for future use (must be 0). |
| TacException |
| boolean verifyPINBlock | ( | String | ptk, |
| String | pgk, | ||
| String | pan, | ||
| String | offset, | ||
| byte[] | pinBlock, | ||
| int | param ) throws TacException |
Checks the validity of a PIN in a PIN Block.
| ptk | Identifier for the 'PIN Block' decryption key within the HSM. This is the PIN Transport Key. |
| pgk | Identifier for the key to be used in PIN verification within the HSM. This is the PIN Generation Key. |
| pan | PAN (Primary Account Number). Length from 12 to 19 characters. |
| offset | PIN offset. It must be between TacNDJavaLib.MIN_EFT_PIN_LEN and TacNDJavaLib.MAX_EFT_PIN_LEN. |
| pinBlock | PIN Block to be validated. The expected PIN Block format is ISO PIN Block Format 0 (equivalent to ANSI PIN Block Format 0 and VISA PIN Block Format 1). The buffer must have the size of a PIN Block, TacNDJavaLib.DES_BLOCK (8 bytes). |
| param | Reserved for future use (must be 0). |
| TacException |