1

I have HID Class Reader USB Device 5427 CK . I have successfully read ATR and UID of the card . The problem is there is a number printed on card .

i.e 2x01966 21093771-1

The Output i am getting while reading the card with java API .

 PC/SC card in HID OMNIKEY 5427 CK 0, protocol T=1, state OK
ATR = 0x3B 8F 80 01 80 4F 0C A0 00 00 03 06 0A 00 1C 00 00 00 00 7E 
Card UID = 0xB6 A9 0E FB FF 12 E0 
Card type: PicoPass 16KS (8x2)

How can get the same number from UID

vlp
  • 7,811
  • 2
  • 23
  • 51
Abdul Basit
  • 493
  • 11
  • 34

2 Answers2

2

See the OMNIKEY Contactless Smart Card Readers Developer Guide available here. It tells how to communicate with iClass cards in chapters 9 and 10.

The command Select Page with P2=0x04 (request for 8-byte card serial number) might work (page 38).

EDIT>

Read the above-mentioned manual first.

Download the "Synchronous API for OMNIKEY Contactless Smart Card readers" available here (as written in the chapter 6).

Install the downloaded package and study the provided example iClassExplorer under "C:\Program Files\HID Global\Sync-API".

If you insist on calling it from java, you might find JNA useful.

The javax.smartcardio way probably won't work as you need to use the SCardCLICCTransmit function from the scardsyn.dll (chapter 9.1).

vlp
  • 7,811
  • 2
  • 23
  • 51
  • Unknown error 0x8010002f at sun.security.smartcardio.ChannelImpl.doTransmit(Unknown Source) at sun.security.smartcardio.ChannelImpl.transmit(Unknown Source) at SmartCardReader.main(SmartCardReader.java:78) Caused by: sun.security.smartcardio.PCSCException: Unknown error 0x8010002f at sun.security.smartcardio.PCSC.SCardTransmit(Native Method) ... 3 more – Abdul Basit Sep 22 '15 at 15:16
  • getting this error using this apdu cmd 80 A6, 00 04 00, 02, 00 – Abdul Basit Sep 22 '15 at 15:17
  • doesnt do any good :( retry doesnt do good still having same error apdu command for UID is returning data also ATR is getting return only serial number . Is there any security reason to read this sector – Abdul Basit Sep 22 '15 at 15:29
  • Section 9.1: iCLASS cards are supported through ISO7816 compliant APDU exchange. Command and response APDUs are exchanged through the OMNIKEY proprietary API function SCardCLICCTransmit residing in the OMNIKEY synchronous API. – vlp Sep 22 '15 at 15:33
  • already tried that it gives error... so using java smart card io libray – Abdul Basit Sep 22 '15 at 15:41
  • AFAIK the APDU should be `80 A6 00 04 08` and it should be sent via the `SCardCLICCTransmit ` function. You will need to download the "SYNCHRONOUS API FOR HID OMNIKEY READERS" as stated in the chapter 6 of the above-mentioned document. – vlp Sep 22 '15 at 20:01
  • The iClassExplorer sample gives you an exception? – vlp Sep 23 '15 at 05:33
  • Yes When i press explore it says error at SCardCLICCTransmit() – Abdul Basit Sep 23 '15 at 05:40
  • Then something went wrong, maybe someone else might be able to help you. I am out of ideas, sorry. – vlp Sep 23 '15 at 06:34
  • I am just curious...do you have any progress? – vlp Oct 19 '15 at 18:46
  • @AbdulBasit : did you get any solution. could you please post the java code – SK. Feb 01 '18 at 14:33
0

SCardCLICCTransmit() is a propriatary API call residing in OMNIKEY synchronous API DLL. Use native CCID drivers with this reader instead and access UID via FFCA0000. This should work perfectly fine without additional wrappers. This APDU is availav=ble for all PC/SC part 3 compatible contactless smart card readers.

Marc
  • 1
  • 1