Clause 10.1 states a generic structure of an Application Protocol Data Unit (APDU) that is used by the application protocol on the top of the transmission protocol for sending a command to the card.
A command APDU consists of a header and a body part. The contents of the command APDU are depicted in Table 10.1 where the header consists of the CLA, INS, P1 and P2 bytes that are mandatory for a command APDU and an optional body part that can contain the Lc, Data and Le. Parameters are further explained in clauses 10.1.1 to 10.1.6.
The present document supports the CLA defined in Table 10.3 and Table 10.4a. In addition the command chaining, using b5 in class byte, as defined in ISO/IEC 7816-4 [12] is not supported (b5 = 0) in the present document. If the card supports the logical channel mechanism, the maximum number of available logical channels is indicated in the card capabilities data object of historical bytes of an ATR (refer to ISO/IEC 7816-4 [12]). If the card capabilities data object is missing, only the basic logical channel is supported.
An application on a UICC supporting logical channels utilizing secure messaging shall either exclude the class byte from the signature calculation for the message verification or set it to a default value. The terminal may change the logical channel on which the application is executed compared to the logical channel used for the secure messaging verification signature.
Table 10.3 specifies the coding of the class byte for the standard logical channels. Bit b5 is always set to 0. Bits b4 and b3 are used for indication of secure messaging format (see Table 10.4a). Bits b2 and b1 indicate the logical channel used. Logical channels are numbered from 0 to 3 (standard logical channels).
Table 10.4a specifies the coding of the class byte for the extended logical channels. Bit b6 indicates secure messaging (see Table 10.4b). Bit b5 is always set to 0. Bits b4 to b1 encode a number from zero to fifteen; this number plus four is the logical channel number from four to nineteen (extended logical channels).
By default no secure messaging is supported by the card (i.e. b4 = b3 = 0 in Table 10.3, and b6 = 0 in Table 10.4a), unless it is stated otherwise by an application.
Transmission oriented APDUs applying to the above commands
GET RESPONSE
'0X' or '4X' or '6X'
'C0'
NOTE:
These INS values are also used by GlobalPlatform (for the commands END R-MAC SESSION and BEGIN R-MAC SESSION, see [i.1] and [i.2]). See also note 2 below.
The value of the parameters P1 and P2 depends on the command. If the parameter is not used, the value is set to '00'. Coding of the parameter bytes is presented in the command definition clauses.
The number of data bytes present in the data field of the command APDU is presented in the parameter Lc. Lc is optional, in the command APDU, however if the Lc is present in the command APDU, data field consists of Lc subsequent bytes. The terminal may send from 1 byte to 255 bytes of command data.
The maximum number of bytes expected in the data part of the response APDU is presented in the parameter Le, which is optional. This means that if the terminal does not expect any data in the response APDU Le is absent from the command APDU. However, if Le is present in the command APDU, the data field of the response APDU is expected to consist of Le bytes.
Le set to '00' indicates that the terminal expects to receive at most the maximum number of bytes, i.e. 256, in the response APDU. The UICC may return any number of bytes in the range 1 to 256.