8 Description of the functions

11.113GPPRelease 1999Specification of the Subscriber Identity Module - Mobile Equipment (SIM-ME) InterfaceTS

This clause gives a functional description of the commands and their respective responses. Associated status conditions, error codes and their corresponding coding are specified in clause 9.

It shall be mandatory for all cards complying with this Standard to support all functions described in this Standard. The command GET RESPONSE which is needed for the protocol T=0 is specified in clause 9.

The following table lists the file types and structures together with the functions which may act on them during a GSM session. These are indicated by an asterisk (*).

Table 8: Functions on files in GSM session

File

Function

MF

DF

EF transparent

EF linear fixed

EF cyclic

SELECT

*

*

*

*

*

STATUS

*

*

*

*

*

READ BINARY

*

UPDATE BINARY

*

READ RECORD

*

*

UPDATE RECORD

*

*

SEEK

*

INCREASE

*

INVALIDATE

*

*

*

REHABILITATE

*

*

*

8.1 SELECT

This function selects a file according to the methods described in clause 6. After a successful selection the record pointer in a linear fixed file is undefined. The record pointer in a cyclic file shall address the last record which has been updated or increased.

Input:

‑ file ID.

Output:

‑ if the selected file is the MF or a DF:

file ID, total memory space available, CHV enabled/disabled indicator, CHV status and other GSM specific data;

‑ if the selected file is an EF:

file ID, file size, access conditions, invalidated/not invalidated indicator, structure of EF and length of the records in case of linear fixed structure or cyclic structure.

8.2 STATUS

This function returns information concerning the current directory. A current EF is not affected by the STATUS function. It is also used to give an opportunity for a pro‑active SIM to indicate that the SIM wants to issue a SIM Application Toolkit command to the ME.

Input:

‑ none.

Output:

‑ file ID, total memory space available, CHV enabled/disabled indicator, CHV status and other GSM specific data (identical to SELECT above).

8.3 READ BINARY

This function reads a string of bytes from the current transparent EF. This function shall only be performed if the READ access condition for this EF is satisfied.

Input:

‑ relative address and the length of the string.

Output:

‑ string of bytes.

8.4 UPDATE BINARY

This function updates the current transparent EF with a string of bytes. This function shall only be performed if the UPDATE access condition for this EF is satisfied. An update can be considered as a replacement of the string already present in the EF by the string given in the update command.

Input:

‑ relative address and the length of the string;

‑ string of bytes.

Output:

‑ none.

8.5 READ RECORD

This function reads one complete record in the current linear fixed or cyclic EF. The record to be read is described by the modes below. This function shall only be performed if the READ access condition for this EF is satisfied. The record pointer shall not be changed by an unsuccessful READ RECORD function.

Four modes are defined:

CURRENT: The current record is read. The record pointer is not affected.

ABSOLUTE: The record given by the record number is read. The record pointer is not affected.

NEXT: The record pointer is incremented before the READ RECORD function is performed and the pointed record is read. If the record pointer has not been previously set within the selected EF, then READ RECORD (next) shall read the first record and set the record pointer to this record.

If the record pointer addresses the last record in a linear fixed EF, READ RECORD (next) shall not cause the record pointer to be changed, and no data shall be read.

If the record pointer addresses the last record in a cyclic EF, READ RECORD (next) shall set the record pointer to the first record in this EF and this record shall be read.

PREVIOUS: The record pointer is decremented before the READ RECORD function is performed and the pointed record is read. If the record pointer has not been previously set within the selected EF, then READ RECORD (previous) shall read the last record and set the record pointer to this record.

If the record pointer addresses the first record in a linear fixed EF, READ RECORD (previous) shall not cause the record pointer to be changed, and no data shall be read.

If the record pointer addresses the first record in a cyclic EF, READ RECORD (previous) shall set the record pointer to the last record in this EF and this record shall be read.

Input:

‑ mode, record number (absolute mode only) and the length of the record.

Output:

‑ the record.

8.6 UPDATE RECORD

This function updates one complete record in the current linear fixed or cyclic EF. This function shall only be performed if the UPDATE access condition for this EF is satisfied. The UPDATE can be considered as a replacement of the relevant record data of the EF by the record data given in the command. The record pointer shall not be changed by an unsuccessful UPDATE RECORD function.

The record to be updated is described by the modes below. Four modes are defined of which only PREVIOUS is allowed for cyclic files:

CURRENT: The current record is updated. The record pointer is not affected.

ABSOLUTE: The record given by the record number is updated. The record pointer is not affected.

NEXT: The record pointer is incremented before the UPDATE RECORD function is performed and the pointed record is updated. If the record pointer has not been previously set within the selected EF, then UPDATE RECORD (next) shall set the record pointer to the first record in this EF and this record shall be updated. If the record pointer addresses the last record in a linear fixed EF, UPDATE RECORD (next) shall not cause the record pointer to be changed, and no record shall be updated.

