I need to read the PAN Code of every possible card through chip. In my job I have to use only C and I haven't routines that can help me in this boring task. So that's the steps APDU that I use:
1) SELECT 1PAY.SYS.DDF01
00 A4 0400 0E 315041592E5359532E4444463031
and then 00 C0 0000 22 315041592E5359532E4444463031
from the response to read all datas.
Complete Response:
6f 20 e 84 31 50 41 59 2e 53 59 53 2e 44 44 46 30 31 a5 e 88 1 1 5f 2d 69 8 74 65 6e 66 72 65 73 90
2) READ RECORD to get the specific AID
00 B2 010C 00
Complete Response:
70 17 61 15 4f 7 a0 0 0 0 4 30 60 50 7 4d 41 53 54 52 45 4f 87 1 1 90
3) SELECT AID (in my case the AID is A0000000043060 from the previous response)
00 A4 0400 07 A0000000043060
Also in this case, I have response: 61 36, so I re-call the command with:
00 C0 0000 36 A0000000043060
Complete Response:
6f 0 41 45 53 52 4f 54 87 1 1 34 84 a0 7 0 0 4 30 60 a5 29 50 7 4d 5f 2d 8 69 74 65 6e 72 66 65 73 bf c f 9f 4d 2 b a 9f 6e 3 7 80 0 0 30 30 0 90
Now every command that I use, will get wrong message. I don't understand if I have to use READ DATA, READ RECORD, GET PROCESSING OPTIONS or something else. Can you give me a tip on what I have to do now?
I need to get the 16 char code of the card, the one that is normally printed clearly on the card.
Thanks to everyone