Page 1 of 1
Doubt about Response APDU in case2 and case4
Posted: Fri Dec 04, 2015 6:38 am
by shyjarod
Recently, I have read ISO/IEC 7816-3 spec to learn APDU command. But I have a doubt about Response TPDU in case 2 & case4.
As we all know, there are the four structures of command APDUs.
In case2, if process aborted, it returns 6CXX.
In case4, it returns 61XX.
What is the difference between "6CXX" and "61XX"?
Re: Doubt about Response APDU in case2 and case4
Posted: Fri Dec 04, 2015 10:56 pm
by UNKNwYSHSA
6CXX means to process the current APDU command, the CAD need re-issuing same APDU command on the same origin logical channel number as that of the current APDU command with the corrected length.
Code: Select all
<< 80 01 00 00 00 // The APDU command; From ISO7816-3, the APDU command is in CASE2;
>> 6C 07 // Corrected length is 0x07;
<< 80 01 00 00 07 // Reissue the APDU command with corrected length;
>> 11 22 33 44 55 66 77 90 00 // APDU command responsed data.
61XX means the CAD need send GET RESPONSE command with Le as the value of XX to got the response data of the current APDU.
Code: Select all
<< 80 01 00 00 05 11 22 33 44 55 00 // The APDU command; From ISO7816-3, the APDU command is in CASE4;
>> 61 07 // Corrected length is 0x07;
<< 00 C0 00 00 07 // Reissue the APDU command with corrected length;
>> 11 22 33 44 55 66 77 90 00 // Got responsed data.
Re: Doubt about Response APDU in case2 and case4
Posted: Fri Dec 04, 2015 11:01 pm
by UNKNwYSHSA
If you want to understand more, class javacard.frameword.APDU in specification Java Card API document describes more details. Key word is ISO7816.SW_BYTES_REMAINING and APDUException.NO_T0_REISSUE.