Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get SAK to Identify smart card type using JAVA?

Tags:

java

smartcard

I am using Java Smart Card API to access. I have NXP Mifare desfire 4K , 1K , Ultra light smart cards with me & trying to find out its type programically in JAVA.

I referred to document AN10833 from NXP site (http://www.nxp.com/documents/application_note/AN10833.pdf). I have following queries related:

  1. How to get SAK using JAVA?
  2. what is APDU to execute REQA command?
like image 797
Tanmay Solanki Avatar asked Oct 23 '25 12:10

Tanmay Solanki


2 Answers

Find out the ATR of the card and ATR contain the the information of card type. Here I am uploading image See the structure of ATR... For more info Here the full PDF look at Page no 6.

enter image description here

enter image description here

like image 184
Jitendra Avatar answered Oct 25 '25 02:10

Jitendra


edit: Apologies that this does not directly answer the question but the current top answer is potentially harmful. I'm trying to discover how to get the SAK myself will try to post an update when I do.

Determining card type from the ATS/ATR is commonplace, but wrong. NXP advises using SAK.

"As the ATS of different MIFARE ICs can be customized, it is certainly not advisable to rely on the ATS to differentiate the IC type"

Ref: http://www.nxp.com/documents/application_note/AN10833.pdf

Instead, look here for a detailed tree of how to determine card type from the SAK: http://www.nxp.com/documents/application_note/130830.pdf

As an aside, in production if you can be assured that you will always get the same format of ATR/ATS on all your cards, that can be a viable option. But it is not guaranteed.

I have no idea what in the world VCA is, but from the first document:

"In future, NXP recommends to use “Virtual Card Architecture (VCA)” for PICC selection and type identification. If installations do not depend on the actual content of ATQA, SAK and/or ATS for card selection and identification, this allows for more than one MIFARE product being enabled for activation in a single device at the same time. In this case, the VCA allows for efficient and privacy friendly selection of the targeted MIFARE product. This is described in a separate application note."

like image 40
Kevin Dildonik Avatar answered Oct 25 '25 03:10

Kevin Dildonik



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!