理解C-APDU和R-APDU命令的疑惑

Doubts to understand C-APDU and R-APDU commands

这几天开始研究APDU command and response的基本概念,对Lc和data track的用法和意义存疑。 例如,如果我写这样的命令: 00 A4 04 00 0E 31 50 41 59 2E 53 59 53 2E 44 44 46 30 31 00 我会说他的(如果我错了请纠正我)

我的疑惑是关于Lc(精确命令长度)、数据和Le(最大响应长度)的明确含义,我怎么知道这个数据指令是什么意思?我应该把它变成文本吗?

Lc = 0E表示后面有14个字节的数据所以:

31 50 41 59 2E 53 59 53 2E 44 44 46 30 31 是你的数据(14 字节)。当您将其解释为 ASCII 值时,您会得到字符串 1PAY.SYS.DDF01.

字段 Le 表示预期有多少字节(00 = 最大字节数)作为响应。

6F 15 84 0E 31 50 41 59 2E 53 59 53 2E 44 44 46 30 31 A5 03 88 01 01 90 00 将被解析为

 
6F File Control Information (FCI) Template
16 Length in hex
    84 Dedicated File (DF) Name
    0E Length in hex
        315041592E5359532E4444463031    =>1PAY.SYS.DDF01
    A5 File Control Information (FCI) Proprietary Template
    03 length in hex
        88 Short File Identifier (SFI)
        01 length in hex
            01
    90 00 Successful operation

简单地说,您可以使用 this 来解析您的响应 TPDU :-)