问题
EMV Book_3 says:
CLA: 80
INS: A8
P1 : 00
P2 : 00
Lc : var
Data: Processing Options Data Object List (PDOL) related data
Le: 00
And my APDU Command looks like: "80 A8 00 00 0C PDOL 00",
where PDOL =
"9F 66 04 9F 02 06 9F 37 04 5F 2A 02"
.
I'm receiving: 6A 80
The CC I'm using is Visa PayWave contactless.
The full FCI (File Control Information) Proprietary Template is:
"50 0C 56 69 73 61 20 43 6C 61 73 73 69 63 87 01 01 9F 38 0C 9F 66 04 9F 02 06 9F 37 04 5F 2A 02 5F 2D 04 62 67 65 6E"
What I'm missing? What will be the correct Get Processing Option command?
回答1:
the PDOL tag means that the tags specified by the next specified number of bytes represent the data to be concatenated to the end of the command. In your question the PDOL tag, 9f 38, specifies the next 0Ch (12d) bytes indicate the data to be sent to the card. You have:
9f 66 04 - the tag 9f 66 represents the terminal transaction qualifiers. Thus the PDOL must have 4h (hex) bytes of the terminal transaction qualifiers coded into the four bytes.
9f 02 06 - tag 9f 02 stands for authorized amount. The PDOL list must have the amount, authorized, coded into 6h bytes added to it.
9f 37 04 - tag 9f 37 stands for unpredictable number, thus encode such a number in 4 bytes and add it to the list
....
Translate the rest similarly. The list must be in the order specified in the Tag data received from the card e.g. in your list, the TTQs must be first, followed by amount authorized e.t.c. From your results, the total size of the data should be 4+6+4+2= 16 = 10h bytes. Thus the final command would look like this with sample data:
<------the data concatenated together--------->
=> 80 a8 00 00 12 83 10 f3 20 40 00 00 00 00 01 00 00 04 04 06 03 05 08 00
NB: note the value of Lc, 12h, and the two bytes after it. The hex value 0x83 must be present right after Lc, and the byte after it should be the actual length of the data i.e. 10h, thus Lc = 10h + 2 = 12h as specified above. Don't forget the Le at the end!
来源:https://stackoverflow.com/questions/27859860/how-to-correctly-construct-get-processing-option-command-message