Closed T-eli closed 7 months ago
This seems to be a question for https://groups.google.com/g/jpos-users, please continue there.
Anyway, you are rebuilding the lmk every time? that’s what your cfg sugests.
If that’s the case, how are you importing the sec_key?
But please continue this in the mailing list and not here, because it doesn't seem to be a jPOS issue.
You can find some examples of transaction_data
generation here:
https://github.com/jpos/jPOS/tree/master/jpos/src/test/java/org/jpos/emv/cryptogram
This way you could validate a cryptogram (Visa or MC), maybe this example will help you:
ISOMsg request = ...;
TLVList tlv = parse(request.get(55));
IssuerApplicationData iad = new IssuerApplicationData(tlv.getString(0x9f10));
CryptogramSpec spc = iad.getCryptogramSpec();
CryptogramDataBuilder dataBuilder = spc.getDataBuilder();
boolean isValid = hsm.validateARQC(
spc.getMKDMethod(),
spc.getSKDMethod(),
...,
ISOUtil.hex2byte(dataBuilder.buildARQCRequest(tlv, iad)));
[!NOTE]
If you use JCESecurityModule you must add padding to the transaction data, for example for visa CVN18:ISOUtil.hex2byte(dataBuilder.buildARQCRequest(tlv, iad)+"80000000"));
Assuming the keys are correct, the error could be that transaction_data
is invalid or missing padding.
@rainer010 thanks for the example . I did not know there was a cryptogram builder interface that I could use.
unfortunately there is no EMV CPA (Common Payment Application) implementation , which is the card I am using for this test.
Apologies @alcarraz I needed help and didn't know where else to post. I will be closing this issue with this comment
Anyway, you are rebuilding the lmk every time? that’s what your cfg sugests.
this is just a testing scenario I am using to verify the cryptogram.
If that’s the case, how are you importing the sec_key?
for now I am just entering it in clear as you can see it in the first code block, because I am using a test card.
hello , i am trying to use jPOS Security Module to validate a cryptogram sent from an EMV Card (CPA), however it keeps returning false.
initialize the SMAdapter and encrypte the Key to lmk:
cfg:
ARQC verification code:
result:
cryptogram generated does not match the card cryptogram
notes:
what i tried :
removing the 2 extra and adding icc data elements didnt work.
what i am suspecting:
question:
what should transaction data format be ?
any help is really appreciated. thanks.