命令APDU(C-APDU)和响应APDU(R-APDU)
命令APDU包含命令头(CLA INS P1 P2)和0~255字节的数据。
4种命令格式
case1: CLA INS P1 P2 无命令数据;无响应数据
case2: CLA INS P1 P2 Le 无命令数据;Le个响应数据(1~256),Le=0表示256个
case3: CLA INS P1 P2 Lc Data Lc个命令数据(1~255),其值为Data;无响应数据
case4: CLA INS P1 P2 Lc Data Le Lc个命令数据,其值为Data;Le个响应数据
响应APDU包含0~256字节的数据和2字节状态码
Data SW1 SW2
过程字节(Procedure Byte)SW1 SW2=’61xx’和SW1 SW2=’6Cxx
Luicc: exact length of data available in the UICC to be returned in response to the case 2 or 4 Command received by the UICC
case2/4时,UICC要返回的数据的长度
Use of procedure bytes '61xx' and '6Cxx' (ETSI TS 102 221 R8 7.3.1.1.5)
UICC返回'61xx'和'6Cxx'给传输层,表示现在正在处理的命令需要上传数据,让其去读取。
只有case2/4并使用T=0时才会有。
'61xx'时,传输层用GET RESPONSE去读取,P3为xx。
'6Cxx'时,传输层立即发送之前的命令,P3设置为xx。
case2:
1) 当Le > Luicc时,返回:
a) procedure bytes '6C Luicc',传输层立即重发命令,且P3=Luicc。或则
b) 警告或错误的状态指示('90 00'除外)
2) 当Le = Luicc时,返回:
a) data of length Le (= Luicc) under the control of the INS, INS , or '60' procedure bytes followed by the associated status; or
b) procedure bytes '61xx',传输层发送GET RESPONSE,
转载于:https://my.oschina.net/igiantpanda/blog/2222647