
Smart Cards Lab COMPGA12 University College London
7 APDUs
Smart Card commands are called APDUs (Application Protocol Data Unit).
They are strings of bytes, written in order of their transmission.
The card is only answering to commands (master/slave principle, half-
duplex) and never initiates any communication.
Quiz We call an C-APDU a:
APDU used in contactless smart
cards
string of bytes sent to the smart
card.
Quiz We call an R-APDU a:
string of bytes received from the
smart card
APDU that updates registers of
the reader.
7.1 Industrial standards
Quiz Cross-industry standardized APDU commands are described in
ISO 7816-1 ISO 7816-4.
Structure of an APDU
There are several possible cases, depending on the instruction.
Header - required Body - optional
CLA INS P1 P2 Lc Data Le
Explanations:
CLA is the byte that identifies the type of command, the application,
and also indicates to what extent the command is complaint to ISO specs.
INS is a byte that encodes the instruction.
Quiz The optional field Lc is for:
size of the input data length of the instruction.
Quiz The optional field Le is for:
length of the instruction expected output size.
The size is always in bytes. Each field Lc or Le can be encoded on 1 or
3 bytes, but most of the time it is one byte and a number between 0 and
127. Any larger number requires encoding on 3 bytes.
If the command is successful, the answer should be:
c
Nicolas T. Courtois 2009-10
Comentarios a estos manuales