How to Reset java card using APDU command

非 Y 不嫁゛ 提交于 2019-12-07 22:32:28

问题


I am new to java card development.so far i have developed java card applet which can encrypt data using RSA algorithm. So basically i followed Application selection and send data.But now i want to reset java card before selecting the java card.Can anyone give me some brief idea how to do that??thanks Sajith.


回答1:


There is no such thing as a RESET APDU command. Generally speaking, you can reset using a lower level API (which may not be available to you) or by disconnecting the card entirely. Or you can of course remove the power supply entirely by removing the card from the reader.


There may be reader specific commands (also called proprietary commands) that can be accessed through a CLA=FF escape. For instance the ACR122U ACR reader specifies:

  1. The antenna can be switched off in order to save the power.

    • Turn off the antenna power: FF 00 00 00 04 D4 32 01 00h

    • Turn on the antenna power: FF 00 00 00 04 D4 32 01 01h

Here FF 00 00 00 is the escape header, 04 is the length byte Lc and D4 32 01 00 or D4 32 01 01 is the proprietary command.

This is just a some reader I found using an internet search.


Notes

  • using getATR() in the Java javax.smartcardio libraries does not reset the card - it just returns the previously received ATR if the card is already powered on;
  • there is no method to reset the card in the Java Card API either.


来源:https://stackoverflow.com/questions/18340842/how-to-reset-java-card-using-apdu-command

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!