关于智能卡ART

  • 内容
  • 评论
  • 相关

In this article we will review the ATR data elements (DE), but  focusing on DE importance in a  payment transaction. ATR fields covered:
在本文中,我们将回顾 ATR 数据元素 (DE),但重点关注 DE 在支付交易中的重要性。 ATR 涵盖的领域:

  • The initial byte (TS) 初始字节(TS)
  • The format byte (TO) 格式字节(TO)
  • The interface bytes (TAi, TBi, TCi, TDi)
    接口字节(TA i 、 TB i 、 TC i 、 TD i )
  • The historical bytes (T1,T2. TK)
    历史字节(T1,T2.TK)
  • The check byte (TCK) 校验字节(TCK)

The Initial Byte (TS) 初始字节 (TS)

The initial byte TS is a mandatory bit communication synchronization pattern. ATR values for this byte should read 0x3F or 0x3B. Processing of this value is usually handled by the card reader’s driver. It’s also advisable to check this value as an initial sanity check for card being plugged in.
初始字节TS是强制位通信同步模式。该字节的 ATR 值应为 0x3F 或 0x3B。该值的处理通常由读卡器的驱动程序来处理。还建议检查此值作为插入卡的初始健全性检查。

The Format Byte (TO) 格式字节 (TO)

The format byte is another mandatory field providing a bitmap from which one implies the remaining ATR fields. The first (most significant) 4 bits refer to the presence of TA1, TB1, TC1 and TD1 characters. The least significant bits refers to the size of historical data in bytes allowing an additional 0 – 16 bytes of historical data to be added to the message.
格式字节是另一个强制字段,提供位图,从中暗示剩余的 ATR 字段。第一个(最高有效)4 位表示 TA 1 、TB 1 、TC 1和 TD 1字符的存在。最低有效位是指历史数据的大小(以字节为单位),允许将额外的 0 – 16 字节历史数据添加到消息中。

The Interface Bytes (TAi, TBi, TCi, TDi)
接口字节(TA i 、 TB i 、 TC i 、 TD i )

These conditional bytes are referred to as the global interface bytes and define a card’s operational abilities. In brief these fields refer to:
这些条件字节称为全局接口字节并定义卡的操作能力。简而言之,这些字段指的是:

  • TA1 – the card’s chip clock-rate and bit rate adjustment factor
    TA 1 – 卡的芯片时钟速率和比特率调整因子
  • TB1 – EEPROM programming voltage and current
    TB 1 – EEPROM 编程电压和电流
  • TC1 – extra guard time to be used between successive bytes
    TC 1 – 在连续字节之间使用的额外保护时间
  • TD1 – indicates sub-bytes presence and protocol type. Only two meaningful values for protocol type here are T = 0 or T = 1, all others are currently reserved for future use (RFU).
    TD 1 – 指示子字节存在和协议类型。这里协议类型只有两个有意义的值是 T = 0 或 T = 1,所有其他值目前都保留供将来使用 (RFU)。

Subsequent fields TAi+1, TBi+1, TCi+1 and TDi+1 are out of scope for this article.
后续字段 TA i+1 、 TBi+1 、 TCi+1 和 TDi+1 超出了本文的范围。

The Historical Bytes 历史字节

Historical Bytes typically hold Information about the Card Issuer, Type of Card or Operating System Version and this is where it becomes complicated. These bytes can be lodged in a proprietary format of a card manufacturer/issuer, or can be formatted in “compact TLV”. Unlikely EMV TLV, compact TLV uses 4 most significant bits to tell a tag and 4 least significant bites for data length. However the first byte of historical data coded in compact TLV should always read 0x00 or 0x80.
历史字节通常保存有关卡发行者、卡类型或操作系统版本的信息,这就是它变得复杂的地方。这些字节可以以卡制造商/发行商的专有格式存放,或者可以以“紧凑 TLV”格式化。与 EMV TLV 不同,紧凑 TLV 使用 4 个最高有效位来指示标签,并使用 4 个最低有效位来指示数据长度。然而,以紧凑 TLV 编码的历史数据的第一个字节应始终读取 0x00 或 0x80。

Some known compact TLV tags:
一些已知的紧凑型 TLV 标签:

Tag 0x1h: Country code in (ISO 3166-1)
标签 0x1h :(ISO 3166-1) 中的国家/地区代码

Example: 0x12 0x00 0x36 -> Australia
示例:0x12 0x00 0x36 -> 澳大利亚

Tag 0x2h: Issuer identification number (ISO 7812-1)
标签 0x2h :发行者识别号 (ISO 7812-1)

Example: TBA 示例:待定

Tag 0x3h: Card service data byte
标签 0x3h :卡服务数据字节

When a bit is set to 1 in the card service data byte one may use that service.
当卡服务数据字节中的一位设置为 1 时,可以使用该服务。

