JavacardOS will not accept order any more, please contact our partner Feitian online Store:
https://ftsafe.en.alibaba.com/index.html

Send data to java card through APDU

JavaCard Applet Development Related Questions and Answers.
kineri
Posts: 19
Joined: Thu Dec 10, 2015 2:04 am
Points :184
Contact:

Send data to java card through APDU

Post by kineri » Sat Jan 23, 2016 5:46 am

I want to create an applet which sends some data to a java card.

This is part of the code.

Code: Select all

apdu = new Apdu();
          apdu.command[Apdu.CLA] = TestComm.CLA_MYAPPLET;
          apdu.command[Apdu.P1] = 0x00;
          apdu.command[Apdu.P2] = 0x00;
          apdu.command[Apdu.INS] = TestComm.INS_GENERATE_SIGN;
          cad.exchangeApdu(apdu);
          if (apdu.getStatus() != 0x9000) {
               System.out.println("Errorr : status word different from 0x9000");
          } else {
               . . .


I thought that I could give data through P1, but it only accepts a single byte and I have to transmit an array of byte. I am confused. Does anyone give me a clear explanations?

User avatar
UNKNwYSHSA
Posts: 630
Joined: Thu May 21, 2015 4:05 am
Points :3055
Contact:

Re: Send data to java card through APDU

Post by UNKNwYSHSA » Sat Jan 23, 2016 11:49 pm

The APDU data field is for your requirement.
The data field is start with the offset Apdu.DATA.
sense and simplicity

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 25 guests

JavaCard OS : Disclaimer