PREVIOUS: For a linear fixed EF the record pointer is decremented before the UPDATE RECORD function is performed and the pointed record is updated. If the record pointer has not been previously set within the selected EF, then UPDATE RECORD (previous) shall set the record pointer to the last record in this EF and this record shall be updated. If the record pointer addresses the first record in a linear fixed EF, UPDATE RECORD (previous) shall not cause the record pointer to be changed, and no record shall be updated.

For a cyclic EF the record containing the oldest data is updated, the record pointer is set to this record and this record becomes record number 1.

Input:

‑ mode, record number (absolute mode only) and the length of the record;

‑ the data used for updating the record.

Output:

‑ none.

8.7 SEEK

This function searches through the current linear fixed EF to find a record starting with the given pattern. This function shall only be performed if the READ access condition for this EF is satisfied. Two types of SEEK are defined:

Type 1 The record pointer is set to the record containing the pattern, no output is available.

Type 2 The record pointer is set to the record containing the pattern, the output is the record number.

NOTE: A Phase 1 SIM only executes type 1 of the SEEK function.

The SIM shall be able to accept any pattern length from 1 to 16 bytes inclusive. The length of the pattern shall not exceed the record length.

Four modes are defined:

‑ from the beginning forwards;

‑ from the end backwards;

‑ from the next location forwards;

‑ from the previous location backwards.

If the record pointer has not been previously set (its status is undefined) within the selected linear fixed EF, then the search begins:

‑ with the first record in the case of SEEK from the next location forwards; or

‑ with the last record in the case of SEEK from the previous location backwards.

After a successful SEEK, the record pointer is set to the record in which the pattern was found. The record pointer shall not be changed by an unsuccessful SEEK function.

Input:

‑ type and mode;

‑ pattern;

‑ length of the pattern.

Output:

‑ type 1: none;

‑ type 2: status/record number

8.8 INCREASE

This function adds the value given by the ME to the value of the last increased/updated record of the current cyclic EF, and stores the result into the oldest record. The record pointer is set to this record and this record becomes record number 1. This function shall be used only if this EF has an INCREASE access condition assigned and this condition is fulfilled (see bytes 8 and 10 in the response parameters/data of the current EF, clause 9). The SIM shall not perform the increase if the result would exceed the maximum value of the record (represented by all bytes set to ‘FF’).

Input:

‑ the value to be added.

Output:

‑ value of the increased record;

‑ value which has been added.

8.9 VERIFY CHV

This function verifies the CHV presented by the ME by comparing it with the relevant one stored in the SIM. The verification process is subject to the following conditions being fulfilled:

‑ CHV is not disabled;

‑ CHV is not blocked.

If the access condition for a function to be performed on the last selected file is CHV1 or CHV2, then a successful verification of the relevant CHV is required prior to the use of the function on this file unless the CHV is disabled.

If the CHV presented is correct, the number of remaining CHV attempts for that CHV shall be reset to its initial value 3.

If the CHV presented is false, the number of remaining CHV attempts for that CHV shall be decremented. After 3 consecutive false CHV presentations, not necessarily in the same card session, the respective CHV shall be blocked and the access condition can never be fulfilled until the UNBLOCK CHV function has been successfully performed on the respective CHV.

Input:

‑ indication CHV1/CHV2, CHV.

Output:

‑ none.

8.10 CHANGE CHV

This function assigns a new value to the relevant CHV subject to the following conditions being fulfilled:

‑ CHV is not disabled;

‑ CHV is not blocked.

The old and new CHV shall be presented.

If the old CHV presented is correct, the number of remaining CHV attempts for that CHV shall be reset to its initial value 3 and the new value for the CHV becomes valid.

If the old CHV presented is false, the number of remaining CHV attempts for that CHV shall be decremented and the value of the CHV is unchanged. After 3 consecutive false CHV presentations, not necessarily in the same card session, the respective CHV shall be blocked and the access condition can never be fulfilled until the UNBLOCK CHV function has been performed successfully on the respective CHV.

Input:

‑ indication CHV1/CHV2, old CHV, new CHV.

Output:

‑ none.

8.11 DISABLE CHV

This function may only be applied to CHV1. The successful execution of this function has the effect that files protected by CHV1 are now accessible as if they were marked "ALWAYS". The function DISABLE CHV shall not be executed by the SIM when CHV1 is already disabled or blocked.

If the CHV1 presented is correct, the number of remaining CHV1 attempts shall be reset to its initial value 3 and CHV1 shall be disabled.

