Continue from: EMV Reading PAN Code
I'm working in C, so I havn't Java tools and all the functions that parse automatically the response of APDU command. I want to read all types of smart cards. I have to parse the response of an GET PROCESSING OPTIONS and get the AFL (Access File Locator) of every card.
I have three cards with three different situation:
- A) HelloBank:
77 12 82 2 38 0 94 c 10 2 4 1 18 1 1 0 20 1 1 0 90
- B) PayPal:
77 12 82 2 39 0 94 c 18 1 1 0 20 1 1 0 28 1 3 1 90
- C) PostePay:
80 a 1c 0 8 1 1 0 18 1 2 0 90
Case A)
I've got three different AFL: 10 2 4 1
, 18 1 1 0
, 20 1 1 0
So I send 00 B2 SFI P2 00
where SFI was 10>>3 (10 was first byte of first AFL) and P2 was SFI<<3|4 and this way I got the correct PAN Code of my card.
Case B)
I've got three different AFL: 18 1 1 0
, 20 1 1 0
, 28 1 3 1
.
So I send 00 B2 SFI P2 00
builded in the same way as Case A, but I got the response 6A 83 for every AFL.
Case C)
I've got two different AFL: 8 1 1 0
, 18 1 2 0
but I cannot parse those automatically because there isn't the same TAG of previous response.
If I use those AFL it worked and I can get the PAN Code of the card.
How can I make an universal way to read the correct AFL and how can I make the correct command with those AFL?