emv PDOL需要2个字节的终端功能

时间:2018-01-27 16:34:08

标签: emv

我有一个有趣的案例,我认为我错过了规范中的某些信息。

我的EMV卡提供此PDOL

9F33 02 9F35 01 9F40 01 -> Total length = 4

这些是我的终端交易相关数据

Terminal capabilities : 9F33 -> 0xA0 0xA0 0xC0 
Additional Terminal Capabilities  : 9F35 -> 0x16  
Terminal Type                     : 9F40 -> 0x70 0x00 0x80 0xB0 0x01  

当我获得(A0 A0)字节1和2 的处理选项时, 9F33 16 的2个字节 9F35 70 9F40 我得到 69 85 状态字。

这是我的命令(十六进制)

80 A8 00 00 06 83 04 A0 A0 16 70 00 -> s1 s2 = 69 85

当我通过 A0 C0(字节2和字节3) 9F33 时,我获得了成功(90 00)

80 A8 00 00 06 83 04 A0 C0 16 70 00 -> s1 s2 = 90 00

我的问题:

我如何准确知道需要哪些字节,特别是当所需长度小于实际长度时?它在哪里记录在规范中?我只是凭直觉发现了这一点。

先谢谢。

2 个答案:

答案 0 :(得分:0)

当没有可用的实际数据时,任何DOL都需要填零。当数据的实际长度大于DOL中请求的数据时,则应将数据截断为DOL中预期的长度

有关使用DOL的规则,请参阅

  

EMV 4.3第3册

     

5.4使用数据对象列表(DOL)的规则

顺便问一下,您是否找到了在9F33值发生变化时GPO响应发生变化的原因的答案?

答案 1 :(得分:0)

正如您正确指出的那样,这些是第3章第5.4章中的规则。 " C"是我的结果的解释。在我的情况下,我不得不截断最右边的字节(字节2和3 )因为我的数据对象(9F33)没有数字格式。

a. If the tag of any data object identified in the DOL is unknown to the terminal or represents a constructed data object, the terminal shall provide a data element with the length specified and a value of all hexadecimal zeroes.
b. If a data object is in the list and is meaningful to the terminal but represents optional static data that is absent from the terminal, the portion of the command field representing the data object shall be filled with hexadecimal zeroes.
c. If the length specified in the DOL entry is less than the length of the actual data object, the leftmost bytes of the data element shall be truncated if the data object has numeric (n 1) format, or the rightmost bytes of the data shall be truncated for any other format.
d. If the length specified in the DOL entry is greater than the length of the actual data, the actual data shall be padded:
 with leading hexadecimal zeroes if the data has numeric format
 with trailing hexadecimal 'FF's if the data has compressed numeric (cn 1) format
 with trailing hexadecimal zeroes for any other format (an, ans or b including bit combination data 1)
e. If a data object is in the list and is meaningful to the terminal but represents data that is not applicable to the current transaction, the portion of the command field representing the data object shall be filled with hexadecimal zeroes.