ISO 7816 part 4, section..1 2 3 4 5 6 7 8 9 annex.. A B C D E F
For the latest version of ISO7816 part 4, please contact ISO in Switzerland.
9.1 Definitions and scope
9.2 Card identification service
9.3 Application selection service
9.4 Data object retrieval service
9.5 File selection service
9.6 File I/O service
This clause describes the application-independent card services, referred to as “card services” in the following text. Their purpose is to provide interchange mechanisms between a card and an interface device knowing nothing about each other except that both comply with this part of ISO/IEC 7816.
Card services are supported by any combination of
The commands use CLS=’00’ (see 5.4.1), i.e. no secure messaging and the basic logical channel.
There is no need for an application to comply with this clause once it has been identified and selected in the card. It is possible for an application to use other mechanisms compatible with this part of ISO/IEC 7816 for achieving similar functions. Therefore such solutions may not guarantee interchange.
The following card services are defined
This function consists of the card providing information to the outside world on its logical content as well as some general data objects all applications might be interested in (e.g. interindustry data objects). The information, called “card identification data”, is given by the card in the historical bytes and possibly in a file implicitly selected immediately after the answer to reset.
Access to this file is indicated in the initial access data information (see 8.3.3).
If the initial access data of the historical bytes does not denote a READ command, then the response to the command to perform contains card identification data.
An application is either implicitly selected in a card or can be explicitly selected by its name.
9.3.1 Implicit application selection
9.3.2 Direct application selection
When an application is implicitly selected in a card, the application identifier as defined in part 5 of ISO/IEC 7816 should be indicated in the card identification data. If not present in the card identification data, then it shall be present in the ATR file.
A card in a multi-application environment shall be able to respond positively to a direct application selection performed by a SELECT FILE command specifying the application identifier as DF name.
The application identifier should be provided completely in the command APDU. In case of an application selection by partial DF name, the next application matching with the name proposed may be selected and the full DF name will be made available in the response message of the SELECT FILE command as the file control parameter with tag ’84’ (see table 2 ).
The APDU of the command to perform is the following.
Table 88 – Coding of the command for direct application selection
CLA | ’00’ (see 5.4.1) |
INS | ‘A4’ |
P1-P1 | ‘0400’ |
Lc field | Length in bytes of the data field |
Data field | Full or partial DF name |
Le field | Present, contains only zeroes |
Data objects used for application-independent international interchange are defined in this part and other parts of ISO/IEC 7816.
The retrieval of those data objects relies on one or both of the following menthods :
The information necessary to retrieve data objects by an indirect method is defined in part 6 of ISO/IEC 7816.
When the path to an EF is known, the number of SELECT FILE commands to be issued equals the length of the path divided by two, minus one (the path always starts with the current DF).
If the path length is more than four bytes, then until all available DF identifiers of the path have been used, one or more SELECT FILE commands shall be performed with the following command APDU.
Table 89 – Coding of the command to select a DF using a file identifier
CLA | ’00’ (see 5.4.1) |
INS | ‘A4’ |
P1-P2 | ‘0100’ |
Lc field | ’02’ |
Data field | DF identifier (from bytes 3 and 4 of the path) |
Le field | Empty |
The last and possibly only selection is an EF selection with the following command APDU.
Table 90 – Coding of the command to select an EF
CLA | ’00’ (see 5.4.1) |
INS | ‘A4’ |
P1-P2 | ‘0200’ |
Lc field | ’02’ |
Data field | DF identifier (last two bytes of the path) |
Le field | Empty |
Once a file used for interindustry interchange has been selected, the contents relevant to interchange shall be returned by one of the following command APDUs.
CLA | ’00’ (see 5.4.1) |
INS | ‘B0’ |
P1-P2 | ‘0000’ |
Lc field | Empty |
Data field | Empty |
Le field | Present, contains only zeroes |
CLA | ’00’ (see 5.4.1) |
INS | ‘B2’ |
P1-P2 | ‘0005’ |
Lc field | Empty |
Data field | Empty |
Le field | Present, contains only zeroes |