【EMV L2】GPO响应以及AIP、AFL

【GPO命令】

终端通过GPO(Get Processing Options)命令 通知卡片交易开始。命令数据为PDOL指定的终端数据。

【GPO响应】

卡片在GPO命令的响应中返回AIP和AFL;AIP指示卡片对借贷记功能的支持能力;AFL包含终端将要读取用来交易处理的卡片数据文件的SFI和记录范围;

GPO的响应有两种格式:

Format1:

The data object returned in the response message is a primitive data object with tag equal to '80'.The value field consists of the concatenation without delimiters (tag and length) of the value fields of the AIP and the AFL.

Format1的响应为Tag80数据,必须包含AIP和AFL,AIP长度固定为2字节,AFL长度应该为4的倍数;

Format2:

The data object returned in the response message is a constructed data object with tag equal to '77'.The value field may contain several BER-TLV coded objects, but shall always include the AIP and the AFL.

Format2的响应为Tag77数据,必须包含AIP和AFL;

【AIP & AFL】

AIP:Application Interchange Profile(应用交互特征),2字节;

AIP指示卡片对借贷记功能的支持能力,包括静态数据认证(SDA)、动态数据认证(DDA)、复合数据认证(CDA)、持卡人验证、终端风险管理和发卡行认证等;

AFL:Application File Locator(应用文件定位器),4字节的整数倍;

AFL包含终端将要读取用来交易处理的卡片数据文件的SFI和记录范围。每个要读取的文件在AFL中对应4个字节;

byte1:短文件标识符(SFI);

byte2:文件中要读取的第1个记录的记录号;

byte3:文件中要读取的最后一个记录的记录号;

byte4:从第1个记录开始的用于脱机数据认证的连续记录数;

An AFL entry with invalid syntax, that is, any one or more of the following:
 An SFI of 0 or 31.
 A starting record number of 0.
 An ending record number less than the starting record number (byte 3 < byte 2).
 Number of records participating in offline data authentication greater than the number of records (byte 4 > byte 3 - byte 2 + 1).

原文地址:https://www.cnblogs.com/utank/p/10063192.html