Strange error on Java card
861090Jun 7 2011 — edited Jun 8 2011Hi,
I am getting quite a ridiculous problem in Java card. Please note, that the code works perfectly fine in the JC 2.1.1 emulator. The same code is giving a funny response on the actual Java card:
The problem is like this:
I have to return data in multiple APDU's to the host as the entire data won't fit in one APDU.
All APDU's except the last (and therefore signalling complete data transfer) send a warning message of SW1:63 SW2:51
using the ISOException.throwIt(....), signalling to the host that there is more data on the way.
However, while executing on the Smart card, only SW1 and SW2 show up. There is no data.
After breaking my head for a long time on this, I finally removed the throwit part so that all APDU's returned 9000. In this case, the data was being shown.
Is it that there are some error codes that cause the entire data packet to be thrown off?? Can I use some warning codes that do not cause this to happen?
If anyone knows of this, please help.
I am using GPshell to send APDU's to the card. I do not know if there is any other way to send APDU's to the card.
Also, please, anyone who knows of a good accurate emulator for Javacard, please let me know.
If one has to spend countless hours figuring out what went wrong with code that otherwise worked perfectly on the emulator, one might as well throw out the emulator and test directly on the card.
Thanks a lot for any help, pointers.
Cheers.