Bit Description 
8Application selection: by full DF name
应用程序选择:按 DF 全名
7Application selection: by partial DF name
应用程序选择:通过部分 DF 名称
6BER-TLV data objects available in EF.DIR
EF.DIR 中提供的 BER-TLV 数据对象
5BER-TLV data objects available in EF.ATR
EF.ATR 中提供的 BER-TLV 数据对象
4EF.DIR and EF.ATR access services: by READ BINARY command
EF.DIR 和 EF.ATR 访问服务:通过 READ BINARY 命令
3EF.DIR and EF.ATR access services: by GET DATA command
EF.DIR 和 EF.ATR 访问服务:通过 GET DATA 命令
2EF.DIR and EF.ATR access services: by GET RECORD(s) command
EF.DIR 和 EF.ATR 访问服务:通过 GET RECORD(s) 命令
1EF.DIR and EF.ATR access services: RFU
EF.DIR 和 EF.ATR 访问服务:RFU

Example: 0x31 0xC0 ->
示例:0x31 0xC0 ->

  • Application selection: by full DF name
    应用程序选择:按 DF 全名
  • Application selection: by partial DF name
    应用程序选择:通过部分 DF 名称
  • EF.DIR and EF.ATR access services: by GET RECORD(s) command
    EF.DIR 和 EF.ATR 访问服务:通过 GET RECORD(s) 命令

Tag 0x4h: Initial access data
标签 0x4h:初始访问数据

Example: TBA 示例:待定

Tag 0x5h: Card issuer data
标签 0x5h:发卡机构数据

Example: TBA 示例:待定

Tag 0x6h: Pre-issuing data
标签0x6h:预发数据

Example: 0x64 0x19 0x16 0x01 0x02
示例:0x64 0x19 0x16 0x01 0x02

Tag 0x7h: Card capabilities
标签 0x7h :卡功能

When a bit is set to 1 the card has the specified capability selection mode:
当某个位设置为 1 时,该卡具有指定的功能选择模式:

Bit Description 
8DF selection by full DF name
按 DF 全名选择 DF
7DF selection by partial DF name
通过部分 DF 名称选择 DF
6DF selection by path 按路径选择 DF
5DF selection by file identifier
通过文件标识符选择 DF
4Implicit DF selection 隐式 DF 选择
3Short EF identifier supported
支持短 EF 标识符
2Record number supported 支持记录数
1Record identifier supported
支持记录标识符

Example: 0x71 0xD6 -> 示例:0x71 0xD6 ->

  • Record number supported 支持记录数
  • Short EF identifier supported
    支持短 EF 标识符
  • DF selection by file identifier
    通过文件标识符选择 DF
  • DF selection by partial DF name
    通过部分 DF 名称选择 DF
  • DF selection by full DF name
    按 DF 全名选择 DF

Tag 0x8h: Status indicator
标签 0x8h :状态指示器

Example: TBA 示例:待定

Tag 0xEh: Application identifier
标签 0xEh :应用程序标识符

Example: TBA 示例:待定

Summary 概括

As demonstrated above, a good understanding of ATR is a very important part of EMV functionality. In particular the ATR’s historical data can provide a payment device with several important clues to a card’s processing (selection options and the way card’s service options can be retrieved). Please let us know if you can contribute with your knowledge to this article – our team of EMV experts is ready to update information as we endeavour to start a community repository of EMV expertise.
如上所述,充分理解 ATR 是 EMV 功能的一个非常重要的部分。特别是,ATR 的历史数据可以为支付设备提供卡处理的几个重要线索(选择选项以及检索卡服务选项的方式)。如果您可以为本文贡献您的知识,请告诉我们 – 我们的 EMV 专家团队已准备好更新信息,因为我们正在努力启动 EMV 专业知识的社区存储库。

Further reading on this topic can be found in our knowledge base document: Complete list of known ATRs.One of the least explored areas of EMV lays in initial stages of terminal to card communication. A card lodges a data message in its memory upon power up. Layout of this message conforms with ISO/IEC 7816 and can be retrieved by a card reader (sReaderState.cbAtr). The ATR message contains information on proposed card communication parameters, card’s manufacturer or issuer, application selection options, country code and more. The ATR functionality is fully documented in ISO/IEC 7816 and many more documents, however those documents focus on Smart Cards in general and not payment cards. Therefore the aim of this article is to explain ATR in relation to EMV/NFC technology.
有关此主题的进一步阅读可以在我们的知识库文档中找到:已知 ATR 的完整列表。EMV 探索最少的领域之一是终端到卡通信的初始阶段。卡在加电时会在其内存中存放数据消息。该消息的布局符合 ISO/IEC 7816,并且可由读卡器 (sReaderState.cbAtr) 检索。 ATR 消息包含有关建议的卡通信参数、卡的制造商或发行商、应用程序选择选项、国家/地区代码等的信息。 ATR 功能在 ISO/IEC 7816 和许多其他文档中有完整记录,但这些文档一般侧重于智能卡而不是支付卡。因此,本文的目的是解释 ATR 与 EMV/NFC 技术的关系。

评论

0条评论

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注