|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface SMAdapter
A class that implements the SMAdapter interface would act as an adapter to the real security module device (by communicating with it using its proprietary protocol). But application programmers will be communicating with the security module using this simple interface.
| Field Summary | |
|---|---|
static byte |
FORMAT00
Proprietary PIN Block format. |
static byte |
FORMAT01
PIN Block Format adopted by ANSI (ANSI X9.8) and is one of two formats supported by the ISO (ISO 95641 - format 0). |
static byte |
FORMAT02
PIN Block Format 02 supports Douctel ATMs. |
static byte |
FORMAT03
PIN Block Format 03 is the Diabold Pin Block format. |
static byte |
FORMAT04
PIN Block Format 04 is the PIN block format adopted by the PLUS network. |
static byte |
FORMAT05
PIN Block Format 05 is the ISO 9564-1 Format 1 PIN Block. |
static byte |
FORMAT34
PIN Block Format 34 is the standard EMV PIN block format. |
static byte |
FORMAT35
PIN Block Format 35 is the required by Europay/MasterCard for their Pay Now & Pay Later products. |
static byte |
FORMAT41
PIN Block Format 41 is the Visa format for PIN change without using the current PIN. |
static byte |
FORMAT42
PIN Block Format 42 is the Visa format for PIN change using the current (old) PIN. |
static short |
LENGTH_DES
DES Key Length LENGTH_DES = 64. |
static short |
LENGTH_DES3_2KEY
Triple DES (2 keys) LENGTH_DES3_2KEY = 128. |
static short |
LENGTH_DES3_3KEY
Triple DES (3 keys) LENGTH_DES3_3KEY = 192. |
static String |
TYPE_BDK
BDK: Base Derivation Key. |
static String |
TYPE_CVK
CVK: Card Verification Key. |
static String |
TYPE_MK_AC
MK-AC: Issuer Master Key for generating and verifying Application Cryptograms. |
static String |
TYPE_MK_CVC3
MK-CVC3: Issuer Master Key for generating and verifying Card Verification Code 3 (CVC3). |
static String |
TYPE_MK_SMC
MK-SMC: Issuer Master Key for Secure Messaging Confidentiality. |
static String |
TYPE_MK_SMI
MK-SMI: Issuer Master Key for Secure Messaging Integrity. |
static String |
TYPE_PVK
PVK: PIN Verification Key. |
static String |
TYPE_TAK
TAK: Terminal Authentication Key. |
static String |
TYPE_TMK
TMK: Terminal Master Key. |
static String |
TYPE_TPK
TPK: Terminal PIN Key. |
static String |
TYPE_ZAK
ZAK: Zone Authentication Key. |
static String |
TYPE_ZMK
ZMK: Zone Master Key is a DES (or Triple-DES) key-encryption key which is distributed manually in order that further keys can be exchanged automatically. |
static String |
TYPE_ZPK
ZPK: Zone PIN Key. |
| Method Summary | |
|---|---|
String |
calculateCVV(String accountNo,
SecureDESKey cvkA,
SecureDESKey cvkB,
Date expDate,
String serviceCode)
Calaculate a Card Verification Code/Value NOTE: cvkA and cvkB should be single
length keys but at least one of them may be double length key |
String |
calculateIBMPINOffset(EncryptedPIN pinUnderkd1,
SecureDESKey kd1,
SecureDESKey pvk,
String decTab,
String pinValData,
int minPinLen)
Calculate an PIN Offset using the IBM 3624 method of customer selected PIN Using that method is not recomendated. |
String |
calculateIBMPINOffset(EncryptedPIN pinUnderkd1,
SecureDESKey kd1,
SecureDESKey pvk,
String decTab,
String pinValData,
int minPinLen,
List<String> excludes)
Calculate an PIN Offset using the IBM 3624 method of customer selected PIN Using that method is not recomendated. |
String |
calculateIBMPINOffset(EncryptedPIN pinUnderLmk,
SecureDESKey pvk,
String decTab,
String pinValData,
int minPinLen)
Calculate an PIN Offset using the IBM 3624 method Using that method is not recomendated. |
String |
calculateIBMPINOffset(EncryptedPIN pinUnderLmk,
SecureDESKey pvk,
String decTab,
String pinValData,
int minPinLen,
List<String> excludes)
Calculate an PIN Offset using the IBM 3624 method Using that method is not recomendated. |
String |
calculatePVV(EncryptedPIN pinUnderLmk,
SecureDESKey pvkA,
SecureDESKey pvkB,
int pvkIdx)
Calculate PVV (VISA PIN Verification Value of PIN under LMK) with exclude list NOTE: pvkA and pvkB should be single length keys
but at least one of them may be double length key |
String |
calculatePVV(EncryptedPIN pinUnderLmk,
SecureDESKey pvkA,
SecureDESKey pvkB,
int pvkIdx,
List<String> excludes)
Calculate PVV (VISA PIN Verification Value of PIN under LMK) NOTE: pvkA and pvkB should be single length keys
but at least one of them may be double length key |
String |
calculatePVV(EncryptedPIN pinUnderKd1,
SecureDESKey kd1,
SecureDESKey pvkA,
SecureDESKey pvkB,
int pvkIdx)
Calculate PVV (VISA PIN Verification Value of customer selected PIN) NOTE: pvkA and pvkB should be single length keys
but at least one of them may be double length key |
String |
calculatePVV(EncryptedPIN pinUnderKd1,
SecureDESKey kd1,
SecureDESKey pvkA,
SecureDESKey pvkB,
int pvkIdx,
List<String> excludes)
Calculate PVV (VISA PIN Verification Value of customer selected PIN) NOTE: pvkA and pvkB should be single length keys
but at least one of them may be double length key |
String |
decryptPIN(EncryptedPIN pinUnderLmk)
Decrypts an Encrypted PIN (under LMK). |
EncryptedPIN |
deriveIBMPIN(String accountNo,
SecureDESKey pvk,
String decTab,
String pinValData,
int minPinLen,
String offset)
Derive a PIN Using the IBM 3624 method That method derive pin from pin offset (not exacly that same but working). |
EncryptedPIN |
encryptPIN(String pin,
String accountNumber)
Encrypts a clear pin under LMK. |
EncryptedPIN |
encryptPIN(String pin,
String accountNumber,
boolean extract)
Encrypts a clear pin under LMK. |
void |
eraseOldLMK()
Erase the key change storage area of memory It is recommended that this command is used after keys stored by the Host have been translated from old to new LMKs. |
byte[] |
exportKey(SecureDESKey key,
SecureDESKey kek)
Exports secure key to encryption under a KEK (Key-Encrypting Key). |
EncryptedPIN |
exportPIN(EncryptedPIN pinUnderLmk,
SecureDESKey kd2,
byte destinationPINBlockFormat)
Exports a PIN from encryption under LMK to encryption under a KD (Data Key). |
byte[] |
generateARPC(MKDMethod mkdm,
SKDMethod skdm,
SecureDESKey imkac,
String accoutNo,
String acctSeqNo,
byte[] arqc,
byte[] atc,
byte[] upn,
ARPCMethod arpcMethod,
byte[] arc,
byte[] propAuthData)
Genarate Authorisation Response Cryptogram (ARPC) |
byte[] |
generateCBC_MAC(byte[] data,
SecureDESKey kd)
Generates CBC-MAC (Cipher Block Chaining Message Authentication Code) for some data. |
byte[] |
generateEDE_MAC(byte[] data,
SecureDESKey kd)
Generates EDE-MAC (Encrypt Decrypt Encrypt Message Message Authentication Code) for some data. |
SecureDESKey |
generateKey(short keyLength,
String keyType)
Generates a random DES Key. |
byte[] |
generateKeyCheckValue(SecureDESKey kd)
Generates key check value. |
EncryptedPIN |
generatePIN(String accountNumber,
int pinLen)
Generate random pin under LMK |
EncryptedPIN |
generatePIN(String accountNumber,
int pinLen,
List<String> excludes)
Generate random pin under LMK with exclude list |
byte[] |
generateSM_MAC(MKDMethod mkdm,
SKDMethod skdm,
SecureDESKey imksmi,
String accountNo,
String acctSeqNo,
byte[] atc,
byte[] arqc,
byte[] data)
Generate Secure Message MAC over suppiled message data This method is used by issuer to generate MAC over message data send from the issuer back to the card |
SecureDESKey |
importKey(short keyLength,
String keyType,
byte[] encryptedKey,
SecureDESKey kek,
boolean checkParity)
Imports a key from encryption under a KEK (Key-Encrypting Key) to protection under the security module. |
EncryptedPIN |
importPIN(EncryptedPIN pinUnderDuk,
KeySerialNumber ksn,
SecureDESKey bdk)
Imports a PIN from encryption under a transaction key to encryption under LMK. |
EncryptedPIN |
importPIN(EncryptedPIN pinUnderKd1,
SecureDESKey kd1)
Imports a PIN from encryption under KD (Data Key) to encryption under LMK. |
SecureDESKey |
translateKeyFromOldLMK(SecureDESKey kd)
Translate key from encryption under the LMK held in “key change storage” to encryption under a new LMK. |
EncryptedPIN |
translatePIN(EncryptedPIN pinUnderDuk,
KeySerialNumber ksn,
SecureDESKey bdk,
SecureDESKey kd2,
byte destinationPINBlockFormat)
Translates a PIN from encryption under a transaction key to encryption under a KD (Data Key). |
EncryptedPIN |
translatePIN(EncryptedPIN pinUnderKd1,
SecureDESKey kd1,
SecureDESKey kd2,
byte destinationPINBlockFormat)
Translates a PIN from encrytion under KD1 to encryption under KD2. |
org.javatuples.Pair<EncryptedPIN,byte[]> |
translatePINGenerateSM_MAC(MKDMethod mkdm,
SKDMethod skdm,
SecureDESKey imksmi,
String accountNo,
String acctSeqNo,
byte[] atc,
byte[] arqc,
byte[] data,
EncryptedPIN currentPIN,
EncryptedPIN newPIN,
SecureDESKey kd1,
SecureDESKey imksmc,
SecureDESKey imkac,
byte destinationPINBlockFormat)
Translate PIN and generate MAC over suppiled message data This method is used by issuer to: translate standard ATM PIN block format encrypted under zone or terminal key kd1 to an application specific PIN block
format, encrypted under a confidentiality session key, derived from
imksmc
generate MAC over suppiled message data and translated
PIN block |
boolean |
verifyARQC(MKDMethod mkdm,
SKDMethod skdm,
SecureDESKey imkac,
String accountNo,
String acctSeqNo,
byte[] arqc,
byte[] atc,
byte[] upn,
byte[] transData)
Verify Application Cryptogram (ARQC or TC/AAC) Authorization Request Cryptogram (ARQC) - Online authorization Transaction certificate (TC) - Offline approval Application Authentication Cryptogram (AAC) - Offline decline |
byte[] |
verifyARQCGenerateARPC(MKDMethod mkdm,
SKDMethod skdm,
SecureDESKey imkac,
String accountNo,
String acctSeqNo,
byte[] arqc,
byte[] atc,
byte[] upn,
byte[] transData,
ARPCMethod arpcMethod,
byte[] arc,
byte[] propAuthData)
Verify Application Cryptogram (ARQC or TC/AAC) and Genarate Authorisation Response Cryptogram (ARPC) Authorization Request Cryptogram (ARQC) - Online authorization Transaction certificate (TC) - Offline approval Application Authentication Cryptogram (AAC) - Offline decline |
boolean |
verifyCVC3(SecureDESKey imkcvc3,
String accountNo,
String acctSeqNo,
byte[] atc,
byte[] upn,
byte[] data,
MKDMethod mkdm,
String cvc3)
Verify a Dynamic Card Verification Code 3 (CVC3) |
boolean |
verifyCVV(String accountNo,
SecureDESKey cvkA,
SecureDESKey cvkB,
String cvv,
Date expDate,
String serviceCode)
Verify a Card Verification Code/Value NOTE: cvkA and cvkB should be single
length keys but at least one of them may be double length key |
boolean |
verifydCVV(String accountNo,
SecureDESKey imkac,
String dcvv,
Date expDate,
String serviceCode,
byte[] atc,
MKDMethod mkdm)
Verify a Dynamic Card Verification Value (CVV) The EMV "Track 2 Equivalent Data", provided in the authorisation message and originating from the contactless smart card, is the source for the following data elements used in this function: accountNo
expDate
serviceCode
atc
dCVV |
boolean |
verifyIBMPINOffset(EncryptedPIN pinUnderKd1,
SecureDESKey kd1,
SecureDESKey pvk,
String offset,
String decTab,
String pinValData,
int minPinLen)
Verify an PIN Offset using the IBM 3624 method |
boolean |
verifyPVV(EncryptedPIN pinUnderKd1,
SecureDESKey kd1,
SecureDESKey pvkA,
SecureDESKey pvkB,
int pvki,
String pvv)
Verify PVV (VISA PIN Verification Value of an LMK encrypted PIN) NOTE: pvkA and pvkB should be single
length keys but at least one of them may be double length key |
| Field Detail |
|---|
static final short LENGTH_DES
LENGTH_DES = 64.
static final short LENGTH_DES3_2KEY
LENGTH_DES3_2KEY = 128.
static final short LENGTH_DES3_3KEY
LENGTH_DES3_3KEY = 192.
static final String TYPE_ZMK
static final String TYPE_ZPK
static final String TYPE_TMK
static final String TYPE_TPK
static final String TYPE_TAK
static final String TYPE_PVK
static final String TYPE_CVK
static final String TYPE_BDK
static final String TYPE_ZAK
static final String TYPE_MK_AC
static final String TYPE_MK_SMI
static final String TYPE_MK_SMC
static final String TYPE_MK_CVC3
static final byte FORMAT01
static final byte FORMAT02
static final byte FORMAT03
static final byte FORMAT04
static final byte FORMAT05
static final byte FORMAT34
static final byte FORMAT35
static final byte FORMAT41
static final byte FORMAT42
static final byte FORMAT00
This is not a standard format, every Security Module would interpret FORMAT00 differently. So, no interchange would accept PIN Blocks from other interchanges using this format. It is useful only when working with PIN's inside your own interchange.
| Method Detail |
|---|
SecureDESKey generateKey(short keyLength,
String keyType)
throws SMException
keyType - type of the key to be generated (TYPE_ZMK, TYPE_TMK...etc)keyLength - bit length of the key to be generated (LENGTH_DES, LENGTH_DES3_2KEY...)
SMException
byte[] generateKeyCheckValue(SecureDESKey kd)
throws SMException
kd - SecureDESKey with untrusted or fake Key Check Value
SMException
SecureDESKey importKey(short keyLength,
String keyType,
byte[] encryptedKey,
SecureDESKey kek,
boolean checkParity)
throws SMException
keyLength - bit length of the key to be imported (LENGTH_DES, LENGTH_DES3_2KEY...etc)keyType - type of the key to be imported (TYPE_ZMK, TYPE_TMK...etc)encryptedKey - key to be imported encrypted under KEKkek - the key-encrypting keycheckParity - if true, the key is not imported unless it has adjusted parity
SMException - if the parity of the imported key is not adjusted AND checkParity = true
byte[] exportKey(SecureDESKey key,
SecureDESKey kek)
throws SMException
key - the secure key to be exportedkek - the key-encrypting key
SMException
EncryptedPIN encryptPIN(String pin,
String accountNumber)
throws SMException
pin - clear pin as entered by card holderaccountNumber - account number, including BIN and the check digit
SMException
EncryptedPIN encryptPIN(String pin,
String accountNumber,
boolean extract)
throws SMException
pin - clear pin as entered by card holderaccountNumber - if extract is false then account number, including BIN and the check digit
or if parameter extract is true then 12 right-most digits of the account number, excluding the check digitextract - true to extract 12 right-most digits off the account number
SMException
String decryptPIN(EncryptedPIN pinUnderLmk)
throws SMException
pinUnderLmk -
SMException
EncryptedPIN importPIN(EncryptedPIN pinUnderKd1,
SecureDESKey kd1)
throws SMException
pinUnderKd1 - the encrypted PINkd1 - Data Key under which the pin is encrypted
SMException
EncryptedPIN translatePIN(EncryptedPIN pinUnderKd1,
SecureDESKey kd1,
SecureDESKey kd2,
byte destinationPINBlockFormat)
throws SMException
pinUnderKd1 - pin encrypted under KD1kd1 - Data Key (also called session key) under which the pin is encryptedkd2 - the destination Data Key 2 under which the pin will be encrypteddestinationPINBlockFormat - the PIN Block Format of the exported encrypted PIN
SMException
EncryptedPIN importPIN(EncryptedPIN pinUnderDuk,
KeySerialNumber ksn,
SecureDESKey bdk)
throws SMException
pinUnderDuk - pin encrypted under a transaction keyksn - Key Serial Number (also called Key Name, in ANSI X9.24) needed to derive the transaction keybdk - Base Derivation Key, used to derive the transaction key underwhich the pin is encrypted
SMException
EncryptedPIN translatePIN(EncryptedPIN pinUnderDuk,
KeySerialNumber ksn,
SecureDESKey bdk,
SecureDESKey kd2,
byte destinationPINBlockFormat)
throws SMException
pinUnderDuk - pin encrypted under a DUKPT transaction keyksn - Key Serial Number (also called Key Name, in ANSI X9.24) needed to derive the transaction keybdk - Base Derivation Key, used to derive the transaction key underwhich the pin is encryptedkd2 - the destination Data Key (also called session key) under which the pin will be encrypteddestinationPINBlockFormat - the PIN Block Format of the translated encrypted PIN
SMException
EncryptedPIN exportPIN(EncryptedPIN pinUnderLmk,
SecureDESKey kd2,
byte destinationPINBlockFormat)
throws SMException
pinUnderLmk - pin encrypted under LMKkd2 - the destination data key (also called session key) under which the pin will be encrypteddestinationPINBlockFormat - the PIN Block Format of the exported encrypted PIN
SMException
EncryptedPIN generatePIN(String accountNumber,
int pinLen)
throws SMException
accountNumber - The 12 right-most digits of the account number excluding the check digitpinLen - length of the pin, usually in range 4-12.
Value 0 means that default length is assumed by HSM (usually 4)
SMException
EncryptedPIN generatePIN(String accountNumber,
int pinLen,
List<String> excludes)
throws SMException
accountNumber - The 12 right-most digits of the account number excluding the check digitpinLen - length of the pin, usually in range 4-12.
Value 0 means that default length is assumed by HSM (usually 4)excludes - list of pins which won't be generated.
Each pin has to be pinLen length
SMException
String calculatePVV(EncryptedPIN pinUnderLmk,
SecureDESKey pvkA,
SecureDESKey pvkB,
int pvkIdx)
throws SMException
pvkA and pvkB should be single length keys
but at least one of them may be double length key
pinUnderLmk - PIN under LMKpvkA - first key PVK in PVK pairpvkB - second key PVK in PVK pairpvkIdx - index of the PVK, in range 0-6, if not present 0 is assumed
SMException - if PIN is on exclude list WeakPINException is thrown
String calculatePVV(EncryptedPIN pinUnderLmk,
SecureDESKey pvkA,
SecureDESKey pvkB,
int pvkIdx,
List<String> excludes)
throws SMException
pvkA and pvkB should be single length keys
but at least one of them may be double length key
pinUnderLmk - PIN under LMKpvkA - first key PVK in PVK pairpvkB - second key PVK in PVK pairpvkIdx - index of the PVK, in range 0-6, if not present 0 is assumedexcludes - list of pins which won't be generated.
Each pin has to be pinLen length
SMException
String calculatePVV(EncryptedPIN pinUnderKd1,
SecureDESKey kd1,
SecureDESKey pvkA,
SecureDESKey pvkB,
int pvkIdx)
throws SMException
pvkA and pvkB should be single length keys
but at least one of them may be double length key
pinUnderKd1 - the encrypted PINkd1 - Data Key under which the pin is encryptedpvkA - first key PVK in PVK pairpvkB - second key PVK in PVK pairpvkIdx - index of the PVK, in range 0-6, if not present 0 is assumed
SMException
String calculatePVV(EncryptedPIN pinUnderKd1,
SecureDESKey kd1,
SecureDESKey pvkA,
SecureDESKey pvkB,
int pvkIdx,
List<String> excludes)
throws SMException
pvkA and pvkB should be single length keys
but at least one of them may be double length key
pinUnderKd1 - the encrypted PINkd1 - Data Key under which the pin is encryptedpvkA - first key PVK in PVK pairpvkB - second key PVK in PVK pairpvkIdx - index of the PVK, in range 0-6, if not present 0 is assumedexcludes - list of pins which won't be generated.
Each pin has to be pinLen length
WeakPINException - if passed PIN is on excludes list
SMException
boolean verifyPVV(EncryptedPIN pinUnderKd1,
SecureDESKey kd1,
SecureDESKey pvkA,
SecureDESKey pvkB,
int pvki,
String pvv)
throws SMException
pvkA and pvkB should be single
length keys but at least one of them may be double length key
pinUnderKd1 - pin block under kd1kd1 - Data Key (also called session key) under which the pin is encrypted (ZPK or TPK)pvkA - first PVK in PVK pairpvkB - second PVK in PVK pairpvki - index of the PVK, in range 0-6, if not present 0 is assumedpvv - (VISA PIN Verification Value)
SMException
String calculateIBMPINOffset(EncryptedPIN pinUnderLmk,
SecureDESKey pvk,
String decTab,
String pinValData,
int minPinLen)
throws SMException
pinUnderLmk - PIN under LMKpvk - accepts single, double, triple size key length.
Single key length is recomendateddecTab - decimalisation table. Accepts plain text and encrypted
decimalisation table depending to HSM configurationpinValData - pin validation data. User-defined data consisting of hexadecimal
characters and the character N, which indicates to the HSM where
to insert the last 5 digits of the account number. Usualy it consists
the first digits of the card numberminPinLen - pin minimal length
SMException
String calculateIBMPINOffset(EncryptedPIN pinUnderLmk,
SecureDESKey pvk,
String decTab,
String pinValData,
int minPinLen,
List<String> excludes)
throws SMException
pinUnderLmk - PIN under LMKpvk - accepts single, double, triple size key length.
Single key length is recomendateddecTab - decimalisation table. Accepts plain text and encrypted
decimalisation table depending to HSM configurationpinValData - pin validation data. User-defined data consisting of hexadecimal
characters and the character N, which indicates to the HSM where
to insert the last 5 digits of the account number. Usualy it consists
the first digits of the card numberminPinLen - pin minimal lengthexcludes - list of pins which won't be generated.
Each pin has to be pinLen length
WeakPINException - if passed PIN is on excludes list
SMException
String calculateIBMPINOffset(EncryptedPIN pinUnderkd1,
SecureDESKey kd1,
SecureDESKey pvk,
String decTab,
String pinValData,
int minPinLen)
throws SMException
pinUnderKd1 - the encrypted PINkd1 - Data Key under which the pin is encryptedpvk - accepts single, double, triple size key length.
Single key length is recomendateddecTab - decimalisation table. Accepts plain text and encrypted
decimalisation table depending to HSM configurationpinValData - pin validation data. User-defined data consisting of hexadecimal
characters and the character N, which indicates to the HSM where
to insert the last 5 digits of the account number. Usualy it consists
the first digits of the card numberminPinLen - pin minimal length
SMException
String calculateIBMPINOffset(EncryptedPIN pinUnderkd1,
SecureDESKey kd1,
SecureDESKey pvk,
String decTab,
String pinValData,
int minPinLen,
List<String> excludes)
throws SMException
pinUnderKd1 - the encrypted PINkd1 - Data Key under which the pin is encryptedpvk - accepts single, double, triple size key length.
Single key length is recomendateddecTab - decimalisation table. Accepts plain text and encrypted
decimalisation table depending to HSM configurationpinValData - pin validation data. User-defined data consisting of hexadecimal
characters and the character N, which indicates to the HSM where
to insert the last 5 digits of the account number. Usualy it consists
the first digits of the card numberminPinLen - pin minimal lengthexcludes - list of pins which won't be generated.
Each pin has to be pinLen length
WeakPINException - if passed PIN is on excludes list
SMException
boolean verifyIBMPINOffset(EncryptedPIN pinUnderKd1,
SecureDESKey kd1,
SecureDESKey pvk,
String offset,
String decTab,
String pinValData,
int minPinLen)
throws SMException
pinUnderKd1 - pin block under kd1kd1 - Data Key (also called session key) under which the pin is encrypted (ZPK or TPK)pvk - accepts single, double, triple size key length.
Single key length is recomendatedoffset - IBM PIN OffsetdecTab - decimalisation table. Accepts plain text and encrypted
decimalisation table depending to HSM configurationpinValData - pin validation data. User-defined data consisting of hexadecimal
characters and the character N, which indicates to the HSM where
to insert the last 5 digits of the account number. Usualy it consists
the first digits of the card numberminPinLen - min pin length
SMException
EncryptedPIN deriveIBMPIN(String accountNo,
SecureDESKey pvk,
String decTab,
String pinValData,
int minPinLen,
String offset)
throws SMException
accountNo - the 12 right-most digits of the account number excluding the check digitpvk - accepts single, double, triple size key length.
Single key length is recomendateddecTab - decimalisation table. Accepts plain text and encrypted
decimalisation table depending to HSM configurationpinValData - pin validation data. User-defined data consisting of hexadecimal
characters and the character N, which indicates to the HSM where
to insert the last 5 digits of the account number. Usualy it consists
the first digits of the card numberminPinLen - min pin lengthoffset - IBM PIN Offset
SMException
String calculateCVV(String accountNo,
SecureDESKey cvkA,
SecureDESKey cvkB,
Date expDate,
String serviceCode)
throws SMException
cvkA and cvkB should be single
length keys but at least one of them may be double length key
accountNo - The account number including BIN and the check digitcvkA - the first CVK in CVK paircvkB - the second CVK in CVK pairexpDate - the card expiration dateserviceCode - the card service code
Service code should be:
SMException
boolean verifyCVV(String accountNo,
SecureDESKey cvkA,
SecureDESKey cvkB,
String cvv,
Date expDate,
String serviceCode)
throws SMException
cvkA and cvkB should be single
length keys but at least one of them may be double length key
accountNo - The account number including BIN and the check digitcvkA - the first CVK in CVK paircvkB - the second CVK in CVK paircvv - Card Verification Code/ValueexpDate - the card expiration dateserviceCode - the card service code
Service code should be:
SMException
boolean verifydCVV(String accountNo,
SecureDESKey imkac,
String dcvv,
Date expDate,
String serviceCode,
byte[] atc,
MKDMethod mkdm)
throws SMException
accountNo
expDate
serviceCode
atc
dCVV
accountNo - The account number including BIN and the check digitimkac - the issuer master key for generating and verifying Application Cryptogramsdcvv - dynamic Card Verification ValueexpDate - the card expiration dateserviceCode - the card service codeatc - application transactin counter. This is used for ICC Master
Key derivation. A 2 byte value must be supplied.mkdm - ICC Master Key Derivation Method. If null specified
is assumed MKDMethod.OPTION_A
SMException
boolean verifyCVC3(SecureDESKey imkcvc3,
String accountNo,
String acctSeqNo,
byte[] atc,
byte[] upn,
byte[] data,
MKDMethod mkdm,
String cvc3)
throws SMException
The EMV "Track 2 Equivalent Data", provided in the authorisation message and originating from the contactless smart card, is the source for the following data elements used in this function:
accountNo
expDate
serviceCode
atc
unpredictable number
cvc3
imkcvc3 - the issuer master key for generating and verifying CVC3accountNo - The account number including BIN and the check digitacctSeqNo - account sequence number, 2 decimal digitsatc - application transactin counter. This is used for CVC3
calculation. A 2 byte value must be supplied.upn - unpredictable number. This is used for CVC3 calculation
A 4 byte value must be supplied.data - Static Track Data or when this data length is less or equal 2 IVCVC3
mkdm - ICC Master Key Derivation Method. If null specified
is assumed MKDMethod.OPTION_Acvc3 - dynamic Card Verification Code 3. Should contain 5 decimal
digits. Max value is "65535" (decimal representation
of 2 byte value). Is possible to pass shorter cvc3 value e.g.
"789" matches with calcuated CVC3 "04789"
SMException
boolean verifyARQC(MKDMethod mkdm,
SKDMethod skdm,
SecureDESKey imkac,
String accountNo,
String acctSeqNo,
byte[] arqc,
byte[] atc,
byte[] upn,
byte[] transData)
throws SMException
mkdm - ICC Master Key Derivation Method. For skdm equals
SKDMethod.VSDC and SKDMethod.MCHIP this parameter
is ignored and MKDMethod.OPTION_A is always used.skdm - Session Key Derivation Methodimkac - the issuer master key for generating and verifying Application CryptogramsaccountNo - account number including BIN and check digitacctSeqNo - account sequence number, 2 decimal digitsarqc - ARQC/TC/AAC. A 8 byte value must be supplied.atc - application transactin counter. This is used for Session
Key Generation. A 2 byte value must be supplied.
For skdm equals SKDMethod.VSDC is not used.upn - unpredictable number. This is used for Session Key Generation
A 4 byte value must be supplied. For skdm equals
SKDMethod.VSDC is not used.transData - transaction data (without padding). Transaction data
elements and them order is dependend to proper cryptogram version
SMException
byte[] generateARPC(MKDMethod mkdm,
SKDMethod skdm,
SecureDESKey imkac,
String accoutNo,
String acctSeqNo,
byte[] arqc,
byte[] atc,
byte[] upn,
ARPCMethod arpcMethod,
byte[] arc,
byte[] propAuthData)
throws SMException
mkdm - ICC Master Key Derivation Method. For skdm equals
SKDMethod.VSDC and SKDMethod.MCHIP this parameter
is ignored and MKDMethod.OPTION_A is always used.skdm - Session Key Derivation Methodimkac - the issuer master key for generating and verifying Application CryptogramsaccoutNo - account number including BIN and check digitacctSeqNo - account sequence number, 2 decimal digitsarqc - ARQC/TC/AAC. A 8 byte value must be supplied.atc - application transactin counter. This is used for Session
Key Generation. A 2 byte value must be supplied.
For skdm equals SKDMethod.VSDC is not used.upn - unpredictable number. This is used for Session Key Generation
A 4 byte value must be supplied. For skdm equals
SKDMethod.VSDC is not used.arpcMethod - ARPC calculating method. For skdm equals
SKDMethod.VSDC, SKDMethod.MCHIP,
SKDMethod.AEPIS_V40 only ARPCMethod.METHOD_1 is validarc - the Authorisation Response Code. A 2 byte value must be supplied.
For arpcMethod equals ARPCMethod.METHOD_2 it is
csu - Card Status Update. Then a 4 byte value must be supplied.propAuthData - Proprietary Authentication Data. Up to 8 bytes.
Contains optional issuer data for transmission to the card in
the Issuer Authentication Data of an online transaction.
It may by used only for arpcMethod equals
ARPCMethod.METHOD_2 in other case is ignored.
arpcMethod equals
ARPCMethod.METHOD_2 4 bytes ARPC
SMException
byte[] verifyARQCGenerateARPC(MKDMethod mkdm,
SKDMethod skdm,
SecureDESKey imkac,
String accountNo,
String acctSeqNo,
byte[] arqc,
byte[] atc,
byte[] upn,
byte[] transData,
ARPCMethod arpcMethod,
byte[] arc,
byte[] propAuthData)
throws SMException
mkdm - ICC Master Key Derivation Method. For skdm equals
SKDMethod.VSDC and SKDMethod.MCHIP this parameter
is ignored and MKDMethod.OPTION_A is always used.skdm - Session Key Derivation Methodimkac - the issuer master key for generating and verifying Application CryptogramsaccountNo - account number including BIN and check digitacctSeqNo - account sequence number, 2 decimal digitsarqc - ARQC/TC/AAC. A 8 byte value must be supplied.atc - application transactin counter. This is used for Session
Key Generation. A 2 byte value must be supplied.
For skdm equals SKDMethod.VSDC is not used.upn - unpredictable number. This is used for Session Key Generation
A 4 byte value must be supplied. For skdm equals
SKDMethod.VSDC is not used.transData - transaction data (without padding). Transaction data
elements and them order is dependend to proper cryptogram versionarpcMethod - ARPC calculating method. For skdm equals
SKDMethod.VSDC, SKDMethod.MCHIP,
SKDMethod.AEPIS_V40 only ARPCMethod.METHOD_1 is validarc - the Authorisation Response Code. A 2 byte value must be supplied.
For arpcMethod equals ARPCMethod.METHOD_2 it is
csu - Card Status Update. Then a 4 byte value must be supplied.propAuthData - Proprietary Authentication Data. Up to 8 bytes.
Contains optional issuer data for transmission to the card in
the Issuer Authentication Data of an online transaction.
It may by used only for arpcMethod equals
ARPCMethod.METHOD_2 in other case is ignored.
arpcMethod equals ARPCMethod.METHOD_2
4 bytes ARPC, null in other case
SMException
byte[] generateSM_MAC(MKDMethod mkdm,
SKDMethod skdm,
SecureDESKey imksmi,
String accountNo,
String acctSeqNo,
byte[] atc,
byte[] arqc,
byte[] data)
throws SMException
mkdm - ICC Master Key Derivation Method. For skdm equals
SKDMethod.VSDC and SKDMethod.MCHIP this parameter
is ignored and MKDMethod.OPTION_A is always used.skdm - Session Key Derivation Methodimksmi - the issuer master key for Secure Messaging IntegrityaccountNo - account number including BIN and check digitacctSeqNo - account sequence number, 2 decimal digitsatc - application transactin counter. This is used for Session
Key Generation. A 2 byte value must be supplied.
For skdm equals SKDMethod.VSDC is not used.
Second usage is as part of data which will be mackedarqc - ARQC/TC/AAC. A 8 byte value must be supplied.
For skdm equals SKDMethod.MCHIP RAND should
be suppiled. RAND is ARQC incremeted by 1 (with overflow) after
each script command for that same ATC valuedata - for which MAC will be generated. Should contain
APDU command e.g. PIN Unblock, Application block/unblock
with some additional application dependent data
SMException
org.javatuples.Pair<EncryptedPIN,byte[]> translatePINGenerateSM_MAC(MKDMethod mkdm,
SKDMethod skdm,
SecureDESKey imksmi,
String accountNo,
String acctSeqNo,
byte[] atc,
byte[] arqc,
byte[] data,
EncryptedPIN currentPIN,
EncryptedPIN newPIN,
SecureDESKey kd1,
SecureDESKey imksmc,
SecureDESKey imkac,
byte destinationPINBlockFormat)
throws SMException
kd1 to an application specific PIN block
format, encrypted under a confidentiality session key, derived from
imksmc
data and translated
PIN block
mkdm - ICC Master Key Derivation Method. For skdm equals
SKDMethod.VSDC and SKDMethod.MCHIP this parameter
is ignored and MKDMethod.OPTION_A is always used.skdm - Session Key Derivation Methodimksmi - the issuer master key for Secure Messaging IntegrityaccountNo - account number including BIN and check digitacctSeqNo - account sequence number, 2 decimal digitsatc - application transactin counter. This is used for Session
Key Generation. A 2 byte value must be supplied.
For skdm equals SKDMethod.VSDC is not used.
Second usage is as part of data which will be mackedarqc - ARQC/TC/AAC. A 8 byte value must be supplied.
For skdm equals SKDMethod.MCHIP RAND should
be suppiled. RAND is ARQC incremeted by 1 (with overflow) after
each script command for that same ATC valuedata - for which MAC will be generated. Should contain APDU
command PIN Change with some additional application dependent datacurrentPIN - encrypted under kd1 current PIN. Used when
destinationPINBlockFormat equals FORMAT42newPIN - encrypted under kd1 new PIN.kd1 - Data Key (also called transport key) under which the source pin is encryptedimksmc - the issuer master key for Secure Messaging Confidentialityimkac - the issuer master key for generating and verifying
Application Cryptograms. Used when destinationPINBlockFormat equals
FORMAT41 or FORMAT42 in other cases is ignoreddestinationPINBlockFormat - the PIN Block Format of the translated encrypted PIN
SMException
byte[] generateCBC_MAC(byte[] data,
SecureDESKey kd)
throws SMException
data - the data to be MACedkd - the key used for MACing
SMException
byte[] generateEDE_MAC(byte[] data,
SecureDESKey kd)
throws SMException
data - the data to be MACedkd - the key used for MACing
SMException
SecureDESKey translateKeyFromOldLMK(SecureDESKey kd)
throws SMException
kd - the key encrypted under old LMK
SMException - if the parity of the imported key is not adjusted AND checkParity = true
void eraseOldLMK()
throws SMException
SMException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||