AET62 Reference Manual
Version 1.0
Page 24 of 37
idvation GmbH
Otto-Hesse-Straße 19 / T5
Phone +49 6151 4923021
D-64293 Darmstadt
Fax +49 6151 3689296
www.idvation.com
8.2.
How to Access DESFire Tags (ISO 14443-4)?
DESFire supports ISO 7816-4 APDU Wrapping and Native modes. Once the DESFire Tag is activated, the first APDU
sent to the DESFire Tag will determine the “Command Mode”. If the first APDU is in “Native Mode”, the rest of the APDUs
must be in “Native Mode” format. Similarly, if the first APDU is in “ISO 7816-4 APDU Wrapping Mode”, the rest of the
APDUs must be in “ISO 7816-4 APDU Wrapping Mode” format.
Example 1: DESFire ISO 7816-4 APDU Wrapping
To read 8 bytes random number from an ISO 14443-4 Type A PICC (DESFire)
APDU = {
90 0A 00 00 01 00 00
}
Class =
0x90
; INS =
0x0A
(DESFire Instruction); P1 =
0x00
; P2 =
0x00
Lc =
0x01
; Data In =
0x00
; Le =
0x00
(Le =
0x00
for maximum length)
Answer:
7B 18 92 9D 9A 25 05 21 [$91AF]
The Status Code [
91 AF
] is defined in DESFire specification. Please refer to the DESFire
specification for more details.
Example 2: DESFire Frame Level Chaining (ISO 7816 wrapping mode)
In this example, the application has to do the “Frame Level Chaining”. To get the version of the DESFire card.
Step 1: Send an APDU {
90 60 00 00 00
} to get the first frame. INS=
0x60
Answer:
04 01 01 00 02 18 05 91 AF [$91AF]
Step 2: Send an APDU {
90 AF 00 00 00
} to get the second frame. INS=
0xAF
Answer:
04 01 01 00 06 18 05 91 AF [$91AF]
Step 3: Send an APDU {
90 AF 00 00 00
} to get the last frame. INS=
0xAF
Answer:
04 52 5A 19 B2 1B 80 8E 36 54 4D 40 26 04 91 00 [$9100]
Example 3: DESFire Native Command
We can send Native DESFire Commands to the reader without ISO 7816 wrapping if we find
that the Native DESFire Commands are easier to handle.
To read 8 bytes random number from an ISO 14443-4 Type A PICC (DESFire)
APDU =
{0A 00}
Answer:
AF 25 9C 65 0C 87 65 1D D7[$1DD7]
In which, the first byte “AF” is the status code returned by the DESFire Card.
The Data inside the blanket
[$1DD7]
can simply be ignored by the application.
Example 4: DESFire Frame Level Chaining (Native Mode)
In this example, the application has to do the “Frame Level Chaining”.
To get the version of the DESFire card.
Step 1: Send an APDU {
60
} to get the first frame. INS=
0x60
Answer:
AF 04 01 01 00 02 18 05[$1805]
Step 2: Send an APDU
{AF}
to get the second frame. INS=
0xAF
Answer:
AF 04 01 01 00 06 18 05[$1805]
Step 3: Send an APDU {
AF
} to get the last frame. INS=
0xAF
Answer:
00 04 52 5A 19 B2 1B 80 8E 36 54 4D 40 26 04[$2604]
Note: In DESFire Native Mode, the status code [90 00] will not be added to the response if the response length is greater
than 1. If the response length is less than 2, the status code [90 00] will be added in order to meet the requirement of
PCSC. The minimum response length is 2.