Electronic funds transfer operations.
See the HSM technical documentation.
Settings and Macros | |
#define | DN_CALC_ARPC_EMV_4_2_M1_ICC (1) |
#define | DN_CALC_ARPC_EMV_4_2_M1_SK (2) |
#define | DN_CALC_ARPC_EMV_4_2_M2 (3) |
#define | DN_EFT_AES_KCV_TYPE_CMAC (1) |
#define | DN_EFT_GET_KCV_TYPE_X9_24 (1) |
#define | DN_EFT_GET_KCV_TYPE_CMAC (2) |
#define | DN_EXP_ZPK_FLAG_FULL_CKS (1) |
#define | DN_EFT_GET_KCV_MAX_LEN (3) |
#define | DN_EFT_GEN_OFFLINE_KCV_TYPE_X9_24 (1) |
#define | DN_EFT_GEN_OFFLINE_KCV_TYPE_CMAC (2) |
#define | DN_EFT_KCV_TYPE_X9_24_LEN (3) |
#define | DN_EFT_KCV_TYPE_CMAC_LEN (3) |
Functions | |
int AAP_API | DPINBlockTranslate(HSESSIONCTX hSession, char *szSrcPEK, char *szDstPEK, BYTE bTransBlockType, char *szPAN, BYTE *pbInPinBlock, BYTE *pbOutPinBlock, DWORD dwParam) |
int AAP_API | DGenerateCVV(HSESSIONCTX hSession, char *szKeyId, char *szPAN, char *szExpirationDate, char *szServiceCode, char *szCVV, DWORD dwParam) |
int AAP_API | DVerifyCVV(HSESSIONCTX hSession, char *szKeyId, char *szPAN, char *szExpirationDate, char *szServiceCode, char *szCVV, DWORD dwParam) |
int AAP_API | DGeneratePIN(HSESSIONCTX hSession, char *szPGK, char *szPAN, DWORD dwOperation, int nPinLen, char *szInPin, char *szOffset, char *szOutPin, DWORD dwParam) |
int AAP_API | DVerifyPINBlock(HSESSIONCTX hSession, char *szPTK, char *szPGK, char *szPAN, char *szOffset, BYTE *pbInPinBlock, DWORD dwParam) |
int AAP_API | DEFTCheckKeyParts (int nKeyAlgId, EFT_VISA_KEY_PARTS *pstKeyParts, DWORD dwParam) |
int AAP_API | DGenerateDUKPT(HSESSIONCTX hSession, BYTE *pbKSI, BYTE *pbDID_CTR, char *szDUKPT, DWORD dwParam) |
void AAP_API | DGenerateBDKName(BYTE *pbKSI, char *szBDKName, DWORD dwParam) |
void AAP_API | DGenerateDUKPTName(BYTE *pbKSI, BYTE *pbDID_CTR, char *szDUKPTName, DWORD dwParam) |
int AAP_API | DGeneratePVV(HSESSIONCTX hSession, char *szPGK, BYTE bPVKI, char *szPAN, char *szPIN, char *szPVV, DWORD dwParam) |
int AAP_API | DGenerateDAC(HSESSIONCTX hSession, char *szIMKDAC, char *szPAN, BYTE *pbSEQ, BYTE *pbDAC, DWORD dwParam) |
int AAP_API | DVerifyDAC(HSESSIONCTX hSession, char *szIMKDAC, char *szPAN, BYTE *pbSEQ, BYTE *pbDAC, DWORD dwParam) |
int AAP_API | DSignSDA(HSESSIONCTX hSession, char *szIK, BYTE *pbDAC, DWORD dwSDA_DATALen, BYTE *pbSDA_DATA, DWORD *pdwSigLen, BYTE *pbSig, DWORD dwParam) |
int AAP_API | DGenerateDDA_ICCCert(HSESSIONCTX hSession, BYTE bOP, char *szIK, char *szPAN, DWORD dwDDA_DATALen, BYTE *pbDDA_DATA, DWORD *pdwSigLen, BYTE *pbSig, DWORD dwParam) |
int AAP_API | DGenerateICCMK(HSESSIONCTX hSession, BYTE bOP, char *szIK, char *szKeK, char *szPAN, BYTE *pbSEQ, DWORD *pdwEnvelopeLen, BYTE *pbEnvelope, DWORD dwParam) |
int AAP_API | DGenerateEMV_HMAC(HSESSIONCTX hSession, BYTE bOP, char *szIK, char *szPAN, BYTE *pbSEQ, BYTE *pbNONCE, DWORD dwDataLen, BYTE *pbData, BYTE *pbMAC, DWORD dwParam) |
int AAP_API | DGenerateEMV_MAC(HSESSIONCTX hSession, BYTE bOP, char *szIK, char *szPAN, BYTE *pbSEQ, BYTE *pbNONCE, DWORD dwDataLen, BYTE *pbData, BYTE *pbMAC, DWORD dwParam) |
int AAP_API | DCheckIDN(HSESSIONCTX hSession, char *szIK, char *szPAN, BYTE *pbSEQ, BYTE *pbATC, BYTE *pbUN, BYTE *pbIDN, DWORD dwParam) |
int AAP_API | DEncryptEMV(HSESSIONCTX hSession, BYTE bEncOP, char *szEncIK, BYTE *pbEncNONCE, BYTE bMacOP, char *szMacIK, BYTE *pbMacNONCE, char *szPAN, BYTE *pbSEQ, DWORD dwDataLen, BYTE *pbData, DWORD *pdwEncDataLen, BYTE *pbEncData, BYTE *pbMAC, DWORD dwParam) |
int AAP_API | DGenerateEMV_CSR(HSESSIONCTX hSession, BYTE bOP, char *szIK, BYTE *pbTrackNum, BYTE *pbServiceID, BYTE *pbIssuerID, BYTE *pbExpDate, DWORD *pdwCSRLen, BYTE *pbCSR, DWORD dwParam) |
int AAP_API | DGenerateEMV_CSREx(HSESSIONCTX hSession, BYTE bOP, char *szIK, BYTE *pbTrackNum, BYTE *pbServiceID, BYTE *pbIssuerID, BYTE *pbExpDate, DBLOB *pdbCSR, BYTE *pbHash, DWORD dwParam) |
int AAP_API | DGenerateEMV_PinBlock(HSESSIONCTX hSession, BYTE bOP, BYTE *pbNONCE, char *szTransportKey, char *szISSUER_MK, char *szISSUER_SMC_MK, char *szPAN, BYTE *pbSEQ, BYTE *pbOLD_PB, BYTE *pbNEW_PB, BYTE *pbOutBlock, DWORD *pdwOutBlockLen, DWORD dwParam) |
int AAP_API | DDeriveEMV_Key(HSESSIONCTX hSession, char *szSrcKey, WORD wBufferLen, BYTE *pbBuffer, BYTE bOP, DWORD dwAttrib, char *szDstKey, HKEYCTX *phKey, DWORD dwParam) |
int AAP_API | DCalculateARPC(HSESSIONCTX hSession, char *szIssuerMK, char *szPAN, BYTE *pbSEQ, BYTE *pbARQC, BYTE *pbARC, BYTE *pbARPC, DWORD dwParam) |
int AAP_API | DCalculateARPC_Ex(HSESSIONCTX hSession, DWORD dwOp, void *pvInData, BYTE *pbARPC, DWORD dwParam) |
int AAP_API | DMAC_ISO9797_1_Met2(DWORD dwType, BYTE *pbKey, DWORD dwAlg, const BYTE *pbMsg, DWORD dwMsgLen, BYTE *pbMAC) |
int AAP_API | DEFTImportKey(HSESSIONCTX hSession, char *szKeyId, int nKeyAlgId, void *pstKeyParts, DWORD dwParam) |
int AAP_API | DEFTExportAESKeyParts(HSESSIONCTX hSession, BYTE bKcvType, const char *szKeyId, void *pvKeyParts, DWORD dwReserved) |
int AAP_API | DEFTExportKey(HSESSIONCTX hSession, BYTE bExportMode, char *szKEKId, char *szKeyId, BYTE *pbEncryptedBlock, DWORD *pdwEncryptedBlockLen, BYTE *pbKeyCheckValue, DWORD dwParam) |
int AAP_API | DEFTKeKImport(HSESSIONCTX hSession, BYTE bOP, DWORD dwAlgId, char *szKeKName, char *szKeyName, DWORD dwAttr, BYTE *pbKCV1, BYTE *pbKCV2, BYTE *pbKCV3, BYTE *pbKCVFinal, BYTE *pbBlob, DWORD dwFlags) |
int AAP_API | DEFTExportZPK(HSESSIONCTX hSession, char *szKeyId, int *pnKeyAlg, int *pnKeySize, EFT_VISA_KEY_PARTS *pstKeyParts, DWORD dwParam) |
int AAP_API | DEFTGetKcv(HSESSIONCTX hSession, BYTE bType, const char *szKeyId, BYTE *pbKcv, DWORD *pdwKcvLen, DWORD dwReserved) |
int AAP_API | DEFTGenKCVOffline(DWORD dwType, int nAlgId, const BYTE *pbKey, DWORD dwKeyLen, BYTE *pbKCV, DWORD *pdwKCVLen, DWORD reserved) |
int AAP_API | DEFTExportTR31(HSESSIONCTX hSession, const char *szKBPK, const char *szKey, void *pvReserved, WORD wUsage, BYTE bMode, BYTE bExport, BYTE *pbOutBlock, DWORD *pdwOutBlockLen, DWORD dwParam) |
int AAP_API | DEFTImportTR31(HSESSIONCTX hSession, const char *szKBPK, const char *szKey, DWORD dwKeyAttributes, BYTE *pbKeyBlock, DWORD dwKeyBlockLen, DWORD dwParam) |
#define DN_CALC_ARPC_EMV_4_2_M1_ICC (1) |
#include <dinamo.h>
#define DN_CALC_ARPC_EMV_4_2_M1_SK (2) |
#include <dinamo.h>
#define DN_CALC_ARPC_EMV_4_2_M2 (3) |
#include <dinamo.h>
#define DN_EFT_AES_KCV_TYPE_CMAC (1) |
#include <dinamo.h>
CMAC-type KCV. In accordance with the PCI "PIN Security Requirements".
#define DN_EFT_GET_KCV_TYPE_X9_24 (1) |
#include <dinamo.h>
Exports an AES key by parts in ANSI X9.24 format.
[in] | hSession | Context acquired through the DOpenSession() function. | ||||||
[in] | bKcvType | Type of KCV to be used for export.
| ||||||
[in] | szKeyId | Name of the key to be exported. | ||||||
[out] | pvKeyParts | Pointer to an EFT_AES_KEY_PARTS structure that will contain the data for reconstructing the key. | ||||||
[in] | dwReserved | Reserved for future use (must be 0). |
#define DN_EFT_GET_KCV_TYPE_CMAC (2) |
#include <dinamo.h>
Generates the KCV (Key Check Value) of the key as defined in the PCI PIN Security Requirements with a size of 3 bytes.
#define DN_EXP_ZPK_FLAG_FULL_CKS (1) |
#include <dinamo.h>
#define DN_EFT_GET_KCV_MAX_LEN (3) |
#include <dinamo.h>
Maximum size of the generated KCV (Key Check Value).
#define DN_EFT_GEN_OFFLINE_KCV_TYPE_X9_24 (1) |
#include <dinamo.h>
Generates the key's KCV (Key Check Value) as defined in ANSI X.9.24 with a size of 3 bytes.
#define DN_EFT_GEN_OFFLINE_KCV_TYPE_CMAC (2) |
#include <dinamo.h>
Generates the KCV (Key Check Value) of the key as defined in the PCI PIN Security Requirements with a size of 3 bytes.
#define DN_EFT_KCV_TYPE_X9_24_LEN (3) |
#include <dinamo.h>
Size of the KCV (Key Check Value) generated.
#define DN_EFT_KCV_TYPE_CMAC_LEN (3) |
#include <dinamo.h>
Size of the KCV (Key Check Value) generated.
int AAP_API DPINBlockTranslate | ( | HSESSIONCTX | hSession, |
char * | szSrcPEK, | ||
char * | szDstPEK, | ||
BYTE | bTransBlockType, | ||
char * | szPAN, | ||
BYTE * | pbInPinBlock, | ||
BYTE * | pbOutPinBlock, | ||
DWORD | dwParam ) |
#include <dinamo.h>
It translates a PIN Block, decrypting the block with one key and encrypting it with another. The incoming block format is identified automatically, and the outgoing block format can be defined by the caller, as long as the format change is not from a PAN Unbound to a PAN Bound. PAN Bound formats are those that use PAN information in their composition. It is therefore possible to perform both key translation and format translation. The caller can perform a forced validation of the format by indicating for the outgoing format, the same one they are using in the incoming PIN Block.
[in] | hSession | Context acquired through the DOpenSession() function. | ||||||||||||
[in] | szSrcPEK | Identifier of the decryption key within the HSM. | ||||||||||||
[in] | szDstPEK | Identifier of the encryption key within the HSM. | ||||||||||||
[in] | bTransBlockType | Output block format identifier. According to the table below.
| ||||||||||||
[in] | szPAN | PAN (Primary Account Number). | ||||||||||||
[in] | pbInPinBlock | Buffer containing the input PIN Block. The buffer must have the size of a PIN Block, DES_BLOCK (8 bytes) . | ||||||||||||
[out] | pbOutPinBlock | Buffer that will contain the outgoing PIN Block. The buffer must have the size of a PIN Block, DES_BLOCK (8 bytes). | ||||||||||||
[in] | dwParam | Reserved for future use (must be 0). |
int AAP_API DGenerateCVV | ( | HSESSIONCTX | hSession, |
char * | szKeyId, | ||
char * | szPAN, | ||
char * | szExpirationDate, | ||
char * | szServiceCode, | ||
char * | szCVV, | ||
DWORD | dwParam ) |
#include <dinamo.h>
Generates a CVV (Card Verification Value), CVV2 or iCVV using a key within the HSM.
This API can also be used to generate card verification codes that support the 3-D Secure protocol. In the case of Visa, the service that implements the protocol is Verified by Visa, and the HSM supports the CAVV standard (Cardholder Authentication Verification Value, which is CVV2 with ATN method). In Mastercard's case, 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.
[in] | hSession | Context acquired through the DOpenSession() function. |
[in] | szKeyId | Identifier of the key within the HSM. This identifier must not contain spaces or special characters. Uppercase and lowercase characters are case-sensitive. 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. |
[in] | szPAN | 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 length 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 size of the PAN must be exactly 16 digits; when it is smaller, it must be completed on the left with zeros, and when it is larger, only the rightmost 16 digits must be used. |
[in] | szExpirationDate | Expiration date. 4-digit length. When generating CVVs and iCVVs, the format must be YYMM. When generating CVV2, the format must be MMYY. When calculating CVC2, this field must be a string ending in zero with the 4 least significant digits of the Transaction Sequence Number, contained in the AVV (Accountholder Authentication Value) converted into the equivalent decimal BCD. Any value smaller than 4 digits must be completed on the left with zeros until it reaches 4 digits. For more details see the Mastercard document SPA Algorithm for the MasterCard Implementation of 3-D Secure - v1.04. When calculating CAVV (CVV2 with the ATN Method), this field must be a zero-ended string with the 4 least significant digits of the ATN (Authentication Tracking Number). For more details see the Visa document 3-D Secure Functional Requirements Access Control Server v. 1.0.2. |
[in] | szServiceCode | Service Code. 3-digit length. For iCVV (Alternate Card Verification Value) generation, the Service Code must be 999. For CVV 2 generation, the Service Code must be 000. For traditional CVV generation, the Service Code is usually 101. |
[out] | szCVV | Output buffer containing the generated CVV string. 3-digit length. The generated value can also be a CVV2 or iCVV, depending on the Service Code values entered. |
[in] | dwParam | Reserved for future use (must be 0). |
int AAP_API DVerifyCVV | ( | HSESSIONCTX | hSession, |
char * | szKeyId, | ||
char * | szPAN, | ||
char * | szExpirationDate, | ||
char * | szServiceCode, | ||
char * | szCVV, | ||
DWORD | dwParam ) |
#include <dinamo.h>
It verifies a CVV (Card Verification Value), CVV2 or iCVV using a key within 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 DGenerateCVV() API.
[in] | hSession | Context acquired through the DOpenSession() function. |
[in] | szKeyId | Identifier of the key within the HSM. This identifier must not contain spaces or special characters. Uppercase and lowercase characters are case-sensitive. 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. |
[in] | szPAN | PAN (Primary Account Number). Length from 12 to 19 characters. See more details about this field in the DGenerateCVV() API. |
[in] | szExpirationDate | 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 DGenerateCVV() API. |
[in] | szServiceCode | 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 |
[in] | szCVV | CVV to be validated. 3-digit length. The value entered can also be a CVV2 or iCVV, depending on the Service Code values entered. |
[in] | dwParam | Reserved for future use (must be 0). |
int AAP_API DGeneratePIN | ( | HSESSIONCTX | hSession, |
char * | szPGK, | ||
char * | szPAN, | ||
DWORD | dwOperation, | ||
int | nPinLen, | ||
char * | szInPin, | ||
char * | szOffset, | ||
char * | szOutPin, | ||
DWORD | dwParam ) |
#include <dinamo.h>
Performs PIN generation operations from the PAN (Personal Account Number) and PGK (Key Name) data entered, with or without the use of offset.
[in] | hSession | Context acquired through the DOpenSession() function. | ||||||||
[in] | szPGK | Key identifier within the HSM. | ||||||||
[in] | szPAN | PAN (Primary Account Number). | ||||||||
[in] | dwOperation | Type of PIN generation. According to the table below.
| ||||||||
[in] | nPinLen | PIN size to be used/generated in the operation. It must be between MIN_EFT_PIN_LEN and MAX_EFT_PIN_LEN. | ||||||||
[in] | szInPin | Input PIN. The buffer must be between MIN_EFT_PIN_LEN + 1 and MAX_EFT_PIN_LEN + 1. | ||||||||
[out] | szOffset | Buffer containing the offset string. The buffer must have a size between MIN_EFT_PIN_LEN + 1 and MAX_EFT_PIN_LEN + 1. | ||||||||
[out] | szOutPin | Buffer containing the outgoing PIN string. The buffer must be between MIN_EFT_PIN_LEN + 1 and MAX_EFT_PIN_LEN + 1. | ||||||||
[in] | dwParam | Reserved for future use (must be 0). |
int AAP_API DVerifyPINBlock | ( | HSESSIONCTX | hSession, |
char * | szPTK, | ||
char * | szPGK, | ||
char * | szPAN, | ||
char * | szOffset, | ||
BYTE * | pbInPinBlock, | ||
DWORD | dwParam ) |
#include <dinamo.h>
Checks the validity of a PIN in a PIN Block. First the PIN is extracted from the PIN Block with the PTK key, and then it is verified with the PGK key, the same one that was used to generate the PIN, with the DGeneratePIN() function.
[in] | hSession | Context acquired through the DOpenSession() function. |
[in] | szPTK | Identifier of the "PIN Block" decryption key within the HSM. It is the PIN Transport Key. |
[in] | szPGK | Identifier of the key to be used for PIN verification within the HSM. It is the PIN Generation Key. |
[in] | szPAN | PAN (Primary Account Number). |
[in] | szOffset | PIN offset. The buffer must be between MIN_EFT_PIN_LEN + 1 and MAX_EFT_PIN_LEN + 1. |
[in] | pbInPinBlock | Buffer containing the input Pin Block to be verified. 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 be the size of a PIN Block, DES_BLOCK (8 bytes). |
[in] | dwParam | Reserved for future use (must be 0). |
int AAP_API DEFTCheckKeyParts | ( | int | nKeyAlgId, |
EFT_VISA_KEY_PARTS * | pstKeyParts, | ||
DWORD | dwParam ) |
#include <dinamo.h>
Checks the validity of the parts of a VISA key with their respective check values, in the format described in the VISA Payment Technology Standards Manual, October 2007.
[in] | nKeyAlgId | Algorithm of the key to be verified. |
[in] | pstKeyParts | Pointer to an EFT_VISA_KEY_PARTS structure containing the parts of the key to be checked and their part check values. |
[in] | dwParam | Reserved for future use (must be 0). |
int AAP_API DGenerateDUKPT | ( | HSESSIONCTX | hSession, |
BYTE * | pbKSI, | ||
BYTE * | pbDID_CTR, | ||
char * | szDUKPT, | ||
DWORD | dwParam ) |
#include <dinamo.h>
It 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).
[in] | hSession | Context acquired through the DOpenSession() function. | ||||||||||||||||
[in] | pbKSI | Buffer of size MIN_KSI_LEN containing the KSI (first 05 bytes of the KSN). | ||||||||||||||||
[in] | pbDID_CTR | Buffer of size MIN_CTR_LEN containing the DID and CTR (last 05 bytes of the KSN). | ||||||||||||||||
[out] | szDUKPT | Buffer of size MAX_OBJ_ID that will contain the DKUPT key name generated from the parameters entered. | ||||||||||||||||
[in] | dwParam | Operating flags according to the table below.
|
#include <dinamo.h>
Generates the BDK name from a KSI (Key Serial Identification).
[in] | pbKSI | Buffer of size MIN_KSI_LEN containing the KSI. |
[out] | szBDKName | Buffer of size MAX_OBJ_ID that will contain the BDK key name generated from the KSI entered in pbKSI. |
[in] | dwParam | Reserved for future use (must be 0). |
void AAP_API DGenerateDUKPTName | ( | BYTE * | pbKSI, |
BYTE * | pbDID_CTR, | ||
char * | szDUKPTName, | ||
DWORD | dwParam ) |
#include <dinamo.h>
Generates the name of the DUKPT from an entered KSI and CTR.
[in] | pbKSI | Buffer of size MIN_KSI_LEN containing the KSI (Key Serial Identification). |
[in] | pbDID_CTR | Buffer of size MIN_CTR_LEN containing the CTR (Device ID and Transaction Counter). |
[out] | szDUKPTName | Buffer of size MAX_OBJ_ID that will contain the DKUPT key name generated from the KSI and CTR entered in pbKSI and pbCTR. |
[in] | dwParam | Reserved for future use (must be 0). |
int AAP_API DGeneratePVV | ( | HSESSIONCTX | hSession, |
char * | szPGK, | ||
BYTE | bPVKI, | ||
char * | szPAN, | ||
char * | szPIN, | ||
char * | szPVV, | ||
DWORD | dwParam ) |
#include <dinamo.h>
It generates a PVV (Pin Verification Value) from a PAN (Primary Account Number), a PIN (Personal Identification Number) and a PGK.
[in] | hSession | Context acquired through the DOpenSession() function. |
[in] | szPGK | Key identifier within the HSM. |
[in] | bPVKI | Key identifier ranging from EFT_MIN_PVKI to EFT_MAX_PVKI. |
[in] | szPAN | PAN (Primary Account Number). |
[in] | szPIN | PIN (Personal Identification Number). |
[out] | szPVV | Buffer containing the generated PVV string. It must have a minimum size of EFT_PVV_LEN + 1 (zero terminator). |
[in] | dwParam | Reserved for future use (must be 0). |
int AAP_API DGenerateDAC | ( | HSESSIONCTX | hSession, |
char * | szIMKDAC, | ||
char * | szPAN, | ||
BYTE * | pbSEQ, | ||
BYTE * | pbDAC, | ||
DWORD | dwParam ) |
#include <dinamo.h>
It generates a DAC (Data Authentication Code) receiving as parameters the PAN (Primary Account Number), the SEQ (PAN Sequence Number) and the IMKDAC (Issuer Master Key) used in the DAC.
[in] | hSession | Context acquired through the DOpenSession() function. |
[in] | szIMKDAC | Key identifier within the HSM. |
[in] | szPAN | PAN (Primary Account Number). |
[in] | pbSEQ | Buffer of size EFT_EMV_SDA_SEQ_LEN containing the SEQ (PAN Sequence Number). |
[out] | pbDAC | Buffer of size EFT_EMV_SDA_DAC_LEN containing the DAC (Data Authentication Code) to be verified. |
[in] | dwParam | Reserved for future use (must be 0). |
int AAP_API DVerifyDAC | ( | HSESSIONCTX | hSession, |
char * | szIMKDAC, | ||
char * | szPAN, | ||
BYTE * | pbSEQ, | ||
BYTE * | pbDAC, | ||
DWORD | dwParam ) |
#include <dinamo.h>
Checks a DAC (Data Authentication Code) receiving as parameters the PAN (Primary Account Number), the SEQ (PAN Sequence Number) and the IMKDAC key (Issuer Master Key) used in the DAC.
[in] | hSession | Context acquired through the DOpenSession() function. |
[in] | szIMKDAC | Key identifier within the HSM. |
[in] | szPAN | PAN (Primary Account Number). |
[in] | pbSEQ | Buffer of size EFT_EMV_SDA_SEQ_LEN containing the SEQ (PAN Sequence Number). |
[in] | pbDAC | Buffer of size EFT_EMV_SDA_DAC_LEN containing the DAC (Data Authentication Code) to be verified. |
[in] | dwParam | Reserved for future use (must be 0). |
int AAP_API DSignSDA | ( | HSESSIONCTX | hSession, |
char * | szIK, | ||
BYTE * | pbDAC, | ||
DWORD | dwSDA_DATALen, | ||
BYTE * | pbSDA_DATA, | ||
DWORD * | pdwSigLen, | ||
BYTE * | pbSig, | ||
DWORD | dwParam ) |
#include <dinamo.h>
Signs a SAD (Static Application Data) to SDA (Static Data Authentication) cards, generating an SSDA (Signed Static Application Data).
[in] | hSession | Context acquired through the DOpenSession() function. |
[in] | szIK | Name of the private key within the HSM that will be used to sign the SAD. |
[in] | pbDAC | Buffer of size EFT_EMV_SDA_DAC_LEN containing the DAC (Data Authentication Code) to be verified. |
[in] | dwSDA_DATALen | Buffer size pointed to by pbSDA_DATA . |
[in] | pbSDA_DATA | Buffer containing the SDA (Static Application Data) to be signed of a size specified in dwSDA_DATALen . |
[in,out] | pdwSigLen | Pointer to a DWORD containing the size of the buffer pointed to by pbSig . |
[out] | pbSig | Buffer size pointed to by pdwSigLen that will receive the SSDA (Signed Static Application Data). NULL can be passed to retrieve the required size from pbSig , which will be returned in pdwSigLen . |
[in] | dwParam | Reserved for future use (must be 0). |
int AAP_API DGenerateDDA_ICCCert | ( | HSESSIONCTX | hSession, |
BYTE | bOP, | ||
char * | szIK, | ||
char * | szPAN, | ||
DWORD | dwDDA_DATALen, | ||
BYTE * | pbDDA_DATA, | ||
DWORD * | pdwSigLen, | ||
BYTE * | pbSig, | ||
DWORD | dwParam ) |
#include <dinamo.h>
Generates the ICC (Integrated Circuit Card) Certificate used in DDA (Dynamic Data Authentication) authentication.
[in] | hSession | Context acquired through the DOpenSession() function. | ||||
[in] | bOP | Type of operation to be applied according to the table below.
| ||||
[in] | szIK | Name of the private key within the HSM that will be used to sign the Certificate. | ||||
[in] | szPAN | PAN (Primary Account Number). | ||||
[in] | dwDDA_DATALen | Buffer size pointed to by pbDDA_DATA . | ||||
[in] | pbDDA_DATA | Buffer containing the data of the certificate to be signed. Pass on the structure described in EMV Book 2 Tables 10 to 14, without including the Recovered Data Header and Trailer fields. | ||||
[in,out] | pdwSigLen | Pointer to a DWORD containing the buffer size pbSig . | ||||
[out] | pbSig | Buffer that will receive the signed certificate. NULL can be passed to retrieve the required size of pbSig , which will be returned in pdwSigLen . | ||||
[in] | dwParam | Reserved for future use (must be 0). |
int AAP_API DGenerateICCMK | ( | HSESSIONCTX | hSession, |
BYTE | bOP, | ||
char * | szIK, | ||
char * | szKeK, | ||
char * | szPAN, | ||
BYTE * | pbSEQ, | ||
DWORD * | pdwEnvelopeLen, | ||
BYTE * | pbEnvelope, | ||
DWORD | dwParam ) |
#include <dinamo.h>
Generates ICC (Integrated Circuit Card) Master Keys.
[in] | hSession | Context acquired through the DOpenSession() function. | ||||||
[in] | bOP | Type of operation to be applied according to the table below.
| ||||||
[in] | szIK | Name of the key within the HSM that will be used to generate the Master Key. | ||||||
[in] | szKeK | Name of the transport key used to encrypt the generated key. | ||||||
[in] | szPAN | PAN (Primary Account Number). | ||||||
[in] | pbSEQ | Buffer of size EFT_EMV_SDA_SEQ_LEN containing the SEQ (PAN Sequence Number). | ||||||
[in,out] | pdwEnvelopeLen | Pointer to a DWORD containing the size of the buffer pointed to by pbEnvelope . | ||||||
[out] | pbEnvelope | Buffer that will receive the envelope with the generated key. NULL can be passed to retrieve the required size of pbSig , which will be returned in pdwEnvelopeLen . | ||||||
[in] | dwParam | Reserved for future use (must be 0). |
int AAP_API DGenerateEMV_HMAC | ( | HSESSIONCTX | hSession, |
BYTE | bOP, | ||
char * | szIK, | ||
char * | szPAN, | ||
BYTE * | pbSEQ, | ||
BYTE * | pbNONCE, | ||
DWORD | dwDataLen, | ||
BYTE * | pbData, | ||
BYTE * | pbMAC, | ||
DWORD | dwParam ) |
#include <dinamo.h>
int AAP_API DGenerateEMV_MAC | ( | HSESSIONCTX | hSession, |
BYTE | bOP, | ||
char * | szIK, | ||
char * | szPAN, | ||
BYTE * | pbSEQ, | ||
BYTE * | pbNONCE, | ||
DWORD | dwDataLen, | ||
BYTE * | pbData, | ||
BYTE * | pbMAC, | ||
DWORD | dwParam ) |
#include <dinamo.h>
It generates a standard EMV or MAC (Message Authentication Code) cryptogram, used in EMV commands.
[in] | hSession | Context acquired through the DOpenSession() function. | ||||||||||||||||||||||
[in] | bOP | Type of operation (padding, key derivation, etc.) to be applied in the construction of the cryptogram (MAC) according to the table below.
| ||||||||||||||||||||||
[in] | szIK | Name of the key within the HSM that will be used to generate the MAC. | ||||||||||||||||||||||
[in] | szPAN | PAN (Primary Account Number). | ||||||||||||||||||||||
[in] | pbSEQ | Buffer of size EFT_EMV_SDA_SEQ_LEN containing the SEQ (PAN Sequence Number). It must be in ASCII format. | ||||||||||||||||||||||
[in] | pbNONCE | Buffer containing the diversifying material used to generate the MAC, must have size DES_BLOCK.
|
The CVN (Cryptogram Version Number) determines the version of the cryptogram used and depends on business definitions. The application must use the NONCE following the CVN version, where applicable.
For more information on which CVN to use, consult your card scheme provider.
[in] | dwDataLen | Buffer size pointed to by pbData . |
[in] | pbData | Buffer size specified by dwDataLen containing the data that will be used to generate the MAC. Note that the padding will be done by the HSM, according to the parameter bOP so the calling application should not pad the data in pbData . |
[out] | pbMAC | DES_BLOCK-sized buffer containing the generated MAC. |
[in] | dwParam | Reserved for future use (must be 0). |
int AAP_API DCheckIDN | ( | HSESSIONCTX | hSession, |
char * | szIK, | ||
char * | szPAN, | ||
BYTE * | pbSEQ, | ||
BYTE * | pbATC, | ||
BYTE * | pbUN, | ||
BYTE * | pbIDN, | ||
DWORD | dwParam ) |
#include <dinamo.h>
Check the IDN (ICC Dynamic Number).
[in] | hSession | Context acquired through the DOpenSession() function. |
[in] | szIK | Name of the key within the HSM that will be used to verify the IDN. |
[in] | szPAN | PAN (Primary Account Number). |
[in] | pbSEQ | Buffer of size EFT_EMV_SDA_SEQ_LEN containing the SEQ (PAN Sequence Number). |
[in] | pbATC | Buffer of size EFT_EMV_IDN_ATC_LEN containing the ATC (Application Transaction Counter). |
[in] | pbUN | Buffer of size EFT_EMV_IDN_UN_LEN containing the UN (Unpredictable Number). |
[in] | pbIDN | Buffer of size EFT_EMV_IDN_LEN containing the IDN (ICC Dynamic Number). |
[in] | dwParam | Reserved for future use (must be 0). |
int AAP_API DEncryptEMV | ( | HSESSIONCTX | hSession, |
BYTE | bEncOP, | ||
char * | szEncIK, | ||
BYTE * | pbEncNONCE, | ||
BYTE | bMacOP, | ||
char * | szMacIK, | ||
BYTE * | pbMacNONCE, | ||
char * | szPAN, | ||
BYTE * | pbSEQ, | ||
DWORD | dwDataLen, | ||
BYTE * | pbData, | ||
DWORD * | pdwEncDataLen, | ||
BYTE * | pbEncData, | ||
BYTE * | pbMAC, | ||
DWORD | dwParam ) |
#include <dinamo.h>
Encrypts data in SMC (Secure Message with Confidentiality) and generates MACs (Message Authenticatino Code) in SMC/SMI (Secure Messaging for Confidentiality/Integrity).
[in] | hSession | Context acquired through the DOpenSession() function. | ||||||||||||||||
[in] | bEncOP | Type of operation to be applied according to the table below.
| ||||||||||||||||
[in] | szEncIK | Name of the key within the HSM that will be used to encrypt the data. | ||||||||||||||||
[in] | pbEncNONCE | Buffer containing the diversifier material used to encrypt the data, must have DES_BLOCK size. | ||||||||||||||||
[in] | bMacOP | Type of operation to be applied according to the table below.
| ||||||||||||||||
[in] | szMacIK | Name of the key within the HSM that will be used to generate the MAC. | ||||||||||||||||
[in] | pbMacNONCE | Buffer containing the diversifying material used to generate the MAC, must have DES_BLOCK size. | ||||||||||||||||
[in] | szPAN | PAN (Primary Account Number). | ||||||||||||||||
[in] | pbSEQ | Buffer of size EFT_EMV_SDA_SEQ_LEN containing the SEQ (PAN Sequence Number). | ||||||||||||||||
[in] | dwDataLen | Buffer size pointed to by pbData . | ||||||||||||||||
[in] | pbData | Buffer of size specified by dwDataLen containing the data that will be used in the encryption/generation of the MAC. | ||||||||||||||||
[in,out] | pdwEncDataLen | Pointer to a DWORD containing the size of the buffer pointed to by pbEncData . | ||||||||||||||||
[out] | pbEncData | Buffer that will contain the encrypted data. NULL can be passed to retrieve the required size of pdwEncDataLen , which will be returned in pdwEncDataLen . | ||||||||||||||||
[out] | pbMAC | Buffer size DES_BLOCK which will contain the generated MAC. Can be NULL if szMacIK e pbMacNONCE are NULL. | ||||||||||||||||
[in] | dwParam | Reserved for future use (must be 0). |
int AAP_API DGenerateEMV_CSR | ( | HSESSIONCTX | hSession, |
BYTE | bOP, | ||
char * | szIK, | ||
BYTE * | pbTrackNum, | ||
BYTE * | pbServiceID, | ||
BYTE * | pbIssuerID, | ||
BYTE * | pbExpDate, | ||
DWORD * | pdwCSRLen, | ||
BYTE * | pbCSR, | ||
DWORD | dwParam ) |
#include <dinamo.h>
Generates the issuer's CSR (Certificate Signing Request).
[in] | hSession | Context acquired through the DOpenSession() function. | ||||||||
[in] | bOP | Type of operation to be applied according to the table below.
| ||||||||
[in] | szIK | Name of the key within the HSM that will be used to generate the CSR (Issuer Key). | ||||||||
[in] | pbTrackNum | Buffer of size EFT_EMV_CSR_VISA_TRACK_NUM_LEN containing the Track Number. | ||||||||
[in] | pbServiceID | Buffer of size EFT_EMV_CSR_VISA_SERVICE_ID_LEN containing the Service ID. | ||||||||
[in] | pbIssuerID | Buffer of size EFT_EMV_CSR_VISA_ISSUER_ID_LEN containing the Issuer ID. | ||||||||
[in] | pbExpDate | Buffer of size EFT_EXP_DATE_LEN containing the expiry date in MMYY format. It must be in ASCII format. | ||||||||
[in,out] | pdwCSRLen | Pointer to a DWORD containing the size of the buffer pointed to by pbCSR . | ||||||||
[out] | pbCSR | Buffer that will contain the CSR. NULL can be passed to retrieve the required size of pbCSR , which will be returned in pdwCSRLen . | ||||||||
[in] | dwParam | Reserved for future use (must be 0). |
int AAP_API DGenerateEMV_CSREx | ( | HSESSIONCTX | hSession, |
BYTE | bOP, | ||
char * | szIK, | ||
BYTE * | pbTrackNum, | ||
BYTE * | pbServiceID, | ||
BYTE * | pbIssuerID, | ||
BYTE * | pbExpDate, | ||
DBLOB * | pdbCSR, | ||
BYTE * | pbHash, | ||
DWORD | dwParam ) |
#include <dinamo.h>
Generates the issuer's CSR (Certificate Signing Request);
[in] | hSession | Context acquired through the DOpenSession() function. | ||||||||||
[in] | bOP | Type of operation to be applied according to the table below.
| ||||||||||
[in] | szIK | Name of the key within the HSM that will be used to generate the CSR (Issuer Key). | ||||||||||
[in] | pbTrackNum | Buffer of size EFT_EMV_CSR_VISA_TRACK_NUM_LEN containing the Track Number. If EFT_EMV_OP_CSR_JCB is defined in bOP this field must contain the Serial Number of size EFT_EMV_CSR_VISA_TRACK_NUM_LEN. | ||||||||||
[in] | pbServiceID | Buffer of size EFT_EMV_CSR_VISA_SERVICE_ID_LEN containing the Service ID. | ||||||||||
[in] | pbIssuerID | Buffer of size EFT_EMV_CSR_VISA_ISSUER_ID_LEN containing the Issuer ID. | ||||||||||
[in] | pbExpDate | Buffer of size EFT_EXP_DATE_LEN containing the expiry date in MMYY format. It must be in ASCII format. | ||||||||||
[out] | pdbCSR | Pointer to one DBLOB which will contain the CSR and its size. The member pvData should be released with DFree() after use. | ||||||||||
[out] | pbHash | Buffer that will contain the HASH. See the table in bOP for the expected values for this parameter. | ||||||||||
[in] | dwParam | Reserved for future use (must be 0). |
int AAP_API DGenerateEMV_PinBlock | ( | HSESSIONCTX | hSession, |
BYTE | bOP, | ||
BYTE * | pbNONCE, | ||
char * | szTransportKey, | ||
char * | szISSUER_MK, | ||
char * | szISSUER_SMC_MK, | ||
char * | szPAN, | ||
BYTE * | pbSEQ, | ||
BYTE * | pbOLD_PB, | ||
BYTE * | pbNEW_PB, | ||
BYTE * | pbOutBlock, | ||
DWORD * | pdwOutBlockLen, | ||
DWORD | dwParam ) |
#include <dinamo.h>
Generates a data segment for a PIN (Personal Identification Number) change command from PIN Blocks. This command is typically an APDU (Application Protocol Data Unit) for an ISO-7816 card.
[in] | hSession | Context acquired through the DOpenSession() function. | ||||||||||||
[in] | bOP | Identifier of the type of derivation of the operation keys for generating the output block. According to the table below.
| ||||||||||||
[in] | pbNONCE | Buffer containing the diversifying material, must have size DES_BLOCK.
| ||||||||||||
[in] | szTransportKey | Identifier of the transport key within the HSM. This key must be of the DES or 3DES type. | ||||||||||||
[in] | szISSUER_MK | Identifier of the "Issuer MK" key within the HSSM. This key must be of type 3DES 112 bits. This key can be the same as the "Issuer SMC MK" key in certain cases. | ||||||||||||
[in] | szISSUER_SMC_MK | Identifier of the "Issuer SMC MK" key within the HSM. This key must be of type 3DES 112 bits. | ||||||||||||
[in] | szPAN | PAN (Primary Account Number). | ||||||||||||
[in] | pbSEQ | Buffer of size EFT_EMV_SDA_SEQ_LEN containing the SEQ (PAN Sequence Number). It must be in ASCII format. | ||||||||||||
[in] | pbOLD_PB | Buffer containing the PIN Block with the current PIN. The buffer must have the size DES_BLOCK (8 bytes). NULL must be passed if the PIN Block with the current password is not required. Blocks in ISO 0/1/2/3 format are supported. | ||||||||||||
[in] | pbNEW_PB | Buffer containing the PIN Block with the new PIN. The buffer must be the size of a DES_BLOCK (8 bytes). Blocks in ISO 0/1/2/3 format are supported. | ||||||||||||
[out] | pbOutBlock | Buffer that will contain the output data segment. A maximum buffer size of PBC_EMV_PIN_BLOCK_MAX_OUTPUT can be used, which will be sufficient for all cases. | ||||||||||||
[in,out] | pdwOutBlockLen | Pointer to a DWORD containing the size of the buffer made available in pbOutPinblock . It will contain the size of the data written in pbOutPinblock in case of success. In case of failure, it will contain the required size of pbOutPinblock . | ||||||||||||
[in] | dwParam | Reserved for future use (must be 0). |
int AAP_API DDeriveEMV_Key | ( | HSESSIONCTX | hSession, |
char * | szSrcKey, | ||
WORD | wBufferLen, | ||
BYTE * | pbBuffer, | ||
BYTE | bOP, | ||
DWORD | dwAttrib, | ||
char * | szDstKey, | ||
HKEYCTX * | phKey, | ||
DWORD | dwParam ) |
#include <dinamo.h>
int AAP_API DCalculateARPC | ( | HSESSIONCTX | hSession, |
char * | szIssuerMK, | ||
char * | szPAN, | ||
BYTE * | pbSEQ, | ||
BYTE * | pbARQC, | ||
BYTE * | pbARC, | ||
BYTE * | pbARPC, | ||
DWORD | dwParam ) |
#include <dinamo.h>
Calculates an ARPC (Authorization Response Cryptogram) following the EMV Book 2 standard (v4.2, 2008), Section 8.2.1, ARPC Method 1.
[in] | hSession | Context acquired through the DOpenSession() function. |
[in] | szIssuerMK | Name of the sender key within the HSM that will be used to generate the MAC. |
[in] | szPAN | PAN (Primary Account Number). |
[in] | pbSEQ | Buffer of size EFT_EMV_SDA_SEQ_LEN containing the SEQ (PAN Sequence Number). |
[in] | pbARQC | DES_BLOCK-sized buffer containing the ARQC (Authorization Request Cryptogram). |
[in] | pbARC | Buffer of size 2 (two bytes) containing the ARC (Authorization Response Code). |
[out] | pbARPC | Buffer of size DES_BLOCK that will contain the generated ARPC. |
[in] | dwParam | Reserved for future use (must be 0). |
int AAP_API DCalculateARPC_Ex | ( | HSESSIONCTX | hSession, |
DWORD | dwOp, | ||
void * | pvInData, | ||
BYTE * | pbARPC, | ||
DWORD | dwParam ) |
#include <dinamo.h>
Calculates an ARPC (Authorization Response Cryptogram).
[in] | hSession | Context acquired through the DOpenSession() function. | ||||||||
[in] | dwOp | Type of ARPC operation to be executed.
| ||||||||
[in] | pvInData | Input data for calculating the ARPC, as described in the parameter dwOP . | ||||||||
[out] | pbARPC | Buffer of size DES_BLOCK that will contain the generated ARPC. | ||||||||
[in] | dwParam | Reserved for future use (must be 0). |
int AAP_API DMAC_ISO9797_1_Met2 | ( | DWORD | dwType, |
BYTE * | pbKey, | ||
DWORD | dwAlg, | ||
const BYTE * | pbMsg, | ||
DWORD | dwMsgLen, | ||
BYTE * | pbMAC ) |
#include <dinamo.h>
It generates a MAC (Message Authentication Code) in the ISO/IEC 9797-1 Method 2 standard. This operation is done offline in the library, outside the HSM.
[in] | dwType | Type of operation to be carried out, according to the table below. |
[in] | pbKey | The buffer containing the key used to generate the MAC must be the same size as the type of key entered in dwAlg . |
[in] | dwAlg | Type of key used to generate the MAC. |
[in] | pbMsg | Buffer that will go through the MAC process. |
[in] | dwMsgLen | Buffer size pbMsg . |
[out] | pbMAC | The buffer containing the generated MAC must be DES_BLOCK in size. |
int AAP_API DEFTImportKey | ( | HSESSIONCTX | hSession, |
char * | szKeyId, | ||
int | nKeyAlgId, | ||
void * | pstKeyParts, | ||
DWORD | dwParam ) |
#include <dinamo.h>
Import a key by parts in EFT formats.
Used to import keys by parts:
[in] | hSession | Context acquired through the DOpenSession() function. | ||||||
[in] | szKeyId | Name of the key to be imported into the HSM. | ||||||
[in] | nKeyAlgId | Supports the following algorithms.
| ||||||
[in] | pstKeyParts | Pointer to a structure containing the data for reconstructing the key as described in nKeyAlgId . | ||||||
[in] | dwParam | Pass 0. Or any of the values below.
|
int AAP_API DEFTExportAESKeyParts | ( | HSESSIONCTX | hSession, |
BYTE | bKcvType, | ||
const char * | szKeyId, | ||
void * | pvKeyParts, | ||
DWORD | dwReserved ) |
#include <dinamo.h>
int AAP_API DEFTExportKey | ( | HSESSIONCTX | hSession, |
BYTE | bExportMode, | ||
char * | szKEKId, | ||
char * | szKeyId, | ||
BYTE * | pbEncryptedBlock, | ||
DWORD * | pdwEncryptedBlockLen, | ||
BYTE * | pbKeyCheckValue, | ||
DWORD | dwParam ) |
#include <dinamo.h>
int AAP_API DEFTKeKImport | ( | HSESSIONCTX | hSession, |
BYTE | bOP, | ||
DWORD | dwAlgId, | ||
char * | szKeKName, | ||
char * | szKeyName, | ||
DWORD | dwAttr, | ||
BYTE * | pbKCV1, | ||
BYTE * | pbKCV2, | ||
BYTE * | pbKCV3, | ||
BYTE * | pbKCVFinal, | ||
BYTE * | pbBlob, | ||
DWORD | dwFlags ) |
#include <dinamo.h>
int AAP_API DEFTExportZPK | ( | HSESSIONCTX | hSession, |
char * | szKeyId, | ||
int * | pnKeyAlg, | ||
int * | pnKeySize, | ||
EFT_VISA_KEY_PARTS * | pstKeyParts, | ||
DWORD | dwParam ) |
#include <dinamo.h>
Exports 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.
[in] | hSession | Context acquired through the DOpenSession() function. | ||||||
[in] | szKeyId | Name of the key to be imported into the HSM. | ||||||
[out] | pnKeyAlg | Algorithm of the exported a-key. | ||||||
[out] | pnKeySize | Size of the exported key. | ||||||
[out] | pstKeyParts | Pointer to an EFT_VISA_KEY_PARTS structure that will contain the parts of the exported key and their KCVs (Key Check Value). | ||||||
[in] | dwParam | The following options are accepted.
|
int AAP_API DEFTGetKcv | ( | HSESSIONCTX | hSession, |
BYTE | bType, | ||
const char * | szKeyId, | ||
BYTE * | pbKcv, | ||
DWORD * | pdwKcvLen, | ||
DWORD | dwReserved ) |
#include <dinamo.h>
[in] | hSession | Context acquired through the DOpenSession() function. | ||||||
[in] | bType | Type of key to be used to generate the KCV.
| ||||||
[in] | szKeyId | Name of the key that will be used to generate the KCV. | ||||||
[out] | pbKcv | Pointer to a buffer that will contain the generated KCV. Can be NULL to get the size of the KCV in pdwKcvLen . | ||||||
[in,out] | pdwKcvLen | Buffer size pbKcv . At the end of the call it will contain the size of the generated KCV. | ||||||
[in] | dwReserved | Reserved for future use (must be 0). |
int AAP_API DEFTGenKCVOffline | ( | DWORD | dwType, |
int | nAlgId, | ||
const BYTE * | pbKey, | ||
DWORD | dwKeyLen, | ||
BYTE * | pbKCV, | ||
DWORD * | pdwKCVLen, | ||
DWORD | reserved ) |
#include <dinamo.h>
Generates a KCV (Key Check Value) of an offline key.
[in] | dwType | KCV type.
| ||||||
[in] | nAlgId | Key algorithm. Currently only DES, 3DES and AES are accepted. | ||||||
[in] | pbKey | Pointer to the buffer containing the key. | ||||||
[in] | dwKeyLen | Key size. | ||||||
[out] | pbKCV | Pointer to the buffer that will contain the generated KCV. | ||||||
[in,out] | pdwKCVLen | Buffer size pbKCV . At the end of the call it will contain the size of the generated KCV. | ||||||
[in] | reserved | Reserved for future use (must be 0). |
int AAP_API DEFTExportTR31 | ( | HSESSIONCTX | hSession, |
const char * | szKBPK, | ||
const char * | szKey, | ||
void * | pvReserved, | ||
WORD | wUsage, | ||
BYTE | bMode, | ||
BYTE | bExport, | ||
BYTE * | pbOutBlock, | ||
DWORD * | pdwOutBlockLen, | ||
DWORD | dwParam ) |
#include <dinamo.h>
Exports a key in TR-31 format according to the ASC X9 TR 31-2018 standard.
[in] | hSession | Context acquired through the DOpenSession() function. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[in] | szKBPK | Name of the KBPK key (Key Block Protection Key) used to derive the encryption and authentication keys. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[in] | szKey | Name of the key to be exported from the HSM. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[in] | pvReserved | Reserved for future use (must be NULL). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[in] | wUsage | Key usage identifier, as described in ASC X9 TR 31-2018 Section A.5.1 table 6. The following options are accepted.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[in] | bMode | Key usage mode identifier, as described in ASC X9 TR 31-2018 Section A.5.3 table 8. The following options are accepted.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[in] | bExport | Key exportability identifier, as described in ASC X9 TR 31-2018 Section A.5.5 table 10. The following options are accepted.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[out] | pbOutBlock | Buffer that will contain the key block. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[in,out] | pdwOutBlockLen | Pointer to the size of the buffer passed pbOutBlock . After the API returns it will contain the actual size of the key block stored in pbOutBlock . If the size is not enough, this variable will contain the required size of pbOutBlock . | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[in] | dwParam | Reserved for future use (must be 0). |
KBPK algorithm | Export method |
---|---|
3DES | 5.3.2.1 Key Derivation Binding Method - TDEA |
AES | 5.3.2.3 Key Block Binding Method - AES |
int AAP_API DEFTImportTR31 | ( | HSESSIONCTX | hSession, |
const char * | szKBPK, | ||
const char * | szKey, | ||
DWORD | dwKeyAttributes, | ||
BYTE * | pbKeyBlock, | ||
DWORD | dwKeyBlockLen, | ||
DWORD | dwParam ) |
#include <dinamo.h>
Import a key in TR-31 format according to the ASC X9 TR 31-2018 standard.
[in] | hSession | Context acquired through the DOpenSession() function. |
[in] | szKBPK | Name of the KBPK key (Key Block Protection Key) used to derive the encryption and authentication keys. |
[in] | szKey | Name of the key to be imported into the HSM. |
[in] | dwKeyAttributes | Additional key parameters. See the options in the DGenerateKey() function. |
[in] | pbKeyBlock | Buffer containing the key block. |
[in] | dwKeyBlockLen | Size of the buffer passed pbKeyBlock . |
[in] | dwParam | Reserved for future use (must be 0). |
KBPK algorithm | Method |
---|---|
3DES | 5.3.2.1 Key Derivation Binding Method - TDEA |
AES | 5.3.2.3 Key Block Binding Method - AES |