JavacardOS will not accept order any more, please contact our partner Feitian online Store:
https://ftsafe.en.alibaba.com/index.html
https://ftsafe.en.alibaba.com/index.html
Is it possible to return some data along with the status word 9000 on selecting an applet in javacard?
-
- Posts: 10
- Joined: Fri Nov 20, 2015 1:47 am
- Points :41
- Contact:
Is it possible to return some data along with the status word 9000 on selecting an applet in javacard?
I was wondering if i could send back some data from the java card applet when it is selected.
Since select() method returns a boolean value, I don't know how to return data bytes from it.
Can anyone help me with this? i want the applet to return a simple byte array along with the status word 9000 (which is default for success), when i send the select command to the card.
ie, when i send the following command
00 A4 04 00 06 01 02 03 04 05 06
i want a response like,
01 02 03 04 90 00
(first four bytes are the data returned from the applet)
Thanks in advance.
Since select() method returns a boolean value, I don't know how to return data bytes from it.
Can anyone help me with this? i want the applet to return a simple byte array along with the status word 9000 (which is default for success), when i send the select command to the card.
ie, when i send the following command
00 A4 04 00 06 01 02 03 04 05 06
i want a response like,
01 02 03 04 90 00
(first four bytes are the data returned from the applet)
Thanks in advance.
Re: Is it possible to return some data along with the status word 9000 on selecting an applet in javacard?
Code: Select all
public void process(APDU apdu) {
if (selectingApplet()) {
apdu.getBuffer()[0] = 0x01;
apdu.getBuffer()[1] = 0x02;
apdu.getBuffer()[2] = 0x03;
apdu.getBuffer()[3] = 0x04;
apdu.setOutgoingAndSend((short)0, (short)4);
return;
}
...
-
- Posts: 10
- Joined: Fri Nov 20, 2015 1:47 am
- Points :41
- Contact:
Re: Is it possible to return some data along with the status word 9000 on selecting an applet in javacard?
Thanks @rena2019. It works!
Re: Is it possible to return some data along with the status word 9000 on selecting an applet in javacard?
Code: Select all
public void process(APDU apdu)
{
byte[] buf = apdu.getBuffer();
if (selectingApplet())
{
//send data in the buffer
return;
}
}
Who is online
Users browsing this forum: No registered users and 23 guests