how to write and read data from smart card using java card apdu

后端 未结 2 604
轮回少年
轮回少年 2021-01-16 01:07

I have written an applet and installed it in smart card. But I don\'t know how to read and write data to smart card?

private void readName(APDU apdu) throws          


        
相关标签:
2条回答
  • 2021-01-16 01:19

    I found solution.actually I am using eclipse as a editor java card plugin are install in it.when I run program on Smart Card it install latest applet on previous applet every time.To see result we can use pyapdu tool it is very good. thanks for all the response..

    0 讨论(0)
  • 2021-01-16 01:38

    Your card is either contact or contactless. Since you say you have already installed the applet, I assume you have the keys to the card.

    If so, in order to communicate with your card you will need to do the following:

    1. First authenticate with the Security Domain to which the applet is installed
    2. Select the AID of the applet
    3. use SEND to send data to applet.

    And in the response, you will see the bytes you are sending from the Applet:

    apdu.setOutgoingLength((short)userName.length);
    apdu.sendBytes((short)5, (short)userName.length);
    

    If you need anything more, you will need to provide more details on what you are attempting to accomplish.

    0 讨论(0)
提交回复
热议问题