Welcome to Shenzhen Hua Sentong Intelligent Technology Co.,Ltd.

EnglishChinese

深圳市华森通智能科技有限公司

华森通

Service Hotline:+86-755-29177788

News

In-depth understanding of the file smart card,DF/EF/MF/FID/AID/SFI

Edit:adminTime:2018-10-26 Click:1843SmallMiddleBig

 When you first came into contact with a CPU card, the definitions of various files and applications were easily blurred. It is usually impossible to accurately define what is a file? What is an application? Is the difference between DF and EF really like the directories and documents in the computer?

When you first came into contact with a CPU card, the definitions of various files and applications were easily blurred. It is usually impossible to accurately define what is a file? What is an application? Is the difference between DF and EF really like the directories and documents in the computer? When do the concepts of FID, AID, and SFI come in handy? Should an EF depend on a certain DF? Does MF have to exist? There are countless question marks coming from my mind.

In fact, the essence of a file is a set of data. The operation (selection, reading, writing/updating) of the data is done by operating the APDU command with a specific file. So the data is true, the file is just the appearance. The kind of file that a certain set of data should be used for external access is determined by the COS of the card.

According to the specification, DF refers to the abbreviation of Dedicated File, the role of DF can be equivalent to the directory file in the computer, and EF is the basic information file Elementary File, which means that the data related to the application will be stored in the normal situation. In EF.

In order to access a file, you need to assign a specific identifier to the file. Both DF and EF will have a corresponding two-byte long ID identifier, also known as FID. DF will also have a 5-16 byte long name, also known as AID. EF also has a short file identifier of 5 digits (ranging from 1 to 30), which is SFI. According to the definition of the 7816 specification, and the definitions of some industry application specifications derived from 7816 are basically the same. Whether it is FID or AID and SFI, in the range of paths that can be selected (this sentence may be slightly rounded, and naturally understand after the experience), the values of different files (including DF and EF) cannot be the same.

In a card (here a card instead of an application) there is only one special DF, called the main file MF, the default FID of this MF is 3F00, which is equivalent to the root directory of the computer, and MF can be selected at any time. If there is no child DF under a certain DF, only a few EFs, then this DF is also called ADF. If there is a child DF in addition to EF in a certain DF, then the parent DF is also called DDF. .

In the use of the card, there is only one "selection" for the operation of the DF, but for the operation of the EF, there are three forms of selection, reading and writing.

During the file selection operation, the selection of the DF can be implemented by FID or AID, and the selection of EF is only the mode of FID. The files that can be selected (whether DF or EF) must be within the visible path range (this sentence is also a bit around).

As for the reading and writing of the EF file, it can be directly performed by SFI. It is also possible to select an EF by FID first, and then read and write.

One point to be particularly emphasized: These are all related to some application specifications, and are also closely related to the implementation of COS. In other words, if you write a COS that meets a particular application, you can do it as you wish. For example, the FID of the MF is defined as 8F00. For example, the EF can also increase the AID. For example, the card can select the DF of each level and its subordinate EF at any time, and the like. . . . . .


2018-10-26 1843