PCSC Operation APDU Interpreter
April 13, 2023 at 2:39 AMAPDU Interpreter
Principles
In the PC/SC architecture, the SCardTransmit function implements the dialog between an application and a smart card, the coupler being only a “passive” gateway.
The coupler transmits frames in both directions, without any specific processing.
The dialog MUST follow the ISO 7816-4 standard for APDU format, and this constraint is enforced by Windows’ PC/SC subsystem:
-
[CLA] [INS] [P1] [P2] <Lc DataIn> <[Le]>
in application-to-card (uplink) direction -
<DataOut> [SW1] [SW2]
in card-to-application (downlink) direction.
In order to be able to work with smart cards that do not respect this constraint (for instance, the 1st generation of Desfire cards which uses a custom APDU format) and with cards that are not smart cards at all (e.g. wired-logic cards), the SpringCore couplers feature an APDU Interpreter that translates ISO 7816-4 APDUs into commands that are significant for the very card under operation.
CLA byte of the APDU Interpreter
The APDU Interpreter processes all commands going through SCardTransmit with the CLA
field set to FF
.