I have written a program to communicate with a smart card (Gemalto Company MPCOS applet). I could successfully connect to card and transmit commands and fetch data.
However I have a problem:
When I used 00 A4 01 00 02 02 00
command to select DF(Dedicated File),
It returned error 69 81
(file indicator is incorrect).
This is so weird because after this command I used another command to fetch sub-file of this DF and it returned success 61 12
.
command1(Select MPCOS Applet): 00 A4 04 00 10 A0 00 00 00 18 30 03 01 00 00 00 00 00 00 00 00
-> response: [97,18] (in decimal) or 6112 (in hex)
command2: 00 C0 00 00 12
-> response: [105,133,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] (in decimal) or
69 85 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 (in hex)
command3(Select Root): 00 A4 00 00 02 3f 00
-> response: [97,18] (in decimal) or 6112 (in hex)
command4: 00 C0 00 00 12
-> response: [105,133,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] (in decimal) or
69 85 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 (in hex)
command5(Select DF): 00 A4 01 00 02 02 00
-> response: [105,129] (in decimal) or 6981 (in hex)
command6(Select EF): 00 A4 02 00 02 02 01
-> response: [97,18] (in decimal) or 6112 (in hex)
command7: 00 C0 00 00 12
-> response: [105,133,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] (in decimal) or
69 85 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 (in hex)