Social Security Series 2-File System

Source: Internet
Author: User

Cards allow you to create your own file system in the available space. Supports multi-level directory structure. Files in the same-layer directory cannot have the same ID (identifier ).

 

Data elements in a data file are stored in record or binary format. The file structure and reference mode are determined by the purpose of the file. In addition to directory files, the content and layout of data files are described in section 6th of the Social Security (individual) card specification: Application Data Structure, which can also be supplemented and defined by the issuer.

 

1. Three types of special files (DF:

? Mf: root directory, which is the root of the entire file system and belongs to the application environment. EF (basic file), SF (security file), DDF (directory file), and ADF (application file) can be used in MF );

? DDF: A directory file used to define an application environment. It is a collection of applications. DDF can have the following structures: ADF, subddf, EF, SF, public key file, and private key file.

? ADF: application file, used to define a specific application. You can have EF, SF, public key, and private key files under the ADF.


An AEF contains one or more raw BER-TLV Data Objects (AEF in the record structure), or an unstructured pure data element (AEF in a transparent structure ). After an application is selected, AEF can query both by its file identifier and its short File Identifier (SFI. The AEF of the record structure has the following attributes: The record length is fixed or variable; the record organization structure is linear or cyclic.

 

Four basic file (EF) types:

? Transparent file: The file data is accessed through the byte address in the continuous space.

? Record File: The data is recorded in a fixed-length format. The file can contain up to 255 records. For plaintext access, the maximum record length can be 255 bytes. The record file has the following forms:

1) linear fixed length record file: all records in the same file are of the same length.

2) Linear Variable Length record file: the length of each record in the same file can be unequal.

3)Cyclic fixed-length record file: all records in the same file are of the same length. Supports circular access to records in files.

 

? Transaction file: This type of file is a file in a specific format. Use transaction commands to operate such files. Transaction files can be in the following forms:

1) Personal account file: complete account transfer and medical consumption transactions. The user password must be submitted before the account is transferred into the transaction. Applicable to the social security environment.

2) Electronic passbook: complete the deposit and consumption transactions. The user password must be submitted before the transaction command is executed. Applicable to financial environments.

3) E-Wallet files: complete storage and consumption transactions. The user password must be submitted before the deposit transaction is executed. Applicable to financial environments.

 

? Security file type (SF ):

1)Security File: This file can only be written and cannot be read. The key or password can be stored in the file.

 

 

2. file query

According to its type, files can be queried by file name, File Identifier, or SFI.

1) file name query: Any ADF or DDF in the card can be queried by its DF name. The DF name of the ADF corresponds to its aid, and each DF name should be unique in the given card.

 

2) File Identifier query: Any ADF, DDF, or AEF in the card can be queried by its File Identifier. The file identifier of each DF should be unique in a given card, the file identifier of AEF must be unique in a given application.

 

3) SFI query: SFI is used to select AEF. For any AEF in a given application, you can use SFI (5-bit code, the value range is from 1 ~ 30) query. SFI encoding is described in each command that uses it. SFI should be unique in a given application. The use of dedicated SFI is determined by the application.

 

 

3. Directory files

The directory file of the social security system is a linear file identified by a 5 to 15 short File Identifier (SFI. This directory file is attached to DDF, and SFI of the directory file is included in DDF file control information. You can use the "readrecord" command to read directory files. A record in a directory file can contain several entry addresses, but one entry address cannot be stored across multiple records. Each entry address of the social security system directory file is an Application Template (61 tags ).

 

In the IC card, other directories outside the social security system are optional and do not limit the number of their existence. The location of each directory is specified by the SFI data object in the FCI Directory included in each DDF. If no directory file exists, it is deemed that the Social Security card contains all the applications defined in the Social Security (personal) card specification.

 

 

The DDF directory entry address format is as follows:

Flag

Length

Value

Status

'4f'

5-16

DDF name

M

 

 

The format of the entry address of the ADF directory is as follows:

Flag

Length

Value

Status

'4f'

5-16

ADF name (AID)

M

'50'

1-16

Application tag

M

 

 

 

The terminal can determine the applications supported by the card by using the social security environment directory file. The steps for the terminal to correctly use the social security directory file are as follows:

 

1) After the terminal enters the Social Security system environment, if the directory file does not exist, go to step 5); If the directory file exists, go to the directory file.

2) The terminal starts from the first record and continuously reads all records in the directory until the card returns '6a83 ', indicating that the sequence number of the required record does not exist. When you run the "read record" command to find the first record, if the card returns SW1 sw2 = '6a83 ', it indicates that the directory is empty, go to step 5 ).

3) if the directory contains an application name that is supported by the terminal, the application will be included in the "Candidate List" selected by the final application.

4) if the directory contains an entry address pointing to DDF, And the DDF name matches at least the first few digits of the aid supported by the terminal (for example: DDF named d156123456 can match d15612345678), then the terminal selects the DDF. Use the directory short File Identifier (SFI) in the selected DDF file control information (FCI) to read the Directory and process it in step 3. Then, the terminal proceeds back to the previous directory for processing.

5) after the terminal completes the list of the Environment directories of the social security system, all the ADF files that can be found in this way are determined and the search is complete.

6) terminals can also use other methods to find other dedicated applications in the card (for example, using aid to find out the dedicated selection methods for local-specific or non-social security applications), but they are not within the scope of this provision.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.