| PCSC-3-Sup-CL | Interoperability Specification for ICCs and Personal Computer Systems Part 3. Supplemental Document for Contactless ICCs Revision 2.02.00 |
|---|
| PCSC-3 | Interoperability Specification for ICCs and Personal Computer Systems Part 3. Requirements for PC-Connected Interface Devices Revision 2.01.09 |
|---|
| PCSC-3-Sup | Interoperability Specification for ICCs and Personal Computer Systems Part 3. Supplemental Document Revision 2.01.08 |
|---|
| PCSC-3-AMD | Interoperability Specification for ICCs and Personal Computer Systems Part 3. Requirements for PC-Connected Interface Devices - AMENDMENT 1 Revision 2.01.09 6 July 2018 |
|---|
| PLT-03099, Rev. A.3 | Introduction |
|---|
| Abbreviation | Description |
|---|
| AES | Advanced Encryption Standard |
|---|
| APDU | Application Protocol Data Unit |
|---|
| API | Application Programming Interface |
|---|
| ASN.1 | Abstract Syntax Notation One |
|---|
| BER | Basic Encoding Rules |
|---|
| CLA | Class byte of an APDU |
|---|
| CSN | Card Serial Number |
|---|
| DER | Distinguished Encoding Rules |
|---|
| IFD | Interface Device (for accessing ICC card) |
|---|
| MAC | Message Authentication Code |
|---|
| MSDN | Microsoft Developer Network |
|---|
| OID | Object Identifier |
|---|
| PAC | Physical Access Control |
|---|
| PACS | PAC Physical Access Control Services |
|---|
| PDU | Protocol Data Unit |
|---|
| PC/SC | Personal Computer / Smart Card |
|---|
| SIO | Secure Identity Object |
|---|
| July 2018 | 7 |
|---|
| Introduction | PLT-03099, Rev. A.3 This page is intentionally left blank. |
|---|
| Section | 2 |
|---|
| Getting started | PLT-03099, Rev. A.3 This page is intentionally left blank. |
|---|
| ■ | CCID (Integrated Circuit Cards Interface Device, v1.1) |
|---|
| Endpoint | Description Type Max. Packet Size |
|---|
| EPX | Control Endpoint Interrupt IN/OUT |
|---|
| Host interfaces | PLT-03099, Rev. A.3 This page is intentionally left blank. |
|---|
| Human interface | PLT-03099, Rev. A.3 This page is intentionally left blank. |
|---|
| Contact Card Interface | PLT-03099, Rev. A.3 Card Insertion Apply a class Select another class Power Up Card Card |
|---|
| No | answer to reset Yes ATR available? Yes Perform PPS Generate fake ATR (if applicable) Notify CCID Card ready 16 July 2018 |
|---|
| Sequence | 3 2 1 |
|---|
| Bit | 7 6 5 4 3 2 1 0 |
|---|
| Voltage | 0 0 01 - 1.8 V 01 - 1.8 V 01 - 1.8 V 10 - 3 V 10 - 3 V 10 - 3 V 11 - 5 V 11 - 5 V 11 - 5 V |
|---|
| Value | Comments 01h TPDU exchange level 02h APDU exchange level 03h Extended APDU exchange level |
|---|
| Personal Computer / Smart Card | PLT-03099, Rev. A.3 To acquire a list of all PC/SC readers use the SCardListReaders function. Look for HID Global OMNIKEY Smart Card Reader in the returned list. If multiple Contact Smart Card readers are connected to your system, they will be enumerated. Example: HID Global OMNIKEY Smart Card Reader 0, and HID Global OMNIKEY Smart Card Reader 1. LONG SCardListReaders( IN SCARDCONTEXT hContext, IN |
|---|
| FFh | 70h 07h 6Bh xx DER TLV coded PDU xx (Vendor Payload) |
|---|
| Vendor Command | Tag Value Vendor Payload Branch |
|---|
| A2h (constructed) | readerInformationApi |
|---|
| BCh (constructed) | deviceSpecificCommand 9Dh (primitive) response BDh (constructed) 9Eh (primitive) errorResponse |
|---|
| Data Field | SW1 SW2 |
|---|
| DER TLV coded Response PDU | See ISO 7816-4 9E 02 xx yy 90 00 |
|---|
| cycle | Value byte 1: Cycle in which the error occurred, see Error Cycle |
|---|
| error | Value byte 2: Error code, see Error Code |
|---|
| SW1 | 90 |
|---|
| SW2 | 00 First value byte |
|---|
| Cycle | Description 0 HID Proprietary Command APDU 1 HID Proprietary Response APDU 2 HID Read or Write EEPROM Structure 3 RFU 4 RFU 5 RFU 22 July 2018 |
|---|
| Exception | Description |
|---|
| Command Data | SW1 SW2 |
|---|
| Asynchronous cards support | PLT-03099, Rev. A.3 26 July 2018 |
|---|
| Command | Comments |
|---|
| READ_BINARY | Implemented according to PC/SC spec |
|---|
| UPDATE_BINARY | Implemented according to PC/SC spec |
|---|
| VERIFY | Implemented according to PC/SC spec |
|---|
| READ_PROTECTION_MEMORY | Proprietary extension to PC/SC Applicable for SLE 4418/28/32/42 |
|---|
| COMPARE_AND_PROTECT | Proprietary extension to PC/SC Applicable for SLE 4418/28/32/42 |
|---|
| MODIFY | Proprietary extension to PC/SC Applicable for SLE 4418/28/32/42 |
|---|
| I2C_INIT | Proprietary extension to PC/SC Applicable for I2C cards |
|---|
| I2C_WRITE | Proprietary extension to PC/SC Applicable for I2C cards |
|---|
| I2C_READ | Proprietary extension to PC/SC Applicable for I2C cards |
|---|
| Synchronous cards support | PLT-03099, Rev. A.3 |
|---|
| Warning | 62h 81h Part of returned data may be corrupted 82h End of file reached before reading expected number of bytes |
|---|
| Error | 69h 81h Command incompatible 82h Security status not satisfied (no PIN presented) 86h Command not allowed 6Ah 81h Function not supported 82h File not found / Addressed block or byte does not exist 6Ch xxh Wrong length (wrong number Le; ‘xx’ is the exact number) 28 July 2018 |
|---|
| CXh | Counter (verification failed; 'X' encodes the number of further allowed retries) |
|---|
| Version | Flag 1 Flag 2 Address Address Data to Compare 01h 00h 00h MSB LSB N Data-Bytes Data Out (Address MSB LSB) + SW1 SW2 |
|---|
| 類型 | Page Size Number of Memory Size Card Address Bytes 00h XX XX MSB XX XX LSB undefined 01h 8 1 256 ST14C02C 02h 8 1 512 ST14C04C 03h 32 2 4096 ST14E32 04h 16 1 512 M14C04 05h 16 1 2048 M14C16 06h 32 2 4096 M14C32 07h 32 2 8192 M14C64 08h 64 2 16384 M14128 09h 64 2 32768 M14256 0Ah 8 1 256 GFM2K 0Bh 16 1 512 GFM4K 0Ch 32 2 4096 GFM32K 0Dh 8 1 128 AT24C01A 0Eh 8 1 256 AT24C02 0Fh 16 1 512 AT24C04 10h |
|---|
| A6h (constructed) | 2WBPReaderWrite [A0h] 3WBPReaderWrite [A1h] I2CReaderWrite [A0h] |
|---|
| Byte 1 | Byte 2 Byte 3 Command |
|---|
| Control | Address Data |
|---|
| B7 | B6 B5 B4 B3 B2 B1 B0 A7 - A0 D7 - D0 |
|---|
| FF 70 07 6B 07 | //Vendor Specific APDU with 7 bytes object |
|---|
| A6 05 | //Synchronous Card Command |
|---|
| A0 03 | //2WBPReadWrite 38 AA 55 //Control = 0x38, Address = 0xAA, Data = 0x55 00 //Le |
|---|
| BD 02 | //Response |
|---|
| A0 00 | //Received data (0 bytes) 99 00 //SW1SW2 |
|---|
| BD 03 | //Response |
|---|
| A0 01 | //Received data (1 byte) 55 //Data 99 00 //SW1SW2 |
|---|
| A9 | A8 S5 S4 S3 S2 S1 S0 A7 - A0 D7 - D0 1 1 0 0 0 1 input data Write and erase with protect bit 1 1 0 0 1 1 input data Write and erase without protect bit 1 1 0 0 0 0 comparison Write protect bit with data |
|---|
| address | address |
|---|
| data | comparison (verification) |
|---|
| bit | bit bit 0 0 1 1 1 0 no effect Read 8 bits, data without protect bit 1 1 0 0 0 1 input data Write and erase with protect bit |
|---|
| A1 03 | //3WBPReadWrite 0C AA 00 //Address = 0xAA 00 //Le |
|---|
| BD 04 | //Response |
|---|
| A1 02 | //Received data (2 bytes) |
|---|
| AA 80 | //Data = 0xAA, Protect bit = 0x80 (set) 90 00 //SW1SW2 |
|---|
| A1 00 | //Received data (0 bytes) 90 00 //SW1SW2 |
|---|
| Offset | Field Size Value Description 0 Address length 1 1, 2, 3 length of address: 1…salve address only 2…slave address + byte-subaddress 3…slave address + word-subaddress 1 Bytes to read/write 1 N # of bytes to read/write 2 Address 1 device address 3 Subaddress 1 1 First byte of subaddress 4 Subaddress 2 1 Second byte of subaddress 5 Data N array of data bytes 1 0 1 0 P2 P1 P0 R/W |
|---|
| MSB | LSB 42 July 2018 |
|---|
| FF 70 07 6B 09 | //Vendor Specific APDU with 9 bytes object |
|---|
| A6 07 | //Synchronous Card Command |
|---|
| A2 05 | //I2CReadWrite 03 10 A1 01 00 //5 bytes of command 00 //Le |
|---|
| BD 12 | //Response |
|---|
| A2 10 | //Received data (16 bytes) 16 Bytes of received data //Data 90 00 //SW1SW2 |
|---|
| BD 0A | //Response |
|---|
| A2 08 | //Received data (8 bytes) 8 Bytes of received data //Data 90 00 //SW1SW2 |
|---|
| A2 01 | //Received data (0 bytes) |
|---|
| XX | //Data 90 00 //SW1SW2 44 July 2018 |
|---|
| FF 70 07 6B 11 | //Vendor Specific APDU with 9 bytes object |
|---|
| A6 0F | //Synchronous Card Command |
|---|
| A2 0D | //I2CReadWrite 03 08 A0 01 00 //5 bytes of command |
|---|
| XX XX XX XX XX XX XX XX | //Data to write 00 //Le |
|---|
| A2 00 | //Received data (0 bytes) 90 00 //SW1SW2 |
|---|
| FF 70 07 6B Lc | Tag = A2h Get [A0h] readerCapabilities [A0h] (read only) |
|---|
| Set [A1H] | tlvVersion [80h] deviceID [81h] product Name [82h] product Platform [83h] firmwareVersion [85h] hardwareVersion [89h] hostInterfaces [8Ah] numberOfContactSlots [8Bh] vendorName [8Fh] exchangeLevel [91h] serialNumber [92h] sizeOfUserEERrom [94h] firmwareLabel [96] contactSlotConfiguration [A3h] exchangeLevel [91h] voltageSequence [82h] operatingMode [83h] readerEEPROM [A7h] eepromOffset [81h] eepro |
|---|
| Reader configuration | PLT-03099, Rev. A.3 |
|---|
| Tag | ASN.1 name Value Type Len Access 48 July 2018 |
|---|
| Tags | Function |
|---|
| A2 0F | reader information API |
|---|
| A1 0D | SET |
|---|
| A7 0B | readerEEPROM |
|---|
| A2 0B | reader information API |
|---|
| A0 09 | GET |
|---|
| A7 07 | readerEEPROM |
|---|
| Appendix | A |
|---|
| Enabling Escape CCID commands | PLT-03099, Rev. A.3 This page is intentionally left blank. |
|---|
| Sample code | PLT-03099, Rev. A.3 return 1; //Select protocol T=1 or T=0 if( SCARD_PROTOCOL_T1 == dwActiveProtocol ) pIoReq = *SCARD_PCI_T1; else pIoReq = *SCARD_PCI_T0; //get ATR dwLen = sizeof(pBuffer); lResult = SCardStatus( hCard, NULL, NULL, NULL, NULL, pBuffer, &dwLen); if( SCARD_S_SUCCESS != lResult ) //disconnect card SCardDisconnect(hCard, SCARD_LEAVE_CARD); //release context SCardReleaseContext(hConte |
|---|