Search code examples
smartcardiso-7816-4scosta

Error when creating an EF under MF on smart card


I am new to ISO 7816 smart card programming. I am trying to create an EF under the MF. I can succesfully select the MF but there is an error creating the EF. These are the APDUs and responses.

enter image description here

00 A4 00 00 02 3F 00 is for selecting the MF and 00 E0 00 00 09 62 07 82 01 01 83 02 3F 01 is for creating an EF. The latter command is returning the error 6A 80 : Wrong parameter(s) P1-P2. Incorrect parameters in the data field. I cannot figure out what is the error in the data field.


Solution

  • From a short glance to my ancient comand table, you seem to have not specified, how big you want the created file to be, which for a transparent file needs to be specified in DO with tag 80.

    Note, that smart cards typically are restricted to a very basic memory management, so you have to allocate the corresponding space for the EF at creation time.