If the CHV1 presented is false, the number of remaining CHV1 attempts shall be decremented and CHV1 remains enabled. After 3 consecutive false CHV1 presentations, not necessarily in the same card session, CHV1 shall be blocked and the access condition can never be fulfilled until the UNBLOCK CHV function has been successfully performed on CHV1.

Input:

‑ CHV1.

Output:

‑ none.

8.12 ENABLE CHV

This function may only be applied to CHV1. It is the reverse function of DISABLE CHV. The function ENABLE CHV shall not be executed by the SIM when CHV1 is already enabled or blocked.

If the CHV1 presented is correct, the number of remaining CHV1 attempts shall be reset to its initial value 3 and CHV1 shall be enabled.

If the CHV1 presented is false, the number of remaining CHV1 attempts shall be decremented and CHV1 remains disabled. After 3 consecutive false CHV1 presentations, not necessarily in the same card session, CHV1 shall be blocked and may optionally be set to "enabled". Once blocked, the CHV1 can only be unblocked using the UNBLOCK CHV function. If the CHV1 is blocked and "disabled", the access condition shall remain granted. If the CHV1 is blocked and "enabled", the access condition can never be fulfilled until the UNBLOCK CHV function has been successfully performed on CHV1.

8.13 UNBLOCK CHV

This function unblocks a CHV which has been blocked by 3 consecutive wrong CHV presentations. This function may be performed whether or not the relevant CHV is blocked.

If the UNBLOCK CHV presented is correct, the value of the CHV, presented together with the UNBLOCK CHV, is assigned to that CHV, the number of remaining UNBLOCK CHV attempts for that UNBLOCK CHV is reset to its initial value 10 and the number of remaining CHV attempts for that CHV is reset to its initial value 3. After a successful unblocking attempt the CHV is enabled and the relevant access condition level is satisfied.

If the presented UNBLOCK CHV is false, the number of remaining UNBLOCK CHV attempts for that UNBLOCK CHV shall be decremented. After 10 consecutive false UNBLOCK CHV presentations, not necessarily in the same card session, the respective UNBLOCK CHV shall be blocked. A false UNBLOCK CHV shall have no effect on the status of the respective CHV itself.

Input:

‑ indication CHV1/CHV2, the UNBLOCK CHV and the new CHV.

Output:

‑ none.

8.14 INVALIDATE

This function invalidates the current EF. After an INVALIDATE function the respective flag in the file status shall be changed accordingly. This function shall only be performed if the INVALIDATE access condition for the current EF is satisfied.

An invalidated file shall no longer be available within the application for any function except for the SELECT and the REHABILITATE functions unless the file status of the EF indicates that READ and UPDATE may also be performed.

Input:

‑ none.

Output:

‑ none.

8.15 REHABILITATE

This function rehabilitates the invalidated current EF. After a REHABILITATE function the respective flag in the file status shall be changed accordingly. This function shall only be performed if the REHABILITATE access condition for the current EF is satisfied.

If BDN is enabled (see subclause 11.5.1) then the REHABILITATE function shall not rehabilitate the invalidated EFIMSI and EFLOCI until the PROFILE DOWNLOAD procedure is performed indicating that the ME supports the "Call control by SIM" facility (see TS 11.14 [27]).

Input:

‑ none.

Output:

‑ none.

8.16 RUN GSM ALGORITHM

This function is used during the procedure for authenticating the SIM to a GSM network and to calculate a cipher key. The card runs the specified algorithms A3 and A8 using a 16 byte random number and the subscriber authentication key Ki, which is stored in the SIM. The function returns the calculated response SRES and the cipher key Kc.

The function shall not be executable unless DFGSM or any sub-directory under DFGSM has been selected as the Current Directory and a successful CHV1 verification procedure has been performed (see subclause 11.3.1).

Input:

‑ RAND.

Output:

‑ SRES, Kc.

The contents of Kc shall be presented to algorithm A5 by the ME in its full 64 bit format as delivered by the SIM.

8.17 SLEEP

This is an obsolete GSM function which was issued by Phase 1 MEs. The function shall not be used by an ME of Phase 2 or later.

8.18 TERMINAL PROFILE

This function is used by the ME to transmit to the SIM its capabilities concerning the SIM Application Toolkit functionality.

Input:

‑ terminal profile.

Output:

‑ none.

8.19 ENVELOPE

This function is used to transfer data to the SIM Application Toolkit applications in the SIM.

Input:

‑ data string.

Output:

– The structure of the data is defined in TS 11.14 [27].

8.20 FETCH

This function is used to transfer an Application Toolkit command from the SIM to the ME.

Input:

‑ none.

Output:

‑ data string containing an SIM Application Toolkit command for the ME.

8.21 TERMINAL RESPONSE

This function is used to transfer from the ME to the SIM the response to a previously fetched SIM Application Toolkit command.

Input:

‑ data string containing the response.

Output:

‑ none.