从ATR获取卡类型

hay*_*ssi 6 smartcard smartcard-reader contactless-smartcard

当我使用springcard读卡器扫描我的卡时,我需要知道这张卡是否是以下类型之一:CTS或CD_97或ISO_A或ISO_B或FRD如何从ATR获取这些类型?

这些是ATR的一些例子,我得到了:

Navigo:3B 88 80 01 00 00 00 00 00 71 81 00 F9

Técély:3B 8F 80 01 80 5A 0A 01 01 20 03 11 10 1D 86 BC 82 90 00 C9

Oura:3B 8F 80 01 80 5A 0A 01 02 20 03 11 03 53 52 A2 82 90 00 5D

Citycard:3B 8F 80 01 80 4F 0C A0 00 00 03 06 03 00 02 00 00 00 00 69

我们是如何从ATR获得这些类型的详细解释?

我正在使用SpringCard读卡:http://files.springcard.com/pub/pmd841p-fa.pdf

我能够在第27页和第28页找到解决方案的一部分在此输入图像描述 在此输入图像描述 http://files.springcard.com/pub/%5bpma13205-bd%5d_Smart_Readers_and_RFID_Scanners_Template_System.pdf

我仍然需要获取命令才能获得OPT REGISTER

vlp*_*vlp 3

关于“OPT寄存器” ——据我了解,您设置此寄存器来控制SpringCard的模板系统(可选)将卡系列编码到其输出中的方式。我敢打赌你根本不想使用他们的模板系统......


要获取有关通用卡技术/系列的信息,请使用以下GET DATA命令获取 PIX.SS 和 PIX.NN(请参阅第 2.2.1 章):

FF CA F1 00 00
Run Code Online (Sandbox Code Playgroud)

响应的第一个字节是 PIX.SS(参见第 5.1.4 章):

0x00 -> 未提供信息
0x01 -> ISO 14443 A,级别 1
0x02 -> ISO 14443 A,级别 2
0x03 -> ISO 14443 A,级别 3 或 4(和 Mifare)
0x05 -> ISO 14443 B,级别 1
0x06 - > ISO 14443 B,级别 2
0x07 -> ISO 14443 B,级别 3 或 4
0x09 -> ICODE 1
0x0B -> ISO 15693

以下两个字节包含 PIX.NN(参见第 5.1.5 章):

0x0001 -> NXP Mifare Standard 1k
0x0002 -> NXP Mifare Standard 4k
0x0003 -> NXP Mifare UltraLight + 其他容量 <= 64 字节的 2 类 NFC 标签
0x0006 -> ST MicroElectronics SR176
0x0007 -> ST MicroElectronics SRI4K、SRIX4K、SRIX512、 SRI512、SRT512
0x000A -> 爱特梅尔 AT88SC0808CRF
0x000B -> 爱特梅尔 AT88SC1616CRF
0x000C ->爱特梅尔 AT88SC3216CRF 0x000D -
> 爱特梅尔 AT88SC6416CRF 0x0012 -
> 德州仪器 TAG IT
0x0013 -> ST MicroElec电子 LRI512
0x0014 -> 恩智浦 ICODE SLI
0x0016 -> 恩智浦 ICODE1
0x0021 -> ST MicroElectronics LRI64
0x0024 -> ST MicroElectronics LR12
0x0025 -> ST MicroElectronics LRI128
0x0026 -> NXP Mifare Mini
0x002F -> Innovision Jewel
0x0030 -> Innovision Topaz(NFC 论坛类型 1 标签)
0x0034 -> Atmel AT88RF04C
0x0035 - > 恩智浦 ICODE SL2
0x003A -> NXP Mifare UltraLight C + 其他类型 2 NFC 标签,容量 > 64 字节
0xFFA0 -> 通用/未知 14443-A 卡
0xFFA1 -> Kovio RF 条形码
0xFFB0 -> 通用/未知 14443-B 卡
0xFFB1 -> ASK CTS 256B
0xFFB2 -> ASK CTS 512B
0xFFB3 -> 预标准 ST MicroElectronics SRI 4K
0xFFB4 -> 预标准 ST MicroElectronics SRI X512
0xFFB5 -> 预标准 ST MicroElectronics SRI 512
0xFFB6 -> 预标准 ST MicroElectronics SRT 512
0xFFB7 -> 内部非接触式 PICOTAG/PICOPASS
0xFFB8 -> 通用 Atmel AT88SC / AT88RF 卡
0xFFC0 -> 使用 Innovatron 协议的 Calypso 卡
0xFFD0 -> 来自未知制造商的通用 ISO 15693
0xFFD1 -> 来自 EMMarin(或 Legic)的通用 ISO 15693
0xFFD2 -> 来自未知制造商的通用 ISO 15693 ST MicroElectronics,8 位块号
0xFFD3 -> ST MicroElectronics 的通用 ISO 15693,16 位块号
0xFFFF -> 虚拟卡(仅测试)

请注意以下有关以 0xFF 开头的 PIX.NN 值(SpringCard 专有代码)的注释:

在撰写本文时,PC/SC 规范尚未引用此列表中的卡。如果它们被添加到规范中,未来的固件版本将必须使用新值。因此,建议不要在应用程序中检查这些值,因为它们将来可能会被删除。

关于 PIX.NN 可用性的说明:

Note: PIX.NN is specified for memory cards only. Even if the GET DATA instruction allows to retrieve PIX.NN even for micro-processor based cards (smartcards), the returned value is unspecified and shall not be used to identify the card.

Disclaimer: I no longer have access to SpringCard reader so I can't test it with my cards, but given the documentation it should work this way.


I was dealing with a very similar problem (processing different cards, somewhat mentioned here) in the past and the most effective approach was (given my "mix" of cards):

  • Use ATR value to create "candidate list" (in many cases ATR value led to a single card scheme candidate)

  • If there are more candidates consider the following ways to confirm one of them:

    • technology-specific "directory service" (e.g. MAD, Get Application IDs, PSE/PPSE, PTSE...)

    • trial-and-error application selection (which might be faster than using a directory service if candidate list is very short)

    • (as a least resort) proprietary card scheme detection

This approach assumes that you know all possible ATR values for used cards -- if not you would have to replace/combine it with card technology/family detection described above.


Note: pcsc-tools ATR list mentioned in comments is available here and here (I am not sure which one is canonical)

Good luck!