Page 1 of 1

How to know the real length of data

Posted: Thu Jun 15, 2017 11:48 pm
by NeinET
I am a little confused about Lc and Le. If I send a case 3 APDU command and set Lc to 8bytes, but include no data after Lc, the card will update the file with 00000000. How can I check if there is any data after Lc in the received APDU? I just want to know the real length of data. Much appreciated for any help.

Re: How to know the real length of data

Posted: Fri Jun 16, 2017 3:20 am
by Thelogan
If you want to check the real values, you could combine the Lc value with the value returned from apdu.setIncomingAndReceive(). This will indicate how many bytes will be read into the APDU buffer.