The mapping of the C-APDU onto the T = 0 command header is dependent upon the case of the command. The mapping of the data (if present) and status returned by the UICC onto the R-APDU is dependent upon the length of the data returned.
Procedure bytes
'61XX' and
'6CXX' are returned by the UICC to control exchanges between the transport layer of the terminal and the UICC, and should never be returned to the application layer of the terminal. Command processing in the UICC is not complete if it has returned procedure bytes
'61XX' or
'6CXX'.
Normal status on completion of processing a command is indicated if the UICC returns status words
'9000' to the transport layer of the terminal. The transport layer of the terminal shall discontinue processing of a command (i.e. pass the R-APDU to the application layer and wait for a further C-APDU from the application layer) on receipt of any status words (but not on receipt of procedure bytes
'61xx' and
'6Cxx') from the UICC. For case 4 commands only, immediately following successful transmission of command data to the UICC, the transport layer of the terminal shall continue processing the command if warning status bytes ('62xx' or
'63xx', with the specific case of
'6282' response for SEARCH RECORD command being described in the corresponding section) or application related status bytes ('9xxx' except
'9000') are received.
The following descriptions of the mapping of data and status returned by the UICC onto the R-APDU are for information, and apply only after the UICC has completed processing of the command, successfully or otherwise, and all data (if present) has been returned by the UICC under the control of
'61XX' and
'6CXX' procedure bytes. Detailed use of the
INS,
INS, and
'60' procedure bytes is not described.
The status returned by the UICC shall relate to the most recently received command. Where a GET RESPONSE command is used to complete the processing of a case 2 or case 4 command, any status returned by the UICC after receipt of the GET RESPONSE command shall relate to GET RESPONSE command, not to the case 2 or case 4 command which it completes.
The flow of the exchange is as follows:
-
The transport layer of the terminal shall send the T = 0 command header to the UICC.
-
On receipt of the command header the UICC, under normal or abnormal processing, shall return status to the transport layer of the terminal.
The UICC shall analyse the T = 0 command header to determine whether it is processing a case 1 command or a case 2 command requesting all data up to the maximum length available.
-
On receipt of status from the UICC, the transport layer of the terminal shall discontinue processing of the command.
See
Annex C for details of the exchanges between the transport layer of the terminal and the UICC.
The status words returned to the transport layer of the terminal from the UICC after completion of processing of the command are mapped onto the mandatory trailer of the R-APDU without change.
The C-APDU is mapped onto the C-TPDU without any change.
The flow of the exchange is as follows:
-
The transport layer of the terminal shall send the T = 0 command header to the UICC.
-
On receipt of the command header the UICC:
-
under normal processing shall return data and status to the transport layer of the terminal. The UICC shall use procedure bytes '6Cxx' (and if required, procedure bytes '61xx') to control the return of data (see below); or
-
under abnormal processing shall return status only to the transport layer of the terminal.
-
On receipt of the data (if present) and status from the UICC, the transport layer of the terminal shall discontinue processing the command.
See
Annex C for details of the exchanges between the transport layer of the terminal and the UICC, including use of the
'61XX' and
'6CXX' procedure bytes.
The R-TPDU is mapped onto the R-APDU without any change.
The data (if present) and status returned to the transport layer of the terminal from the UICC after completion of processing of the command are mapped onto the R-APDU as follows:
-
The data returned (if present) is mapped onto the conditional body of the R-APDU. If no data is returned, the
conditional body of R-APDU is left empty.
-
The status returned is mapped onto the mandatory trailer of the R-APDU without change.
The C-APDU is mapped onto the C-TPDU without any change. Lc is a value between 1 and 255.
The flow of the exchange is as follows:
-
The transport layer of the terminal shall send the T = 0 command header to the UICC.
-
On receipt of the command header, if the UICC:
-
returns a procedure byte, the transport layer of the terminal shall send the data portion of the conditional body of the C-APDU to the UICC under the control of procedure bytes returned by the UICC; or
-
returns status, the transport layer of the terminal shall discontinue processing of the command.
-
If processing was not discontinued in step 2b), the UICC shall return status following receipt of the conditional body of the C-APDU and completion of processing the command.
-
On receipt of status from the UICC, the transport layer of the terminal shall discontinue processing the command.
See
Annex C for details of the exchanges between the transport layer of the terminal and the UICC.
The status words returned to the transport layer of the terminal from the UICC after completion of processing of the command, or the status words returned by the UICC that caused the transport layer of the terminal to discontinue processing of the command, are mapped onto the R-APDU without change.
The C-APDU is mapped onto the C-TPDU by cutting off the last byte (Le) of the body.
The flow of the exchange is as follows:
-
The transport layer of the terminal shall send the T = 0 command header to the UICC.
-
On receipt of the command header, if the UICC:
-
returns a procedure byte, the transport layer of the terminal shall send the data portion of the conditional body of the C-APDU to the UICC under the control of procedure bytes returned by the UICC; or
-
returns status, the transport layer of the terminal shall discontinue processing of the command.
-
If processing was not discontinued in step 2b), following receipt of the conditional body of the C-APDU, the UICC:
-
under normal processing, shall return procedure bytes '61xx' to the transport layer of the terminal requesting the transport layer of the terminal to issue a GET RESPONSE command to retrieve the data from the UICC; or
-
under abnormal processing, shall return status only to the transport layer of the terminal.
-
On receipt of the procedure bytes or status returned in step 3), if the UICC:
-
returned '61xx' procedure bytes as in step 3a), the transport layer of the terminal shall send a GET RESPONSE command header to the UICC with P3 set to a value less than or equal to the value contained in the 'xx' byte of '61xx' procedure bytes; or
-
returned status as in step 3b) that indicates a warning ('62xx' or '63xx', with the specific case of '6282' response for SEARCH RECORD command being described in the corresponding section), or which is application related ('9xxx' but not '9000'), the transport layer of the terminal shall send a GET RESPONSE command with Le = '00'; or
-
returned status as in step 3b) other than that described in step 4b), the transport layer of the terminal shall discontinue processing of the command.
-
If processing was not discontinued in step 4c), the GET RESPONSE command shall be processed according to the rules for case 2 commands.
The first R-TPDU from the UICC indicates that the UICC performed the command correct and that the UICC has more data of length Luicc bytes to transfer. The first R-TPDU is mapped without any changes onto the R-APDU.
See
Annex C for details of the exchanges between the transport layer of the terminal and the UICC, including use of the
'61XX' and
'6CXX' procedure bytes.
The UICC returns procedure bytes
'61xx 'and
'6Cxx' to the transport layer of the terminal to indicate to it the manner in which it should retrieve the data requested by the command currently being processed. These procedure bytes are only used when processing case 2 and 4 commands using T = 0.
Procedure bytes
'61xx' instruct the transport layer of the terminal to issue a GET RESPONSE command to the UICC. P3 of the GET RESPONSE command header is set to
'xx'.
Procedure bytes
'6Cxx' instruct the transport layer of the terminal to immediately resend the previous command header setting P3 =
'xx'.
Usage of these procedure bytes during error free processing with case 2 and 4 commands is as defined in
clauses 7.3.1.1.5.1 and
7.3.1.1.5.2. In the case of an error, the UICC may return status indicating error or warning conditions instead of the
'61xx' or
'6Cxx' response.
-
If the UICC receives a case 2 command header and Le = '00' (with Luicc < 256 bytes) or Le > Luicc, it shall return:
-
procedure bytes '6C Luicc' instructing the transport layer of the terminal to immediately resend the command header with P3 = Luicc; or
-
status indicating a warning or error condition (but not SW1 SW2 = '90 00').
-
If the UICC receives a case 2 command header and Le = '00' (with Luicc = 256 bytes) or Le = Luicc, it shall return:
-
data of length Le (= Luicc) under the control of the INS, INS, or '60' procedure bytes followed by the associated status; or
-
procedure bytes '61xx' instructing the transport layer of the terminal to issue a GET RESPONSE command with a maximum length of 'xx', 'xx' being less than Luicc (this could happen if the card buffer size is smaller than Luicc); or
-
status indicating a warning or error condition (but not SW1 SW2 = '90 00').
-
If the UICC receives a case 2 command header and Le < Luicc it shall return:
-
data of length Le under the control of the INS, INS, or '60' procedure bytes followed by procedure bytes '61xx' instructing the transport layer of the terminal to issue a GET RESPONSE command with a maximum length of 'xx'; or
-
status indicating a warning or error condition (but not SW1 SW2 = '90 00').
If the UICC receives a case 4 command, after processing the data sent with the C-APDU, it shall return:
-
procedure bytes '61 xx' instructing the transport layer of the terminal to issue a GET RESPONSE command with a maximum length of 'xx'; or
-
status indicating a warning or error condition (but not SW1 SW2 = '90 00').
The GET RESPONSE command so issued is then treated as described for case 2 commands.