SCM SCR331-DI Technical Manual

Dual interface (contact / contact-less) usb smart card reader
Table of Contents

Advertisement

SCR331-DI Product Technical Manual
SCR331-DI
Dual interface (Contact / Contact-less) USB

Smart card reader

Product Technical Manual
Version No 1.8
IND.SCR331-DI.MANUAL.VER.1.8
VER1.8
Page 1 of 36

Advertisement

Table of Contents
loading

Summary of Contents for SCM SCR331-DI

  • Page 1: Smart Card Reader

    SCR331-DI Product Technical Manual SCR331-DI Dual interface (Contact / Contact-less) USB Smart card reader Product Technical Manual Version No 1.8 IND.SCR331-DI.MANUAL.VER.1.8 VER1.8 Page 1 of 36...
  • Page 2: Table Of Contents

    SCR331-DI Product Technical Manual Contents Introduction........................... 4 Terms and Abbreviations ......................5 Product Specifications........................5 Features............................ 5 Hardware Specifics........................6 3.2.1 Adapter Power........................6 3.2.2 LED Behavior ........................6 3.2.3 Clock frequency......................... 7 3.2.4 Smart Card Slot Details..................... 7 Software Specifics ........................8 3.3.1...
  • Page 3 READER_SWITCH_RF_ON_OFF ..................31 Appendix A ..........................31 Status Words Table ........................ 31 Appendix B ..........................32 Samples of SCR331-DI contact-less communications............32 7.1.1 Simple APDU........................32 Appendix C..........................33 Sample Code for using Escape messages through Escape IOCTL ........33 IND.SCR331-DI.MANUAL.VER.1.8...
  • Page 4: Introduction

    This document contains information that allows a developer of host software to integrate an interface to contact-less cards in SCR331-DI dual interface smart card reader. This document describes the interfaces that will be provided by our SCR331-DI devices to support contact and contact-less operation. This contains details on what kind of APDUs for contact-less memory cards and T=CL type of cards is provided, their details and how applications can build a set of APDUs corresponding to contact-less cards.
  • Page 5: Terms And Abbreviations

    PC/SC 1.0 compliant drivers – including the contact-less interface Type A – CL , Type B – CL , Mifare, Memory card support T=1 simulation for contactless USB CCID like Host interface handled by SCM vendor drivers USB2.0 compliant full speed device High bus-powered through USB SCM Vendor drivers for all WINTEL platforms ( except WINNT4.0)
  • Page 6: Hardware Specifics

    CONTACT card in the CONTACT slot. The LED behavior for both the firmware configurations is given below. For details about the two different driver architectures (single/dual) please see chapter 4.2. SCR331-DI Firmware Ver 6.18; Driver Ver 4.30.00.01; PCB Rev 1.4 SCR331-DI DUAL SLOT FIRMWARE LED STATUS LED States...
  • Page 7: Clock Frequency

    SCR331-DI Product Technical Manual SCR331-DI SINGLE SLOT FIRMWARE LED STATUS LED States LED1 (GREEN) LED2 (RED) Just after plug-in (with drivers already installed) Just after DFU operation Suspend / standby Reader powered, Contact card IN, 500ms ON but not powered (98/ME - issue...
  • Page 8: Software Specifics

    SCR331-DI Product Technical Manual 3.3 Software Specifics 3.3.1 Operating systems Generic device firmware Vendor drivers for WIN98SE, WINME , WIN2000, WINXP, Windows Server 2003, Win CE 3.3.2 ICC parameters Some important smart card parameters, supported smart card types, maximum operable smart card frequencies, operating voltages etc., are detailed in the tables below.
  • Page 9: Picc Parameters

    SCR331-DI Product Technical Manual 3.3.3 PICC parameters Some important PICC parameters, supported contact-less card types, maximum operable PICC frequencies, operating voltages etc., are detailed in the tables below. ICC Parameters Value/Description Type A memory card PICC Supported (Through SCM Specific APDUs)
  • Page 10: Diver Firmware Communication Diagram

    SCR331-DI Product Technical Manual 3.4 Diver Firmware Communication Diagram 3.4.1 Dual Driver Architecture CONTACT READER CONTACTLESS READER PCSC LAYER UPPER DRIVER T = CL to T= 1 Conversion SMARTCARD READER LOWER DRIVER CONTACT SMARTCARD READER T = 0 / T = 1...
  • Page 11: Single Driver Architecture

    SCR331-DI Product Technical Manual 3.4.2 Single Driver Architecture SCM DUAL INTERFACE READER PCSC LAYER SCM SINGLE READER T = 0 T = CL FIRMWARE LAYER SCR 331 DI READER (PRIORITY) PICC IND.SCR331-DI.MANUAL.VER.1.8 VER1.8 Page 11 of 36...
  • Page 12: Software Modules

    OFF during CONTACT card presence, the real Dual slot feature is lost. 4.3 Utilities 4.3.1 Installation SCM provides Install Shield Installer for Windows to install the product. The SCM drivers as well as the utilities can be installed with the help of this installer. 4.3.2 DFU Utility DFU utilities/drivers for dynamic Device Firmware Upgrade (DFU) are shipped with the device for USB interface.
  • Page 13: Usb Interface

    SCR331-DI Product Technical Manual 4.4 USB Interface The SCR331DI USB Smart Card Reader implements a transport protocol that is compliant with Universal Serial Bus Device Class Specification for USB Chip/Smart Card Interface Devices Revision 1.00. The following sections of this document describe about the features that are implemented/ NOT implemented vis-à-vis the CCID specification.
  • Page 14: Ccid Error Codes

    SCR331-DI Product Technical Manual 4.4.4 CCID Error Codes Extensive error codes are reported on many conditions during all CCID responses. Most of the error messages are reported by the CCID appropriately. Some of the main error codes are: HW_ERROR XFR_PARITY_ERROR...
  • Page 15: Note On Automatic Pps Implementation

    SCR331-DI Product Technical Manual 4.4.6 Note on Automatic PPS implementation The CCID host driver shall use the PC_to_RDR_SetParamters message to set the F and D values. This is described in the CCID specification requirements, Sec4.1.7. For contactless part by default the reader switches to the maximum speed indicated by the card parameters.
  • Page 16: Type A T=Cl - Atr

    SCR331-DI Product Technical Manual 4.5.3 TYPE A T=CL - ATR The ATR obtained from the card, which contains PUPI length of serial numbers, and some additional card parameters like SAK byte, type of card (T=CL supported or not) etc are sent as historic bytes of a T = 1 protocol based simulated ATR.
  • Page 17: Picc T=1 Emulation

    PICC transmission part is simulated as PCSC 1.0 based T=1 protocol. All PCSC host APDU are transferred in to the SCR331-DI firmware as CCID messages. As far as the SCR331-DI firmware is concerned, it should accept only CCID messages for both ICC and PICC implementation. So the application provides does not bother about the implementation of Host applications.
  • Page 18: Overview Of Contact-Less Apdu Set

    SCR331-DI Product Technical Manual 4.5.6 Overview of Contact-less APDU Set Memory card APDU Set Command Data ISO7816_READ_BINARY 0xFC 0xB0 Block No. 0x00 None ISO7816_WRITE_BINARY 0xFC 0xD0 Block No. Length Lc bytes ISO7816_VERIFY 0xFC 0x20 AUTH_KEY Key Length Lc bytes ISO7816_USER_CMD...
  • Page 19: Detailed Description Of The Apdu Set

    SCR331-DI Product Technical Manual 4.5.7 Detailed description of the APDU set 4.5.7.1 Memory card APDU Set 4.5.7.1.1 ISO7816_READ_BINARY Description This APDU reads block, which is specified as a P1 parameter. This APDU reads block size based on Type A memory card types like Mifare 1K and 4K cards block size are 0x10 bytes and Mifare Ultra light card size is 0x04 bytes.
  • Page 20 SCR331-DI Product Technical Manual 4.5.7.1.2 ISO7816_WRITE_BINARY Description This APDU writes data pattern in to corresponding block number which is specified as a P1 parameter in APDU command set. Based on Memory card size, P3 bytes are varied. If Memory card is Mifare 1K/4K type, then P3 length is 0x10 bytes otherwise P3 length is 0x04.
  • Page 21 SCR331-DI Product Technical Manual 4.5.7.1.3 ISO7816_VERIFY Description This APDU is an authentication command for Mifare 1K and 4K cards. All Mifare cards except Mifare Ultra light support 3-Pass Authentication. Authentication for Mifare cards need 48 bit Mifare card Key. This 6 byte key value is needed for 3-Pass authentication. This command writes Authentication key in to Mifare EEPROM and check and enable 3-Pass authentication every time during transaction.
  • Page 22 SCR331-DI Product Technical Manual 4.5.7.1.4 ISO7816_USER_CMD Description This APDU helps user to give any raw data to PICC. Type B Memory card and Specific command set for both Type A and Type B cards (not as per ISO14443 standard) will use this APDU. The original PICC command starts in Data field of APDU.
  • Page 23 SCR331-DI Product Technical Manual 4.5.7.1.5 ISO7816_VALUE_BLOCK Description This APDU is used for e-purse applications. This command notifies card to increment or decrement value in particular block. Usually Mifare 1K/4K cards have two types of blocks called Data and Value blocks. Initially all blocks are data block. If user wants to change one Data block to Value block, he needs to write specific Value block format to that block.
  • Page 24: T=Cl Card Apdu Set

    SCR331-DI Product Technical Manual 4.5.7.2 T=CL card APDU Set 4.5.7.2.1 T=CL command Description This APDU is directly transferred to PICC, since T=CL protocol command is similar to ISO7816 part 4 complaint command. Format Command Data T=CL command ISO 7816 part 4 complaint command...
  • Page 25 SCR331-DI Product Technical Manual 4.5.7.2.2 T=CL PPS Description This APDU helps user to change the baud rate of PICC. Currently this is enabled only for Type A PICC. This command is similar to ISO 7816 PPS, but this command has to manually send by user for changing speed of PICC.
  • Page 26 P3 field. The firmware parses this APDU and send the Lc part to the card. Response Data PICC response data with Status bytes N ote SCR331-DI parses this APDU and send only P3 length data bytes from this APDU to PICC Example User APDU command Data 0xFC...
  • Page 27: Picc Escape Implementation

    SCR331-DI Product Technical Manual 4.5.7.2.4 T=CL GET IFSC command Description This APDU helps user to get the contact-less card IFSC value and CID value. This APDU is used for T=CL type of cards. Format Command T=CL GET IFSC 0xFC 0xFD...
  • Page 28: Reader_Cntless_Send_Req

    SCR331-DI Product Technical Manual 5.2 READER_CNTLESS_SEND_REQ This escape message causes the firmware to issue the PICC Request command. The first byte of the input buffer contains the escape function value and the second one contains the request code to be issued. The output buffer contains the Answer To request bytes.
  • Page 29: Scr331-Di Product Technical Manual

    SCR331-DI Product Technical Manual Any other value sent as mode will set the type as the default one, that is TYPE AB. 5.8 READER_CNTLESS_RF_SWITCH This escape message ID can be used to retrieve the current RF state (ON/OFF) in reader and to switch the RF state.
  • Page 30: Reader_Cntless_Raw_Xmit

    SCR331-DI Product Technical Manual 5.10 READER_CNTLESS_RAW_XMIT Based on the Raw Transmit configurations set in the READER_CNTLESS_RAW_CFG escape command, and the parameters in this escape IOCTL, the command is executed, and the output buffer contains the response of the command The input buffer values are as given below S.No.
  • Page 31: Reader_Switch_Rf_On_Off

    SCR331-DI Product Technical Manual bytes, the second byte will be set to 0xFF and on success of the command, the first byte of output buffer contains the current state. Following table gives the value of second byte of input buffer as interpreted by firmware S.No.
  • Page 32: Samples Of Scr331-Di Contact-Less Communications

    SCR331-DI Product Technical Manual 7.0 Appendix B 7.1 Samples of SCR331-DI contact-less communications 7.1.1 Simple APDU PCSC APPLICATION – SCR331-DI PCSC DRIVER HOST LEVEL FIRMWARE Send APDU SCardTransmit BYTE apdu[] = CLA ,INS , P1, P2 ,P3 CLA, INS, P1, P2, P3 SCARD_PROTOCOL_T1 ‘n’...
  • Page 33: Sample Code For Using Escape Messages Through Escape Ioctl

    SCR331-DI Product Technical Manual 8.0 Appendix C 8.1 Sample Code for using Escape messages through Escape IOCTL File Name : T_pupi.H #ifdef __cplusplus extern "C" { #endif #define IOCTL_CCID_ESCAPE SCARD_CTL_CODE(0xDAC) #define CCID_GET_PUPI_STATUS 0xFF9B #define CCID_SET_PUPI_ON 0x019B #define CCID_SET_PUPI_OFF 0x009B #define MINTIMEOUT...
  • Page 34 // please add the name of the used reader here or use SCardListReaders to find the right reader name char *ReaderName[] = "SCM Microsystems Inc. SCR331-DI USB ContactlessReader 0", NULL /********************************************************************************************************/ ContextHandle = -1; ret = SCardEstablishContext(SCARD_SCOPE_USER, NULL, NULL, &ContextHandle);...
  • Page 35 SCR331-DI Product Technical Manual &ActiveProtocol); /* get actual PUPI status: ON/OFF */ InBufLen = 2; InWord = CCID_GET_PUPI_STATUS; ret = SCardControl(CardHandle, IOCTL_CCID_ESCAPE, &InWord, InBufLen, &OutByte, 1, &ResLen); printf ("\n Get PUPI status: %lx: %.2x", ret,OutByte); Reader[0].dwCurrentState = SCARD_STATE_UNAWARE; Reader[0].dwEventState = SCARD_STATE_UNAWARE;...
  • Page 36 SCR331-DI Product Technical Manual ret = SCardDisconnect(CardHandle, SCARD_RESET_CARD); else printf("\n SCardConnect failed with 0x%.8lX",ret); ret = SCardReleaseContext(ContextHandle); else printf("\n SCardEstablishContext failed with %.8lX",ret); printf("\npress any key to close the test tool\n"); getch(); IND.SCR331-DI.MANUAL.VER.1.8 VER1.8 Page 36 of 36...

Table of Contents