简体   繁体   中英

How does ISO 7816-3 T=0 work?

I'm trying to understand the communication for sending APDU command-response pair. Could anyone please explain, in a simple way, how T=0 works?

What are the differences between APDU and TPDU?

For example, the command header is CLA, INS, P1, P2 and P3=0x20 32 bytes data. how does a card know whether the 5th byte of a command is Lc or Le? How does the card know not to expect any command data, and how does it know if the reader is expecting data in the response?

Another thing, when does the procedure byte participate in the scenario? Is it procedure byte? or, procedure bytes? Is it mandatory for the card to send procedure byte?

An APDU is an Application Protocol Data Unit, a TPDU a Transport Protocol Data Unit. If an APDU command response pair has been defined for T=0 and it has both command data and response data (case 4S) then a separate TPDU will be generated to send and receive data ( GET RESPONSE ). See chapter 12.2.1 of ISO/IEC 7816-3 (2006).

The card knows the meaning of P3 (byte 5) because it is the server. Each command should be implemented in such a way that P3 can only have a single meaning. ISO/IEC 7816 does not comply with the OSI stack in that regard - the layers are not strictly separated. This is one of the major issues with ISO 7816.

The procedure byte is part of the T=0 transmission protocol. It is not defined in the application protocol, although it may map to SW1, the first part of a status word. It is only send to indicate to the interface device (IFD) what to do. See chapter 10.3.3 of ISO/IEC 7816-3 (2006) for more information. Chapter 10 defines T=0, T=1 does not contain a procedure byte.

APDU is for Application Layer, TPDU for Physical Layer. If you send "00 84 00 00 08" to card, card can response with "xx xx xx xx xx xx xx xx 90 00". There is no data behind p3, so p3 stands le. Otherwise, p3 stands lc. However, I think there is no need to distinguish le and lc.

Suppose Communication is divided in 3 parts- -PC to Controller (Controller have 2 part-A MCU, connected to Rcontroller unit by i2c or SPI or UART & Radio Controller Unit). -Controller to Radio Controller(antenna and Radio Transmission chip) -Radio Controller to Target or other NFC device. APDU is from PC to Controller and TPDU is from Controller to Radio Controller.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM