I understand that when an APDU is issued through a smart card reader the result has a format like this:
[ [data], SW1, SW2 ]
I know that when you're issuing the APDU you can specify the size of the expected answer by using Le
field but I'm wondering if there is any byte (or anything) within the data field that indicates its actual size.
For example, say that I want to read the master file:
First, I issue a SELECT FILE
apdu:
00 A4 00 00
which would return 61 1b
for example, where 1b
is number of bytes to read using GET RESPONSE
. Then I send the GET RESPONSE
apdu using Le
for the expected size of the answer:
00 C0 00 00 1B
And this returns [ [00, 01, 02, ...], 90, 00 ]
.
What I would like to know is: Is there a way of figuring out the size of the data field?