Search code examples
appletnfcsmartcardjavacardapdu

Smart cards data contents


I want to communicate with a smart card by MCU, my MCU supports ISO7816 protocol and as I know I must use APDU commands which are specified in ISO7816-4 protocol.

With a glimpse to APDU instructions there are some idioms I'm not familiar with. For example in reading/writing a "File", what does the word "File" refer to?

In the Mifare classic 1K memory divided based on the this picture & there is a simple sequence to read/write each section.

Is there any equivalent information about data structure of contact smart cards? How is data stored? How can we access/read/write these structures? Is there any specific document focused in this subject?

EDIT: In the card's file management system,is file's size constant or it can be variable depend on files data?


Solution

  • for examples in reading/writing File ,File word refer to what?
    

    File - A logical view of memory. ISO/IEC 7816 -4 tells about file system, can read something Here

    Some specific cards like Mifare [Memory card][no file concept, data stored block wise] is ready by specific commands like - load key, authenticate_with_card, Read_block. these commands are well defined by IFD.

    Ex - if you want to read Mifare card and you are using SCM reader, this document will help you to perform Read / Write operation.

     Is there any equivalent information about data structure of contact smart cards ? how data stored?
    

    ISO 7816 tells about file structure of the card but all contact smart card does not follow it. sometimes programming is like -you just read the data from the card with sending APDU and you will get the data as a response.

    and same way you can send data with Lc byte of apdu and it will store in the card.

    To reading data from the card , it would be good to know about the card, get the specification from card vendor. That would help to explore the card.

    Hope this information will help.

    [update]

    I searched local market & I found: 1-ACOS series from advanced cards systems 2- jcop from mifare 3- gemalto products. I think number 2 and 3 are kind of java cards,am i true?
    

    JCOP [tool] is a java card tool that helps to code / debug/install applet of java card. I used Jcop plugin with eclipse IDE to develop java card applet. it is very good plugin,

    Mifare is not java card , its a memory card and Gemalto have different products, how can you say that all are java card. Do some more resarch please.