xmlns:atom="http://www.w3.org/2005/Atom" xmlns:atom="http://www.w3.org/2005/Atom"

[F1 [F2ANNEX I B U.K. REQUIREMENTS FOR CONSTRUCTION, TESTING, INSTALLATION AND INSPECTION

Appendix 2 TACHOGRAPH CARDS SPECIFICATION

3. HARDWARE AND COMMUNICATION U.K.

3.6. Commands description U.K.

The mandatory commands for the Tachograph cards are described in this chapter.

Additional relevant details, related to cryptographic operations involved, are given in Appendix 11 Common security mechanisms.

All commands are described independently of the used protocol (T=0 or T=1). The APDU bytes CLA, INS, P1, P2, Lc and Le are always indicated. If Lc or Le is not needed for the described command, the associated length, value and description are empty.

[TCS_315] If both length bytes (Lc and Le) are requested, the described command has to be split in two parts if the IFD is using protocol T=0: the IFD sends the command as described with P3=Lc + data and then sends a GET_RESPONSE (see point 3.6.6) command with P3=Le.

[TCS_316] If both length bytes are requested, and Le=0 (secure messaging):

3.6.1. Select file U.K.

This command is compliant with ISO/IEC 7816-4, but has a restricted usage compared to the command defined in the norm.

The SELECT FILE command is used:

3.6.1.1. Selection by name (AID) U.K.

This command allows to select an application DF in the card.

[TCS_317] This command can be performed from anywhere in the file structure (after the ATR or at anytime).

[TCS_318] The selection of an application resets the current security environment. After performing the application selection, no current public key is selected anymore and the former session key is no longer available for secure messaging. The AUT access condition is also lost.

[TCS_319] Command Message
Byte Length Value Description
CLA 1 ′00h′
INS 1 ′A4h′
P1 1 ′04h′ Selection by name (AID)
P2 1 ′0Ch′ No response expected
Lc 1 ′NNh′ Number of bytes sent to the card (length of the AID): ′06h′ for the Tachograph application
#6-#(5+NN) NN ′XX..XXh′ AID: ′FF 54 41 43 48 4F′ for the Tachograph application

No response to the SELECT FILE command is needed (Le absent in T=1, or no response asked in T=0).

[TCS_320] Response Message (no response asked)
Byte Length Value Description
SW 2 ′XXXXh′ Status Words (SW1, SW2)
3.6.1.2. Selection of an elementary file using its file identifier U.K.
[TCS_321] Command Message
Byte Length Value Description
CLA 1 ′00h′
INS 1 ′A4h′
P1 1 ′02h′ Selection of an EF under the current DF
P2 1 ′0Ch′ No response expected
Lc 1 ′02h′ Number of bytes sent to the card
#6-#7 2 ′XXXXh′ File Identifier

No response to the SELECT FILE command is needed (Le absent in T=1, or no response asked in T=0).

[TCS_322] Response Message (no response asked)
Byte Length Value Description
SW 2 ′XXXXh′ Status Words (SW1, SW2)
3.6.2. Read Binary U.K.

This command is compliant with ISO/IEC 7816-4, but has a restricted usage compared to the command defined in the norm.

The Read Binary command is used to read data from a transparent file.

The response of the card consists of returning the data read, optionally encapsulated in a secure messaging structure.

[TCS_323] The command can be performed only if the security status satisfies the security attributes defined for the EF for the READ function.

3.6.2.1. Command without secure messaging U.K.

This command enables the IFD to read data from the EF currently selected, without secure messaging.

[TCS_324] Reading data from a file marked as Encrypted shall not be possible through this command.

[TCS_325] Command Message
Byte Length Value Description
CLA 1 ′00h′ No secure messaging asked
INS 1 ′B0h′
P1 1 ′XXh′ Offset in bytes from the beginning of the file: most significant byte
P2 1 ′XXh′ Offset in bytes from the beginning of the file: least significant byte
Le 1 ′XXh′ Length of data expected. number of bytes to be read

Note: bit 8 of P1 must be set to 0. U.K.

[TCS_326] Response Message
Byte Length Value Description
#1-#X X ′XX..XXh′ Data read
SW 2 ′XXXXh′ Status words (SW1, SW2)
3.6.2.2. Command with secure messaging U.K.

This command enables the IDF to read data from the EF currently selected with secure messaging, in order to verify the integrity of the data received and to protect the confidentiality of the data in the case the EF is marked as Encrypted .

[TCS_327] Command Message
Byte Length Value Description
CLA 1 ′0Ch′ Secure Messaging asked
INS 1 ′B0h′ INS
P1 1 ′XXh′ P1 (offset in bytes from the beginning of the file): Most Significant Byte
P2 1 ′XXh′ P2 (offset in bytes from the beginning of the file): Least Significant Byte
Lc 1 ′09h′ Length of input data for secure messaging
#6 1 ′97h′ T LE : Tag for expected length specification
#7 1 ′01h′ L LE : Length of expected length
#8 1 ′NNh′ Expected length specification (original Le): Number of Bytes to be read
#9 1 ′8Eh′ T CC : Tag for cryptographic checksum
#10 1 ′04h′ L CC : Length of following cryptographic checksum
#11-#14 4 ′XX..XXh′ Cryptographic checksum (4 most significant bytes)
Le 1 ′00h′ As specified in ISO/IEC 7816-4

[TCS_328] Response Message if EF is not marked as Encrypted and if Secure Messaging input format is correct:

Byte Length Value Description
#1 1 ′81h′ T PV : Tag for plain value data
#2 L ′NNh′ or ′81 NNh′

L PV : length of returned data (= original Le)

L is 2 bytes if L PV >127 bytes

#(2+L)-#(1+L+NN) NN ′XX..XXh′ Plain Data value
#(2+L+NN) 1 ′8Eh′ T CC : Tag for cryptographic checksum
#(3+L+NN) 1 ′04h′ L CC : Length of following cryptographic checksum
#(4+L+NN)-#(7+L+NN) 4 ′XX..XXh′ Cryptographic checksum (4 most significant bytes)
SW 2 ′XXXXh′ Status Words (SW1, SW2)

[TCS_329] Response Message if EF is marked as Encrypted and if Secure Messaging input format is correct:

Byte Length Value Description
#1 1 ′87h′ T PI CG : Tag for encrypted data (cryptogram)
#2 L ′MMh′ or ′81 MMh′

L PI CG : length of returned encrypted data (different of original Le of the command due to padding)

L is 2 byte if L PI CG > 127 bytes

#(2+L)-#(1+L+MM) MM ′01XX..XXh′ Encrypted data: padding indicator and cryptogram
#(2+L+MM) 1 ′8Eh′ T CC : tag for cryptographic checksum
#(3+L+MM) 1 ′04h′ L CC : length of following cryptographic checksum
#(4+L+MM)-#(7+L+MM) 4 ′XX..XXh′ Cryptographic checksum (4 most significant bytes)
SW 2 ′XXXXh′ Status words (SW1, SW2)

The encrypted data returned contain a first byte indicating the used padding mode. For the tachograph application, the padding indicator always takes the value '01h', indicating that the used padding mode is the one specified in ISO/IEC 7816-4 (one byte with value ′80h′ followed by some null bytes: ISO/IEC 9797 method 2).

The regular processing states, described for the READ BINARY command with no secure messaging (see point 3.6.2.1), can be returned using the response message structures described above, under a ′99h′ Tag (as described in TCS 335).

Additionally, some errors specifically related to secure messaging can happen. In that case, the processing state is simply returned, with no secure messaging structure involved:

[TCS_330] Response Message if incorrect Secure Messaging input format
Byte Length Value Description
SW 2 ′XXXXh′ Status words (SW1, SW2)
3.6.3. Update Binary U.K.

This command is compliant with ISO/IEC 7816-4, but has a restricted usage compared to the command defined in the norm.

The UPDATE BINARY command message initiates the update (erase + write) of the bits already present in an EF binary with the bits given in the command APDU.

[TCS_331] The command can be performed only if the security status satisfies the security attributes defined for the EF for the UPDATE function (If the access control of the UPDATE function includes PRO SM, a secure messaging must be added in the command).

3.6.3.1. Command without secure messaging U.K.

This command enables the IFD to write data into the EF currently selected, without the card verifying the integrity of data received. This plain mode is allowed only if the related file is not marked as Encrypted .

[TCS_332] Command Message
Byte Length Value Description
CLA 1 ′00h′ No secure messaging asked
INS 1 ′D6h′
P1 1 ′XXh′ Offset in bytes from the beginning of the file: most significant byte
P2 1 ′XXh′ Offset in bytes from the beginning of the file: least significant byte
Lc 1 ′NNh′ Lc length of data to Update. Number of bytes to be written
#6-#(5+NN) NN ′XX..XXh′ Data to be written

Note: bit 8 of P1 must be set to 0. U.K.

[TCS_333] Response Message
Byte Length Value Description
SW 2 ′XXXXh′ Status words (SW1, SW2)
3.6.3.2. Command with secure messaging U.K.

This command enables the IFD to write data into the EF currently selected, with the card verifying the integrity of data received. As no confidentiality is required, the data are not encrypted.

[TCS_334] Command Message
Byte Length Value Description
CLA 1 ′0Ch′ Secure messaging. Asked
INS 1 ′D6h′ INS
P1 1 ′XXh′ Offset in bytes from the beginning of the file: most significant byte
P2 1 ′XXh′ Offset in bytes from the beginning of the file: least significant byte
Lc 1 ′XXh′ Length of the secured data field
#6 1 ′81h′ T PV : tag for plain value data
#7 L ′NNh′ or ′81 NNh′

L PV : length of transmitted data

L is 2 bytes if L PV > 127 bytes

#(7+L)-#(6+L+NN) NN ′XX..XXh′ Plain data value (data to be written)
#(7+L+NN) 1 ′8Eh′ T CC : tag for cryptographic checksum
#(8+L+NN) 1 ′04h′ L CC : Length of following cryptographic checksum
#(9+L+NN)-#(12+L+NN) 4 ′XX..XXh′ Cryptographic checksum (4 most significant bytes)
Le 1 ′00h′ As specified in ISO/IEC 7816-4
[TCS_335] Response message if correct Secure Messaging input format
Byte Length Value Description
#1 1 ′99h′ T SW : tag for status words (to be protected by CC)
#2 1 ′02h′ L SW : length of returned status words
#3-#4 2 ′XXXXh′ Status words (SW1, SW2)
#5 1 ′8Eh′ T CC : tag for cryptographic checksum
#6 1 ′04h′ L CC : Length of following cryptographic checksum
#7-#10 4 ′XX..XXh′ Cryptographic checksum (4 most significant bytes)
SW 2 ′XXXXh′ Status words (SW1, SW2)

The regular processing states, described for the UPDATE BINARY command with no secure messaging (see point 3.6.3.1), can be returned using the response message structure described above.

Additionally, some errors specifically related to secure messaging can happen. In that case, the processing state is simply returned, with no secure messaging structure involved:

[TCS_336] Response Message if error in secure messaging
Byte Length Value Description
SW 2 ′XXXXh′ Status Words (SW1, SW2)
3.6.4. Get challenge U.K.

This command is compliant with ISO/IEC 7816-4, but has a restricted usage compared to the command defined in the norm.

The GET CHALLENGE command asks the card to issue a challenge in order to use it in a security related procedure in which a cryptogram or some ciphered data are sent to the card.

[TCS_337] The Challenge issued by the card is only valid for the next command, which uses a challenge, sent to the card.

[TCS_338] Command Message
Byte Length Value Description
CLA 1 ′00h′ CLA
INS 1 ′84h′ INS
P1 1 ′00h′ P1
P2 1 ′00h′ P2
Le 1 ′08h′ Le (Length of challenge expected)
[TCS_339] Response Message
Byte Length Value Description
#1-#8 8 ′XX..XXh′ Challenge
SW 2 ′XXXXh′ Status words (SW1, SW2)
3.6.5. Verify U.K.

This command is compliant with ISO/IEC 7816-4, but has a restricted usage compared to the command defined in the norm.

The Verify command initiates the comparison in the card of the CHV (PIN) data sent from the command with the reference CHV stored in the card.

Note: The PIN entered by the user must be right padded with FFh' bytes up to a length of 8 bytes by the IFD. U.K.

[TCS_340] If the command is successful, the rights corresponding to CHV presentation are opened and the remaining CHV attempt counter is reinitialised.

[TCS_341] An unsuccessful comparison is recorded in the card in order to limit the number of further attempts of the use of the reference CHV.

[TCS_342] Command Message
Byte Length Value Description
CLA 1 ′00h′ CLA
INS 1 ′20h′ INS
P1 1 ′00h′ P1
P2 1 ′00h′ P2 (the verified CHV is implicitly known)
Lc 1 ′08h′ Length of CHV code transmitted
#6-#13 8 ′XX..XXh′ CHV
[TCS_343] Response Message
Byte Length Value Description
SW 2 ′XXXXh′ Status words (SW1, SW2)
3.6.6. Get response U.K.

This command is compliant with ISO/IEC 7816-4.

This command (only necessary and available for T=0 Protocol) is used to transmit prepared data from the card to the interface device (case where a command had included both Lc and Le).

The GET_RESPONSE command has to be issued immediately after the command preparing the data, otherwise, the data are lost. After the execution of the GET_RESPONSE command (except if the error ′61xx′ or ′6Cxx′ occur, see below), the previously prepared data are no longer available.

[TCS_344] Command Message
Byte Length Value Description
CLA 1 ′00h′
INS 1 ′C0h′
P1 1 ′00h′
P2 1 ′00h′
Le 1 ′XXh′ Number of bytes expected
[TCS_345] Response Message
Byte Length Value Description
#1-#X X ′XX..XXh′ Data
SW 2 ′XXXXh′ Status words (SW1, SW2)
3.6.7. PSO: verify certificate U.K.

This command is compliant with ISO/IEC 7816-8, but has a restricted usage compared to the command defined in the norm.

The VERIFY CERTIFICATE command is used by the card to obtain a Public Key from the outside and to check its validity.

[TCS_346] When a VERIFY CERTIFICATE command is successful, the Public Key is stored for a future use in the Security environment. This key shall be explicitly set for the use in security related commands (INTERNAL AUTHENTICATE, EXTERNAL AUTHENTICATE or VERIFY CERTIFICATE) by the MSE command (see point 3.6.10) using its key identifier.

[TCS_347] In any case, the VERIFY CERTIFICATE command uses the public key previously selected by the MSE command to open the certificate. This public key must be the one of a Member State or of Europe.

[TCS_348] Command Message
Byte Length Value Description
CLA 1 ′00h′ CLA
INS 1 ′2Ah′ Perform Security Operation
P1 1 ′00h′ P1
P2 1 ′AEh′ P2: non BER-TLV coded data (concatenation of data elements)
Lc 1 [F3C2h] Lc: Length of the certificate, 194 bytes
#6-#199 194 ′XX..XXh′ Certificate: concatenation of data elements (as described in Appendix 11)
[TCS_349] Response Message
Byte Length Value Description
SW 2 ′XXXXh′ Status words (SW1, SW2)
3.6.8. Internal authenticate U.K.

This command is compliant with ISO/IEC 7816-4.

Using the INTERNAL AUTHENTICATE command, the IFD can authenticate the card.

The authentication process is described in Appendix 11. It includes the following statements:

[TCS_350] The INTERNAL AUTHENTICATE command uses the card Private Key (implicitly selected) to sign authentication data including K1 (first element for session key agreement) and RND1, and uses the Public Key currently selected (through the last MSE command) to encrypt the signature and form the authentication token (more details in Appendix 11).

[TCS_351] Command Message
Byte Length Value Description
CLA 1 ′00h′ CLA
INS 1 ′88h′ INS
P1 1 ′00h′ P1
P2 1 ′00h′ P2
Lc 1 ′10h′ Length of data sent to the card
#6-#13 8 ′XX..XXh′ Challenge used to authenticate the card
#14-#21 8 ′XX..XXh′ VU.CHR (see Appendix 11)
Le 1 ′80h′ Length of the data expected from the card
[TCS_352] Response Message
Byte Length Value Description
#1-#128 128 ′XX..XXh′ Card authentication token (see Appendix 11)
SW 2 ′XXXXh′ Status words (SW1, SW2)

[TCS_353] If the INTERNAL_AUTHENTICATE command is successful, the current session key, if existing, is erased and no longer available. In order to have a new session key available, the EXTERNAL_AUTHENTICATE command must be successfully performed.

3.6.9. External authenticate U.K.

This command is compliant with ISO/IEC 7816-4.

Using the EXTERNAL AUTHENTICATE command, the card can authenticate the IFD.

The authentication process is described in Appendix 11. It includes the following statements:

[TCS_354] A GET CHALLENGE command must precede the EXTERNAL_AUTHENTICATE command immediately. The card issues a challenge to the outside (RND3).

[TCS_355] The verification of the cryptogram uses RND3 (challenge issued by the card), the card private key (implicitly selected) and the public key previously selected by the MSE command.

[TCS_356] The card verifies the cryptogram, and if it is correct, the AUT access condition is opened.

[TCS_357] [X1The input cryptogram carries the second element for session key agreement K2.]

[TCS_358] Command Message
Byte Length Value Description
CLA 1 ′00h′ CLA
INS 1 ′82h′ INS
P1 1 ′00h′ P1
P2 1 ′00h′ P2 (the public key to be used is implicitly known, and has been previously set by the MSE command)
Lc 1 ′80h′ Lc (Length of the data sent to the card)
#6-#133 128 ′XX..XXh′ Cryptogram (see Appendix 11)
[TCS_359] Response Message
Byte Length Value Description
SW 2 ′XXXXh′ Status words (status words (SW1, SW2))

[TCS_360] If the EXTERNAL AUTHENTICATE command is successful, and if the first part of the session key is available from a successful INTERNAL AUTHENTICATE recently performed, the session key is set for future commands using secure messaging.

[TCS_361] If the first session key part is not available from a previous INTERNAL AUTHENTICATE command, the second part of the session key, sent by the IFD, is not stored in the card. This mechanism ensures that the mutual authentication process is done in the order specified in Appendix 11.

3.6.10. Manage security environment U.K.

This command is used to set a public key for authentication purpose.

This command is compliant with ISO/IEC 7816-8. The use of this command is restricted regarding the related standard.

[TCS_362] The key referenced in the MSE data field is valid for every file of the Tachograph DF.

[TCS_363] The key referenced in the MSE data field remains the current public key until the next correct MSE command.

[TCS_364] If the key referenced is not (already) present into the card, the security environment remains unchanged.

[TCS_365] Command Message
Byte Length Value Description
CLA 1 ′00h′ CLA
INS 1 ′22h′ INS
P1 1 ′C1h′ P1: referenced key valid for all cryptographic operations
P2 1 ′B6h′ P2 (referenced data concerning digital signature)
Lc 1 ′0Ah′ Lc: length of subsequent data field
#6 1 ′83h′ Tag for referencing a public key in asymmetric cases
#7 1 ′08h′ Length of the key reference (key identifier)
#8-#15 08h ′XX..XXh′ Key identifier as specified in Appendix 11
[TCS_366] Response Message
Byte Length Value Description
SW 2 ′XXXXh′ Status words (SW1, SW2)
3.6.11. PSO: hash U.K.

This command is used to transfer to the card the result of a hash calculation on some data. This command is used for the verification of digital signatures. The hash value is stored in EEPROM for the subsequent command verify digital signature.

This command is compliant with ISO/IEC 7816-8. The use of this command is restricted regarding the related standard.

[TCS_367] Command Message
Byte Length Value Description
CLA 1 ′00h′ CLA
INS 1 ′2Ah′ Perform security operation
P1 1 ′90h′ Return hash code
P2 1 ′A0h′ Tag: data field contains DOs relevant for hashing
Lc 1 ′16h′ Length Lc of the subsequent data field
#6 1 ′90h′ Tag for the hash code
#7 1 ′14h′ Length of the hash code
#8-#27 20 ′XX..XXh′ Hash code
[TCS_368] Response Message
Byte Length Value Description
SW 2 ′XXXXh′ Status words (SW1, SW2)
3.6.12. Perform hash of file U.K.

This command is not compliant with ISO/IEC 7816-8. Thus the CLA byte of this command indicates that there is a proprietary use of the PERFORM SECURITY OPERATION/HASH.

[TCS_369] The perform hash file command is used to hash the data area of the currently selected transparent EF.

[TCS_370] The result of the hash operation is stored in the card. It can then be used to get a digital signature of the file, using the PSO-COMPUTE_DIGITAL_SIGNATURE command. This result remains available for the COMPUTE DIGITAL SIGNATURE command until the next successful PERFORM HASH of FILE command.

[TCS_371] Command Message
Byte Length Value Description
CLA 1 ′80h′ CLA
INS 1 ′2Ah′ Perform security operation
P1 1 ′90h′ Tag: hash
P2 1 ′00h′ P2: hash the data of the currently selected transparent file
[TCS_372] Response Message
Byte Length Value Description
SW 2 ′XXXXh′ Status words (SW1, SW2)
3.6.13. PSO: compute digital signature U.K.

This command is used to compute the digital signature of previously computed hash code (see PERFORM HASH of FILE, point 3.6.12).

This command is compliant with ISO/IEC 7816-8. The use of this command is restricted regarding the related standard.

[TCS_373] The card private key is used to compute the digital signature and is implicitly known by the card.

[TCS_374] The card performs a digital signature using a padding method compliant with PKCS1 (see Appendix 11 for details).

[TCS_375] Command Message
Byte Length Value Description
CLA 1 ′00h′ CLA
INS 1 ′2Ah′ Perform security operation
P1 1 ′9Eh′ Digital signature to be returned
P2 1 ′9Ah′ Tag: data field contains data to be signed. As no data field is included, the data are supposed to be already present in the card (hash of file)
Le 1 ′80h′ Length of the expected signature
[TCS_376] Response Message
Byte Length Value Description
#1-#128 128 ′XX..XXh′ Signature of the previously computed hash
SW 2 ′XXXXh′ Status words (SW1, SW2)
3.6.14. PSO: verify digital signature U.K.

This command is used to verify the digital signature, provided as an input, in accordance with PKCS1 of a message, whose hash is known to the card. The signature algorithm is implicitly known by the card.

This command is compliant with ISO/IEC 7816-8. The use of this command is restricted regarding the related standard.

[TCS_377] The Verify Digital Signature command always uses the public key selected by the previous Manage Security Environment command, and the previous hash code entered by a PSO: hash command.

[TCS_378] Command Message
Byte Length Value Description
CLA 1 ′00h′ CLA
INS 1 ′2Ah′ Perform security operation
P1 1 ′00h′
P2 1 ′A8h′ Tag: data field contains DOs relevant for verification
Lc 1 ′83h′ Length Lc of the subsequent data field
#28 1 ′9Eh′ Tag for digital signature
#29-#30 2 ′8180h′ Length of digital signature (128 bytes, coded in accordance with ISO/IEC 7816-6)
#31-#158 128 ′XX..XXh′ Digital signature content
[TCS_379] Response Message
Byte Length Value Description
SW 2 ′XXXXh′ Status words (SW1, SW2)