我编写了一个与智能卡通信的程序(Gemalto 公司 MPCOS 小程序)。
我可以成功连接到卡并传输命令并获取数据。
但是我有一个问题:
当我使用00 A4 01 00 02 02 00
命令选择 DF(专用文件),
它返回了错误69 81
(文件指示符不正确)。
这很奇怪,因为在这个命令之后我使用了另一个命令来获取这个 DF 的子文件并且它返回了成功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)