Smart Card 61 xx Error - what exactly does this mean?

278 Views Asked by At

I've installed an applet I've written onto a smartcard - but when sending commands to it, keep getting the 61 xx response. This doesn't happen when I run it in JCIDE, only when on an actual card.

I understand that a response of 61 xx means 'response bytes remaining' and that the xx is how many bytes of data are left - but I'm not sure why this happens. Does the Le of the command APDU need to specify the number of bytes in response? Do I need do get the response somehow (and how do I do this)? or is there another reason I am getting this error?

I have written other applets using the same code (see below) and not had this issue

apdu.SetOutgoing();
apdu.setOutGoingLength(length);
apdu.sendByteslOng(buff, offset, length);
1

There are 1 best solutions below

0
On BEST ANSWER

61xx is not an error, but a warning, see ISO 7816, part 4, section 5.6. Warnings are less severe and still keep their response data (which are discarded for errors).

There 61xx is one of the easiest status codes (beyond 90 00), because the reaction is simple and clear: send a Get Response command with P3/LE set to the number indicated in SW2 (the xx part of 61xx). The main reason for the status is, that T=0 protocol is unable to send arbitrary many bytes (so it just sends 61xx) or more than 256 bytes in a response (in which case it sends the first chunk and an indication of how many bytes follow-up; if more than 255, only 255 can be shown and repeated Get Response commands are required getting the remaining chunks).