logo资料库

USB CCID 智能卡 DWG_Smart-Card_CCID_Rev110.pdf

第1页 / 共123页
第2页 / 共123页
第3页 / 共123页
第4页 / 共123页
第5页 / 共123页
第6页 / 共123页
第7页 / 共123页
第8页 / 共123页
资料共123页,剩余部分请下载后查看
Introduction
Related Documents
Terms and Abbreviations
Document Conventions
Overview
CCID Functional Characteristics
Communication pipes
Control pipe
Interrupt pipe
Bulk-in, Bulk-out pipes
Protocol and parameters selection
TPDU level of exchange
APDU level of exchange
Character level of exchange
Suspend Behavior
Standard USB Descriptors
Device
Configuration
Interface
Smart Card Device Class
Descriptor
CCID Endpoints
Bulk-OUT Endpoint
Bulk-IN Endpoint
Interrupt-IN Endpoint
CCID Class-Specific Request
ABORT
GET_CLOCK_FREQUENCIES
GET_DATA_RATES
CCID Messages
Command Pipe, Bulk-OUT Messages
PC_to_RDR_IccPowerOn
PC_to_RDR_IccPowerOff
PC_to_RDR_GetSlotStatus
PC_to_RDR_XfrBlock
PC_to_RDR_GetParameters
PC_to_RDR_ResetParameters
PC_to_RDR_SetParameters
PC_to_RDR_Escape
PC_to_RDR_IccClock
PC_to_RDR_T0APDU
PC_to_RDR_Secure
abPINOperationDataStucture
PIN Verification Data Structure
Message table:
bmFormatString description
bmPINBlockString
bmPINLengthFormat
PIN Modification Data Structure
Send Next Part of APDU Data Structure
Remarks on character level or TPDU level when T = 1
Response to PC_to_RDR_Secure
PC_to_RDR_Mechanical
PC_to_RDR_Abort
PC_to_RDR_SetDataRateAndClockFrequency
Response Pipe, Bulk-IN Messages
RDR_to_PC_DataBlock
RDR_to_PC_SlotStatus:
RDR_to_PC_Parameters
RDR_to_PC_Escape
RDR_to_PC_DataRateAndClockFrequency
Reporting Slot Error and Slot Status registers in Bulk-IN messages
Failure of a command
Interrupt-IN Messages
RDR_to_PC_NotifySlotChange
RDR_to_PC_HardwareError
Examples of message exchanges
Common Behavior
Character Level
APDU Level
TPDU Level
Examples of PIN Management
PIN Verification
PIN uses a binary format conversion
Initial data mapping by the device
After key entry + Binary conversion + left justification
PIN uses a shift rotation format conversion.
Initial data mapping
After key entry + left justification
PIN uses a BCD format conversion with PIN length insertion
Initial data mapping by the device
After key entry + left justification
PIN uses BCD, right justification and a control field.
Initial data mapping by the device
After key entry + right justification
PIN uses an ASCII format conversion with padding.
Initial data mapping
PIN + left justification
PIN Modification
Change PIN ASCII format (8-byte long).
PIN uses an ASCII format conversion with PIN length management.
Initial data mapping OldPIN = NewPIN
PIN + left justification
First operation: PIN conversion
Second operation: APDU command format + PIN length insertion
Character Level, Protocol T = 0, sequence for PIN verification
Sample diagrams based on dwFeatures
Definition of dwFeatures fields
ICC ATRs used in these diagrams
Voltage management
Class AB, ATR1, Feature 1
Class B, ATR1, Feature 1
Class AB, ATR1, Feature 2, 3, 4, 5 and Feature 5
Class AB, ATR2, Feature 2, 3, 4 and Feature 5
Management of Rate and protocol
Fixed rate (= ATR), ATR 2, Feature1, 2 and Feature 3
High speed, ATR 4, Feature 1 or Feature 2
Fixed rate (= ATR), ATR 2, Feature 4 or Feature 5
Fixed rate (= ATR), ATR 2, Feature 6
Fixed rate (= ATR), ATR 3, Feature 1
High speed, ATR 3, Feature1
High speed, ATR 3, Feature 2 or Feature 3
High speed, ATR 3, Feature 4
High speed, ATR 3, Feature 5
High speed, ATR 3, Feature 6
High speed, “EMV like”, Cold ATR: ATR1, Warm ATR:
Automatic IFSD management
Large IFSD, ATR4, Feature 1 or Feature 2
Large IFSD, ATR4, Feature 4
DWG Smart-Card Integrated Circuit(s) Card Interface Devices Universal Serial Bus Device Class: Smart Card CCID Specification for Integrated Circuit(s) Cards Interface Devices Revision 1.1 April 22rd, 2005 CCID Rev 1.1 Page 1 of 123
DWG Smart-Card Integrated Circuit(s) Card Interface Devices Intellectual Property Disclaimer “AS IS PROVIDED IS” WITH NO WARRANTIES THIS SPECIFICATION WHATSOEVER INCLUDING ANY WARRANTY OF MERCHANTABILITY, FITNESS FOR ANY PARTICULAR PURPOSE, OR ANY WARRANTY OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION, OR SAMPLE. A LICENSE IS HEREBY GRANTED TO REPRODUCE AND DISTRIBUTE THIS SPECIFICATION FOR INTERNAL USE ONLY. NO OTHER LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, TO ANY OTHER INTELLECTUAL PROPERTY RIGHTS IS GRANTED OR INTENDED HEREBY. AUTHORS OF THIS SPECIFICATION DISCLAIM ALL LIABILITY, INCLUDING LIABILITY FOR NFRINGEMENT OF PROPRIETARY RIGHTS, RELATING TO IMPLEMENTATION OF INFORMATION IN THIS SPECIFICATION. AUTHORS OF THIS SPECIFICATION ALSO DO NOT WARRANT OR REPRESENT THAT SUCH IMPLEMENTATION(S) WILL NOT INFRINGE SUCH RIGHTS. Contributors Bob Nathan Stephen Chasko Don Chang Daryl Adams Michel Brun Christophe Chausset Jean Luc Luong Gerhard Hahn Harald Folkenborn Eric Vila Jerome Becquart Thierry Karlisch Francis Donnat Sergey Ivanov Jean-Christophe Raynon Xavier Mariaud Doron Holan Tzvia Weisman Jim Meador Jean-Christophe Lawson NCR NCR Alcor Micro Inc Alcor Micro Inc Philips Semiconductors Philips Semiconductors Philips Semiconductors Cherry GmbH Cherry GmbH ActivCard ActivCard GemPlus GemPlus GemPlus SCM Microsystems STMicroelectronics Microsoft Corporation NDS Technologies STMicroelectronics Temic Semiconductors Page 2 of 123 CCID Rev 1.1
DWG Smart-Card Integrated Circuit(s) Card Interface Devices Revision History Revision 0.8a 0.8b 0.9a 1.0rc1 1.00 (release) 1.08k Issue Date July 5, 2000 November 2, 2000 Dec 14, 2000 Jan 29, 2001 March 20, 2001 August 13th, 2003 May 17th, 2004 October 20th, 2004 April 22nd, 2005 Comments Incorporate RRs 1-12. Promotion to 0.9 level Incorporation of RR 13-16 Proffered as 1.0rc1 Device Class ‘0x0B’ Assigned RR001, 2003-08-07 RR007, 2004-05-17 General review Release 1.1 (release) Release 1.1 Contributors Randy Aull Francis DONNAT Nicolas DRABCZUK Steffen DREWS Serge FRUHAUF Robert LEYDIER Christian SCHNECKENBURGER Dieter WEISS Microsoft Gemplus Axalto Philips STMicroelectronics Axalto Infineon G&D CCID Rev 1.1 Page 3 of 123
DWG Smart-Card Integrated Circuit(s) Card Interface Devices Contents 1 Introduction ...................................................................................................................6 1.1 Related Documents.....................................................................................................6 1.2 Terms and Abbreviations ............................................................................................6 1.3 Document Conventions ...............................................................................................9 2 Overview .....................................................................................................................10 3 CCID Functional Characteristics .................................................................................11 3.1 Communication pipes................................................................................................11 3.1.1 Control pipe........................................................................................................11 3.1.2 Interrupt pipe......................................................................................................11 3.1.3 Bulk-in, Bulk-out pipes .......................................................................................12 3.2 Protocol and parameters selection............................................................................13 3.2.1 TPDU level of exchange ....................................................................................13 3.2.2 APDU level of exchange ....................................................................................14 3.2.3 Character level of exchange ..............................................................................14 3.3 Suspend Behavior.....................................................................................................15 4 Standard USB Descriptors ..........................................................................................16 4.1 Device .......................................................................................................................16 4.2 Configuration.............................................................................................................16 Interface ....................................................................................................................16 4.3 5 Smart Card Device Class............................................................................................17 5.1 Descriptor..................................................................................................................17 5.2 CCID Endpoints.........................................................................................................20 5.2.1 Bulk-OUT Endpoint ............................................................................................21 5.2.2 Bulk-IN Endpoint ................................................................................................21 Interrupt-IN Endpoint..........................................................................................22 5.2.3 5.3 CCID Class-Specific Request ...................................................................................23 5.3.1 ABORT...............................................................................................................23 5.3.2 GET_CLOCK_FREQUENCIES .........................................................................24 5.3.3 GET_DATA_RATES ..........................................................................................24 6 CCID Messages ..........................................................................................................25 6.1 Command Pipe, Bulk-OUT Messages ......................................................................26 6.1.1 PC_to_RDR_IccPowerOn..................................................................................26 6.1.2 PC_to_RDR_IccPowerOff..................................................................................28 6.1.3 PC_to_RDR_GetSlotStatus ...............................................................................29 6.1.4 PC_to_RDR_XfrBlock........................................................................................30 6.1.5 PC_to_RDR_GetParameters.............................................................................31 6.1.6 PC_to_RDR_ResetParameters .........................................................................32 6.1.7 PC_to_RDR_SetParameters .............................................................................32 6.1.8 PC_to_RDR_Escape .........................................................................................35 6.1.9 PC_to_RDR_IccClock........................................................................................36 6.1.10 PC_to_RDR_T0APDU .......................................................................................36 6.1.11 PC_to_RDR_Secure..........................................................................................38 6.1.12 PC_to_RDR_Mechanical ...................................................................................46 6.1.13 PC_to_RDR_Abort.............................................................................................47 6.1.14 PC_to_RDR_SetDataRateAndClockFrequency ................................................47 6.2 Response Pipe, Bulk-IN Messages...........................................................................48 6.2.1 RDR_to_PC_DataBlock.....................................................................................49 6.2.2 RDR_to_PC_SlotStatus:....................................................................................50 Page 4 of 123 CCID Rev 1.1
DWG Smart-Card Integrated Circuit(s) Card Interface Devices 6.3 6.2.3 RDR_to_PC_Parameters...................................................................................51 6.2.4 RDR_to_PC_Escape .........................................................................................53 6.2.5 RDR_to_PC_DataRateAndClockFrequency......................................................53 6.2.6 Reporting Slot Error and Slot Status registers in Bulk-IN messages .................54 6.2.7 Failure of a command ........................................................................................55 Interrupt-IN Messages...............................................................................................56 6.3.1 RDR_to_PC_NotifySlotChange .........................................................................56 6.3.2 RDR_to_PC_HardwareError..............................................................................57 7 Examples of message exchanges...............................................................................58 7.1 Common Behavior.....................................................................................................58 7.2 Character Level.........................................................................................................61 7.3 APDU Level...............................................................................................................69 7.4 TPDU Level...............................................................................................................80 8 Examples of PIN Management....................................................................................87 8.1 PIN Verification..........................................................................................................87 8.1.1 PIN uses a binary format conversion .................................................................87 8.1.2 PIN uses a shift rotation format conversion. ......................................................89 8.1.3 PIN uses a BCD format conversion with PIN length insertion ...........................91 8.1.4 PIN uses BCD, right justification and a control field...........................................93 8.1.5 PIN uses an ASCII format conversion with padding. .........................................95 8.2 PIN Modification ........................................................................................................97 8.2.1 Change PIN ASCII format (8-byte long)............................................................97 8.2.2 PIN uses an ASCII format conversion with PIN length management. ...............99 8.2.3 Character Level, Protocol T = 0, sequence for PIN verification .......................102 9 Sample diagrams based on dwFeatures...................................................................103 9.1 Definition of dwFeatures fields ................................................................................103 9.2 ICC ATRs used in these diagrams ..........................................................................104 9.3 Voltage management ..............................................................................................105 9.3.1 Class AB, ATR1, Feature 1..............................................................................105 9.3.2 Class B, ATR1, Feature 1 ................................................................................106 9.3.3 Class AB, ATR1, Feature 2, 3, 4, 5 and Feature 5 ..........................................107 9.3.4 Class AB, ATR2, Feature 2, 3, 4 and Feature 5 ..............................................108 9.4 Management of Rate and protocol..........................................................................109 9.4.1 Fixed rate (= ATR), ATR 2, Feature1, 2 and Feature 3 ...................................109 9.4.2 High speed, ATR 4, Feature 1 or Feature 2.....................................................110 9.4.3 Fixed rate (= ATR), ATR 2, Feature 4 or Feature 5 .........................................111 9.4.4 Fixed rate (= ATR), ATR 2, Feature 6..............................................................112 9.4.5 Fixed rate (= ATR), ATR 3, Feature 1..............................................................113 9.4.6 High speed, ATR 3, Feature1 ..........................................................................114 9.4.7 High speed, ATR 3, Feature 2 or Feature 3.....................................................115 9.4.8 High speed, ATR 3, Feature 4 .........................................................................116 9.4.9 High speed, ATR 3, Feature 5 .........................................................................117 9.4.10 High speed, ATR 3, Feature 6 .........................................................................118 9.4.11 High speed, “EMV like”, Cold ATR: ATR1, Warm ATR: ATR4, Feature 1 .......120 9.5 Automatic IFSD management .................................................................................121 9.5.1 Large IFSD, ATR4, Feature 1 or Feature 2 .....................................................121 9.5.2 Large IFSD, ATR4, Feature 4 ..........................................................................122 CCID Rev 1.1 Page 5 of 123
DWG Smart-Card Integrated Circuit(s) Card Interface Devices 1 Introduction This document describes proposed requirements and specifications for Universal Serial Bus (USB) devices that interface with Integrated Circuit(s) Cards or act as interfaces with Integrated Circuit(s) Cards. 1.1 Related Documents The following related documents are available from WWW.USB.ORG • Universal Serial Bus Specification 2.0 (also referred to as the USB specification), April 27, 2000 • Universal Serial Bus Common Class Specification 1.0, December 16, 1997 • • • • • • The following document is available from WWW.PCSCWORKGROUP.COM • Interoperability Specification for ICCs and Personal Computer Systems, Draft Revision 1.0, December 1997 The following related documents can be ordered through WWW.ANSI.ORG ISO/IEC 7816-1; Identification Cards – Integrated circuit(s) cards with contacts Part 1: Physical Characteristics ISO/IEC 7816-2; Identification Cards – Integrated circuit(s) cards with contacts Part 2: Dimensions and Locations of the contacts ISO/IEC 7816-3; Identification Cards – Integrated circuit(s) cards with contacts Part 3: Electronic signals and transmission protocols ISO/IEC 7816-4; Identification Cards – Integrated circuit(s) cards with contacts Part 4: Inter-industry commands for interchange The following documents are available from WWW.EMVCO.COM IFM-EMV 3.1.1; May 31, 1998; EMV ’96 Integrated Circuit Card Specification for Payment Systems; IFM-EMV 3.1.1; May 31, 1998; EMV ’96 Integrated Circuit Card Terminal Specification for Payment Systems; 1.2 Terms and Abbreviations The meanings of some words have been stretched to suit the purposes of this document. These definitions are intended to clarify the discussions that follow. The formulas for BWT, CWT, ETU, and WWT, and the baud rate conversion factor table and clock rate conversion factor table shown below are for reference only. The definitive source for these is ISO/IEC 7816-3. APDU APDU Command Header ATR bps Bps BWI Application Protocol Data Unit The four byte sequence that begins an APDU; CLA INS P1 P2 (ISO/IEC 7816-4 § 5.3.1) Answer To Reset Bits per second Bytes per second Block Wait Time Integer Page 6 of 123 CCID Rev 1.1
DWG Smart-Card Integrated Circuit(s) Card Interface Devices BWT Block Waiting time is the maximum delay between the leading edge of the last character of the block received by the ICC and the leading edge of the first character of the next block sent by the ICC for protocol T = 1. BWT = 11 ETU + (2BWI * 960 * 372/Clock Frequency). Integrated Circuit(s) Cards Interface Device conforming to this specification Used interchangeably with Integrated Circuit(s) Card or Smart Card. Class byte of the command header sent to the ICC. The clock frequency currently applied to the ICC. The sequence described in the ISO/IEC 7816-3 §5.3.2. The sequence starts with the ICC powered off. Cyclic Redundancy Check Character Wait time Integer Character Waiting Time is the maximum delay between the leading edges of two consecutive characters in all blocks for protocol T = 1. CWT = (11 + 2CWI) ETU The convention determines how characters sent to and received from the ICC are interpreted. In direct convention, characters are sent least significant bit first and a “Z” signal state (high) is a ‘1’ bit. In inverse convention, characters are sent most significant bit first and an “A” signal state (low) is a ‘1’ bit. Baud rate adjustment factor Index into Baud rate adjustment factor table Baud Rate Adjustment Factor Table from ISO/IEC 7816-3 3 14 4 The clock frequency applied by default to the ICC in order to read the ATR data. It is defined in a field in the CCID Class descriptor. Elementary Time Unit: 1 ETU = F/(D * Clock Frequency). Clock rate conversion factor Index into clock conversion factor table Clock Rate Conversion Table from ISO/IEC 7816-3 3 9 15 20 RFU RFU RFU RFU RFU RFU 6 8 32 RFU 12 5 16 4 8 10 11 12 13 7 9 5 CCID Chip Card CLA Clock Frequency Cold RESET CRC CWI CWT Convention D DI 0 2 DI 1 D RFU 1 2 dwDefaultClock ETU F FI FI F 1 0 15 372 372 558 744 1116 1488 1860 RFU RFU 512 768 1024 1536 2048 RFU RFU 11 13 10 12 14 4 6 7 8 2 CCID Rev 1.1 Page 7 of 123
DWG Smart-Card Integrated Circuit(s) Card Interface Devices ICC Interface Device IFSC IFSD INS ISO/IEC Lc Le LRC NAD P1, P2 P3 PPS RFU Slot Smart Card T=0 Command Header TPDU USB-ICC Warm RESET WI WWT Integrated Circuit(s) Cards Terminal communication device or machine to which the ICC is electrically connected during operation [ISO/IEC 7816-3]. Information Field Size for ICC for protocol T = 1. Information Field Size for CCID for protocol T = 1. Instruction byte of the command header sent to the ICC International Standards Organization/ International Electro technical Commission Optional part of the body of a command APDU. Its size is 1, 2, or 3 bytes. The maximum number of bytes present in this body. Optional part of the body of a command APDU. Its size is 1, 2, or 3 bytes. The maximum number of bytes expected in the data field of the response APDU. Longitudinal Redundancy Check Node Address INS parameter of a command header (T = 0 or APDU). INS parameter of a T = 0 command header. The number of data bytes to be transferred during the command. Protocol and Parameter Selection Reserved for Future Use – Must be set to zero unless stated differently. A physical connection with an ICC Any of a number of similar devices conforming to ISO/IEC 7816-3. The sequence of five bytes; CLA INS P1 P2 P3 [ISO/IEC 7816-3 § 8.3.2]. Transport Protocol Data Unit USB Integrated Circuit(s) Card. An ICC providing a USB interface [ISO/IEC 7816-12]. The sequence described in the [ISO/IEC 7816-3 § 5.3.3]. The sequence starts with the ICC already powered. Waiting time Integer for protocol T = 0 Work Waiting Time is the maximum time allowed between the leading edge of a character sent by the ICC and the leading edge of the previous character sent either by the ICC or the interface device; WWT = 960 * WI * F / Clock Frequency Page 8 of 123 CCID Rev 1.1
分享到:
收藏