Question

I have bunch of records in my offcard application and I want to save them all in javacard, The question is:

  • What is the best way of transferring data to Java Card?
  • Should I transfer all data record by record (each one with a APDU) or send all the records in just one APDU?

Of course I know the limitation size of APDU and I'm using extended APDU in order to send all data just in one extended APDU which is more than 255 bytes..

Was it helpful?

Solution

It does not matter much if you send your data in one extended length APDU or one single APDU security wise. It is however much better to send unrelated information using separate APDU's. This would make your application much more modular. Note that if you send related information using separate APDU's, you may need to keep state between those APDU's for validation purposes (e.g. you may have to send either none or all of them, or send the APDU's in specific order).

Furthermore, ISO 7816-4 only defines 2 byte status words to send back to the sender, e.g. 8A80 to indicate any error in the command data. This means that it is impossible to tell from the status word which of the records contains failure information.

Finally, there are certainly still readers and software out there that have issues handling extended length APDU's. So if your software is going to be used by other parties you may want to stick to normal length APDU's.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top