Page 1 of 1

How can I select and read EF and DF data?

Posted: Fri Dec 18, 2015 3:01 am
by Wardor
I would like to create EF and DF with some data and store it in smart card.
Then I would write an applet to read these data. Is it possible? If I can do this, how can I select and read EF and DF data?

Re: How can I select and read EF and DF data?

Posted: Mon Dec 21, 2015 1:22 am
by horse dream
You have to implement a proprietary version of CREATE FILE and the ISO versions of READ BINARY and UPDATE BINARY yourself.

Usually the files consist of an (object containing a) Java Card byte array in EEPROM (just new byte[size]) for the file and meta information - maybe also in a byte[]) such as read/write access conditions.

A DF may consist of EF's, objects such as keys, PIN's, access conditions. The applet itself is a named DF, but you can create a specific CREATE FILE for creating DF's. You would of course have to support the DF selection as well within SELECT by ID.

Re: How can I select and read EF and DF data?

Posted: Mon Dec 21, 2015 4:18 am
by UNKNwYSHSA
You can look specification ISO7816-4 for more details.
Select DF/EF: the SELECT command;
Read/Write EF: READ BINARY/WRITE/UPDATE BINARY command.