Page 1 of 1

Find the data back in Buffer

Posted: Fri May 26, 2017 11:05 pm
by Kabin
I have a problem about APDU buffer. When I select my applet, there are "CLA INS P1 P2 Lc Data" in the buffer, but when I tried to check the PIN code, this buffer array didn't have my PIN code in the data field. I only got "CLA INS P1 P2 Le". Why didn't it contain my PIN code? Need I do other operation to get this?

Code: Select all

byte[] buffer = apdu.getBuffer();

Re: Find the data back in Buffer

Posted: Sat May 27, 2017 5:26 am
by choimillen
Please add this command:

Code: Select all

apdu.setIncomingAndReceive();

Re: Find the data back in Buffer

Posted: Sat May 27, 2017 5:53 am
by Kabin
Well, I found I have made a stupid mistake. I missed this line

Code: Select all

apdu.setIncomingAndReceive();

Thanks for your help, choimillen.

Re: Find the data back in Buffer

Posted: Sun May 28, 2017 11:04 pm
by UNKNwYSHSA
choimillen wrote:Please add this command:

Code: Select all

apdu.setIncomingAndReceive();


You need to make sure that all data bytes are received, maybe you need the method apdu.receiveBytes() to receive all your data bytes.