?? iso-iec 7816-4 (first edition 1995-09-01).htm
字號:
This part of ISO/IEC 7816 supports the following two categories of files :<UL><LI>Dedicated file (DF)</LI><LI>Elementary file (EF)</LI></UL><P>The logical organization of data in a card consists of following structural hierachy of dedicated files :<UL><LI>The DF at the root is called the master file (MF). The MF is mandatory.</LI><LI>The other DFs are optional.</LI></UL><P>The following two types of EFs are defined :<UL><LI>Internal EF - Those EFs are intended for storing data interpreted by the card, i.e. data analyzed and used by the card formanagement and control purposes.</LI><LI>Working EF - Those EFs are intended for storing data not interpreted by the card, i.e. data to be used by the outsideworld exclusively.</LI></UL>Figure 1 illustrates an example of the logical file organization in a card.<BR><H6><A NAME="figure1">Figure 1 - Logical file organization (example)</A></H6><TABLE BORDER=1><TR><TD></TD></TR></TABLE><P><H5><A NAME="ss5_1_2">5.1.2 File referencing methods</A></H5><P>When a file cannot be implicitly selected, it shall be possible to select it by at least one of the following methods :<UL><LI>Referencing by file identifier - Any file may be referenced by a file identifier coded on 2 bytes. If the MF referencedby a file identifier, '3F00' shall be used (reserved value). The value 'FFFF' is reserved for future use. The value '3FFF' isreserved (see referencing by path). In order to select unambiguously any file by its identifier, all EFs and DFs immediatelyunder a given DF shall have different file identifiers.</LI><LI>Referencing by path - Any file may be referenced by a path (concatentation of file identifiers). The path begins with theidentifier of the MF or of the current DF and ends with the identifier of the file itself. Between those two identifiers, thepath consists of the identifiers of the successive parent DFs if any. The order of the file identifiers is always in thedirection parent to child. If the identifier of the current DF is not known, the value '3FFF' (reserved value) can be used atthe beginning of the path. The path allows an unambiguous selection af any file from the MF or from the current DF.</LI><LI>Referencing by short EF identifier - Any EF may be referenced by a short EF identifier coded on 5 bits valued in the rangefrom 1 to 30. The value '0' used as a short EF identifier references the currently selected EF. Short EF identifiers connot beused in a path or as a file identifier (e.g. in a <A HREF="iso7816_4.html#ss6_11">SELECT FILE command</A>).</LI><LI>Referencing by DF name - Any DF may be referenced by a DF name coded on 1 to 16 bytes. In order to select unambiguously by DFname (e.g. when selecting by means of application identifiers as define in part 5 of ISO/IES 7816), each DF name shall be uniquewithin a given card.</LI></UL><H5><A NAME="ss5_1_3">5.1.3 Elementary file structures</A></H5><P>The following structures of EFs are defined :<UL><LI>Transparent structure - The EF is seen at the interface as a sequence of data units.</LI><LI>Record structure - The EF is seen at the interface as a sequence of individually identifiable records.</LI></UL><P>The following attributes are defined for EFs structured in records :<UL><LI>Size of the records: either fixed or variable</LI><LI>Organization of the records: either as a sequence (linear structure) or as a ring (cyclic structure).</LI></UL><P>The card shall support at least one of the following four methods for structuring EFs :<UL><LI>Transparent EF.</LI><LI>Linear EF with record of fixed size.</LI><LI>Linear file with records of variable size.</LI><LI>Cyclic EF with records of fixed size.</LI></UL>Figure 2 shows those for EF structures.<H1>F I G U R E 2</H1><H6>Figure 2 - EF structures</H6>NOTE - The arrow on the figure references the most recently written record.<P><H5><A NAME="ss5_1_4">5.1.4 Data referencing mehods</A></H5>Data may be referenced as records, as data units or as data objects. Data is considered to be stored in a singlecontinuous sequence of records (within an EF of record structure) or of data units (within an EF of transparentstructure). Reference to a record or to a data unit outside an EF is an error.<BR>Data referencing method, record numbering method and data unit size are EF-dependent features. The card can provideindications in the ATR, in the ATR file and in any file control information. When the card provides indications inseveral places, the indication valid for a given EF is the closest one to that EF within the path from the MF to thatEF.<H5><A NAME="ss5_1_4_1">5.1.4.1 Record referencing</A></H5>Within each EF of record structure, each record can be referenced by a record identifier and/or by a record number.Record identifiers and record numbers are unsigned 8-bit integers with values in the range from '01' to 'FE'. The value'00' is reserved for special purposes. The value 'FF' is RFU.<BR>Referencing by record identifier shall induce the management of a record pointer. A reset of the card, a SELECT FILE andany command carrying a valid short EF identifier can affect the record pointer. Referencing by record number shall notaffect the record pointer.<P><B>Referencing by record identifier</B> - Each record identifier is provided by an application. If a record is aSIMPLE-TLV data object in the data field for a message (see 5.4.4), then the record identifier is the first byte of thedata object. Within an EF of record structure, records may have the same record identifier, in which case data containedin the records may be used for discriminating between them.<BR>Each time a reference is made with a record identifier, an indication shall specify the logical position of the targetrecord the first or last occurrence, the next or previous occurrence relative to the record pointer :<UL><LI>Within each EF of linear structure, the logical positions shall be sequentially assigned when writing or appendingi.e. in the order of creation. Therefore the first created record is in the first logical position.</LI><LI>Within each EF of cyclic structure, the logical positions shall be sequentially assigned in the opposite order,i.e. the most recently created record is in the first logical position.</LI></UL>Each time a reference is made with a record identifier, an indication shall specify the logical position of the targetrecord the first or last occurrence, the next or previous occurrence relative to the record pointer :<UL><LI>Within each EF of linear structure, the logical positions shall be sequentially assigned when writing or appendingi.e. in the order of creation. Therefore the first created record is in the first logical position.</LI><LI>Within each EF of cyclic structure, the logical positions shall be sequentially assigned in the opposite order,i.e. the most recently created record is in the first logical position.</LI></UL>The following additional rules are defined for linear structures and for cyclic structures :<UL><LI>The first occurrence shall be the record with the specified identifier and in the first logical position; the lastoccurrence shall be the record with the specified identifier and in the last logical position.</LI><LI>When there is no current record, the next occurrence shall be equivalent to the first occurrence. The previousoccurrence shall be equvalent to the last occurrence.</LI><LI>When there is a current record, the next occurrence shall be the closest record with the specified identifier butin a greater logical position than the current record. The previous occurrence shall be the closest record with the specifiedidentifier but in a smaller logical position than the current record.</LI><LI>The value '00' shall refer to the first, last, next and previous record in the numbering sequence, independently fromthe record identifier.</UL><B>Referencing by record number</B> - Within each EF of record structure, the record numbers are unique and sequential :<UL><LI>Within each EF of linear structure, the record numbers shall be sequentially assigned when writing or appending, i.e. inthe order of creation. Therefore the first record (record number one, #1) is the first created record.</LI><LI>Within each EF of cyclic structure, the record numbers shall be sequentially assigned in the opposite order, i.e. thefirst record (record number one, #1) is the most recently created record.</LI></UL><UL>The following additional rule is defined for linear structures and for cyclic structures :<LI>The value '00' shall refer to the current record, i.e. that record fixed by the record pointer.</LI></UL><P><H5><A NAME="iso7816_4.html#ss5_1_4_2">5.1.4.2 Data unit referencing</A></H6><P>Within each EF of transparent structure, each data unit can be referenced by an offset (e.g. in <A HREF="iso7816_4.html#ss6_1">READ BINARY command</A>). It is anunsigned integer, limited to either 8 or 15 bits according to an option in the respective command. Valued to 0 for the first dataunit of the EF, the offeset is incremented by 1 for every subsequent data unit.<BR>By default, i.e. if the card gives no indication, the size of the date unit is one byte.<P><B>NOTES</B><OL><LI>An EF of record structure may support data unit referencing and in case it does, data units may contain structural information along with data, e.g.record numbers in a linear structure.</LI><LI>Within an EF of record structure, data unit referencing may not provide the intended result because the storage order of the records in the EF is notknown, e.g. storage order in a cyclic structure.</LI></OL><P><H5><A NAME="ss5_1_4_3">5.1.4.3 Data object referencing</A></H5>Each data object (as defined in 5.4.4) is headed by a tag which references it.Tags are specified in this part and other parts of ISO/IEC 7816.<P><H5><A NAME="ss5_1_5">5.1.5 File control information</A></H5><P>The file control information (FCI) is the string of data bytes available inresponse to a <A HREF="iso7816_4.html#ss6_11">SELECT FILE command</A>. The file control information may be presentfor any file.<A HREF="iso7816_4.html#table1">Table 1</A> introduces 3 templates intended for conveying file control information when coded as BER-TLV data objects.<UL><LI>The FCP template is intended for conveying file control parameters (FCP),i.e. any BER-TLV data objects defined in <A HREF="iso7816_4.html#table2">table 2</A>.</LI><LI>The FMD template is intended for conveying file management data (FMD),i.e. BER-TLV data objects specified in other clauses of this part or in otherparts of ISO/IEC 7816 (e.g., application label as defined in part 5 andapplication expiration data as defined in part 6).</LI><LI>The FCI template is intended for conveying file control parameters andfile management data.</LI></UL><TABLE BORDER=1><TR><TH>Tag</TH><TH>Values</TH></TR><TR><TD>'62'</TD><TD>File control parameters (FCP template)</TD></TR><TR><TD>'64'</TD><TD>File management data (FMD template)</TD></TR><TR><TD>'6F'</TD><TD>File control information (FCI template)</TD></TR></TABLE><H6><A NAME="table1">Table 1 - Template relevant to FCI</A></H6>The 3 templates may be retrieved according to selection options of the<A HREF="iso7816_4.html#ss6_11">SELECT FILE command</A>. If the FCP or FMD option is set, then the use of thecorresponding template is mandatory. If the FCI option is set then the use ofthe FCI template is optional.<P>Part of the file control information may additionally be present in a workingEF under control of an application and referenced under tag '87'. The use ofthe FCP or FCI template is mandatory for the coding of file controlinformation in such an EF.<P>File control information not coded according to this part of ISO/IEC 7816 may be introduced as follows :<UL><LI>'00' or any value higher then '9F' - The coding of the subsequent string of bytes is proprietary.</LI><LI>Tag='53' - The value field of the data object consists of discretionary data not coded in TLV.</LI><LI>Tag='73' - The value field of the data object consists of dicretionary BER-TLV data object.</LI></UL><H6><A NAME="table2">Table 2 - File control parameters</A></H6><TABLE BORDER=1><TR><TH>Tag</TH><TH>L</TH><TH>Value</TH><TH>Applies to</TH></TR><TR><TD>'80'</TD><TD>2</TD><TD>Number of data bytes in the file, excluding structural information.</TD><TD>Transparent EFs</TD></TR><TR><TD>'81'</TD><TD>2</TD><TD>Number of data bytes in the file, including structural information if any</TD><TD>Any file</TD></TR><TR><TD>'82'</TD><TD>1</TD><TD>File descriptor byte (see <A HREF="iso7816_4.html#table3">table 3</A>)</TD><TD>Any file</TD></TR><TR><TD>'82'</TD><TD>2</TD><TD>File descriptor byte followed by data coding byte (see <A HREF="iso7816_4.html#table86">table 86</A>)</TD><TD>Any file</TD></TR><TR><TD>'82'</TD><TD>3 or 4</TD><TD>File descriptor byte followed by data coding byte and maximum record length.</TD><TD>EFs with record structure</TD></TR><TR><TD>'83'</TD><TD>2</TD><TD>File identifier</TD><TD>Any file</TD></TR><TR><TD>'84'</TD><TD>1 to 16</TD><TD>DF name</TD><TD>DFs</TD></TR><TR><TD>'85'</TD><TD>var.</TD><TD>Proprietary information</TD><TD>Any file</TD></TR><TR><TD>'86'</TD><TD>var.</TD><TD>Security attributes (coding outside the scope of this part of ISO/IEC 7816)</TD><TD>Any file</TD></TR><TR><TD>'87'</TD><TD>2</TD><TD>Identifier of an EF containing an extension of the FCI</TD><TD>Any file</TD></TR><TR><TD>'88' to '9E'</TD><TD></TD><TD>RFU</TD><TD></TD></TR><TR><TD>'9FXY'</TD><TD></TD><TD>RFU</TD><TD></TD></TR></TABLE><H6><A NAME="table3">Table 3 - File descriptor bytey</A></H6><TABLE BORDER=1><TR><TH>b8 b7 b6 b5 b4 b3 b2 b1</TH><TH>Meaning</TH></TR><TR><TD> 0 x -- -- -- -- -- --</TD><TD>File accessibility</TD></TR><TR><TD> 0 0 -- -- -- -- -- --</TD><TD>Not shareable file</TD></TR><TR><TD> 0 1 -- -- -- -- -- --</TD><TD>Shareable file</TD></TR><TR><TD> 0 -- x x x -- -- --</TD><TD>File type</TD></TR><TR><TD> 0 -- 0 0 0 -- -- --</TD><TD>Working EF</TD></TR><TR><TD> 0 -- 0 0 1 -- -- --</TD><TD>Internal EF</TD></TR><TR><TD> 0 -- 0 1 0 -- -- --</TD><TD>Reserved</TD></TR><TR><TD> 0 -- 0 1 1 -- -- --</TD><TD>for</TD></TR><TR><TD> 0 -- 1 0 0 -- -- --</TD><TD>proprietary</TD></TR><TR><TD> 0 -- 1 0 1 -- -- --</TD><TD>types</TD></TR><TR><TD> 0 -- 1 1 0 -- -- --</TD><TD>of EFs</TD></TR><TR><TD> 0 -- 1 1 1 -- -- --</TD><TD>DF</TD></TR><TR><TD> 0 -- -- -- -- x x x</TD><TD>EF structure</TD></TR><TR><TD> 0 -- -- -- -- 0 0 0</TD><TD>No information given</TD></TR><TR><TD> 0 -- -- -- -- 0 0 1</TD><TD>Transparent</TD></TR><TR><TD> 0 -- -- -- -- 0 1 0</TD><TD>Linear fixed, no further info</TD></TR><TR><TD> 0 -- -- -- -- 0 1 1</TD><TD>Linear fixed SIMPLE-TLV</TD></TR><TR><TD> 0 -- -- -- -- 1 0 0</TD><TD>Linear variable, no further info</TD></TR><TR><TD> 0 -- -- -- -- 1 0 1</TD><TD>Linear variable SIMPLE-TLV</TD></TR><TR><TD> 0 -- -- -- -- 1 1 0</TD><TD>Cyclic, no further info</TD></TR><TR><TD> 0 -- -- -- -- 1 1 1</TD><TD>Cyclic, SIMPLE-TLV</TD></TR><TR><TD> 1 x x x x x x x</TD><TD>RFU</TD></TR></TABLE>Shareable means that the file supports at least concurrent access on different logical channels.<P>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -