如何在DESfire Ev1卡上使用ISO7816 select命令? [英] How to use ISO7816 select command with DESfire Ev1 card?

查看:297
本文介绍了如何在DESfire Ev1卡上使用ISO7816 select命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个DESfire Ev1 1.3版卡,我正在尝试使用ISO7816 apdu样式选择文件.

I have a DESfire Ev1 version 1.3 card and I'm trying to select a file using ISO7816 apdu style.

我有一个文件,有一个辅助文件A0 A1 A2,我可以使用纯模式或打包模式进行选择:

I have one file, with aid A0 A1 A2 and I can select it using both native or wrapped mode:

母语:

-> 5A A0 A1 A2
<- 00

包装:

-> 90 5A 00 00 03 A0 A1 A2 00
<- 91 00

但是,如果我尝试使用ISO7816样式进行选择,则总是会出现找不到文件的错误:

However, if I try to select it using ISO7816 style, I always get a file not found error:

ISO7816:

-> 00 A4 04 00 03 A0 A1 A2 00
-> 6A 82

使用ISO apdu时,AID是否采用其他格式?如何使用它来选择此AID?

When using ISO apdu, is the AID in a different format? How can I select this AID using it?

推荐答案

来自文档:

From the docs:

此APDU通过其ISO应用程序选择一个ISO应用程序 标识符(AID). DESFire的ISO AID为"0xD2 76 00 00 85 01 00". 必须传送完整的ISO AID,而不是部分选择 支持的. DESFire不支持其他ISO AID

This APDU selects an ISO Application by it’s ISO Application Identifier (AID). The ISO AID of DESFire is "0xD2 76 00 00 85 01 00". The full ISO AID has to be transmitted, partial selection is NOT supported. Other ISO AIDs are not supported by DESFire

这似乎与您拥有AID 0xA0 0xA1 0xA2的事实相矛盾.

This appears to contradict the fact that you have an AID 0xA0 0xA1 0xA2.

好像您需要发送:

[CLA] [INS] [P1] [P2] [Len(AID)] [AID] 

因此:

0x00 0xA4 0x04 0x00 0x07 0xD2 0x76 0x00 0x00 0x85 0x01 0x00

0x00 0xA4 0x04 0x00 0x07 0xD2 0x76 0x00 0x00 0x85 0x01 0x00

**编辑**

改为尝试ISO SELECT DIRECTORY:

此APDU通过三字节DESFire选择DESFire应用程序 应用程序标识符(DESFire AID). ...

This APDU selects a DESFire Application by it’s three byte DESFire Application Identifier (DESFire AID). ...

ISO SELECT DIRECTORY命令的功能兼容 使用本机DESFire选择应用程序"命令.

The functionality of the ISO SELECT DIRECTORY Command is compatible with the native DESFire "Select Application" command.

所以:

0x00 0xA4 0x04 0x00 0x03 0xA0 0xA1 0xA2

(这在下一页上,也许是您最初想要的.)

(this was on the following page, and probably what you wanted in the first place.)

我认为这与您所拥有的相同,但最后要减去NUL.

I think this is identical to what you had, minus the NUL at the end.

这篇关于如何在DESfire Ev1卡上使用ISO7816 select命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