1

I'm trying to extract the ATR from a smartcard using the new Windows.Devices.SmartCards namespace in Windows Phone 8.1 (I'm using Silverlight).

I'm calling the method GetAnswerToResetAsync and this responds with a COM object, which converts to a 14 byte array (in my case). Our developers using Android use something called GetHistoricalBytes, and this produces an ATR of 20 didgits.

Has anyone else had experience with this method, and does anyone know what information we should be expecting from it. I also expected the payload to be a lot bigger, so perhaps the info I seek is not in this call. I've looked at the GetIdAsync, but this responds with card doesn't support this feature.

Michael Roland
  • 39,663
  • 10
  • 99
  • 206
Nick Wright
  • 1,403
  • 13
  • 19

1 Answers1

0

Android + getHistoricalBytes() suggests that you are using a contactless smartcard (ISO/IEC 14443 Type A). Over the contactless interface, a smartcard does not have an ATR (as there is no reset procedure like on the contact interface). Instead, the card has an ATS (answer to select) as the reader selects the card in an anti-collision sequence. The ATS and the ATR have structural similarities but do not convey same information.

What you get as ATR on Windows depends on how you access the card:

  • If you access the card over the contact interface, you will get the real ATR of the card. Depending on the card, you might be able to query the same information over the contactless interface by reading the elementary file EF.ATR.

  • If you access the card over the contactless interface, you will likely get an emulated ATR that has been generated by the PC/SC layer. For an ISO/IEC 14443-4 Type A contactless smartcard, that emulated ATR should contain the historical bytes from the ATS starting at byte 4. (You can find a description of the mapping in Part 3 of the PC/SC specification)

Michael Roland
  • 39,663
  • 10
  • 99
  • 206
  • Yes, it is contactless. Thanks for the info, i hope to return back to this soon and will report any info back when done so. – Nick Wright Jan 09 '15 at 09:04