COS Overview As IC cards evolved from simple synchronous cards to asynchronous cards, from simple EPROM cards to smart cards with internal microprocessors (also known as CPU cards), various requirements for IC cards are increasing. The various management tasks required by the card itself are becoming more and more complicated, so there is an urgent need for a tool to solve this contradiction, and the internal microprocessor
The emergence of smart cards has made the realization of this tool a reality. Using its internal microprocessor chip, people have developed a variety of operating systems for use inside smart cards, namely the COS that will be discussed in this section. The emergence of COs not only greatly improved the interactive interface of the smart card, but also made the management of the smart card easy; more importantly, it made the smart card itself a big step towards the personal computerization, and opened up the development of the smart card. Extremely broad prospects.
The full name of COS is the Chip Operating System, which is generally developed around the characteristics of the smart cards it serves. Because it is inevitably affected by the performance and memory capacity of the microprocessor chip in the smart card, COS is largely different from the operating system (such as DOS, UNIX, etc.) on the microcomputer we usually see. First, COS is a dedicated system rather than a general purpose system. That is: a COS can only be applied to a specific (or some) smart card, and the COSs in different cards are generally different. Because coS is generally designed and developed according to the characteristics of a smart card and its application range, although most of them may follow the same international standard in the actual functions. Second, compared to the operating systems on the common microcomputers, COS is essentially closer to the monitoring program than to a so-called true operating system, which is still at least for the time being. Because at the current stage, COS needs to solve the problem of how to handle and respond to external commands. This generally does not involve sharing and concurrent management and processing, and it is blind to the current application of smart cards. Concurrency and sharing work is really not required.
COS is generally designed and developed in accordance with the functions specified in the international standard (ISO / IEC 7816 series standards). However, due to the rapid development of smart cards and the relatively long period of development of international standards, the current international standards for smart cards are still not perfect. According to this, many manufacturers have their own COS for their own development. Some extensions. For the time being, no company's CoS products have formed an industry standard. Therefore, this chapter will mainly focus on the existing (before 1994) international standards, focusing on the basic principles and basic functions of CO5, and appropriately enumerate their implementation in some products as an example.
The main function of COs is to control the exchange of information between the smart card and the outside world, manage the memory in the smart card and complete the processing of various commands inside the card. Among them, the exchange of information with the outside world is the most basic requirement of coS. In the exchange process, the information exchange protocol followed by COS currently includes two types: T=0 protocol for asynchronous character transmission and T=l protocol for asynchronous packet transmission. The specific content and implementation mechanism of these two information exchange protocols are specified in ISO/IEC7816-3 and ISO/IEC7816-3A3 standards; and the basic functions of management and control that COS should perform are in ISO/IEC7816— 4 standards are specified. In this international standard, the data structure of the smart card and the basic command set of the COS are also described in more detail.
As for ISO/IEC 7816-1 and 2, the physical parameters and physical dimensions of the smart card are specified, and their relationship with COS is not very close.
The architecture of COS relies on the hardware environment of the smart card described in the previous section, and a variety of cos can be designed. However, all COS must be able to solve at least three problems: file operation, authentication and verification, and security mechanisms. In fact, authentication and verification and security mechanisms are among the security system's security systems. Therefore, the most important two aspects of smart card coS are file and security. But after a specific analysis, we can actually divide the complete process from the command of the read/write device (ie interface device IFD) to the response given by the card into four phases, or four functional modules: Manager (TM), Security Manager (SM), Application Manager (AM), and File Manager (FM). Among them, the transfer manager is used to check whether the information is correctly transmitted.
This part is mainly related to the communication protocol adopted by the smart card; the security manager mainly checks or processes the transmitted information to prevent illegal eavesdropping or intrusion; the application manager is used to judge the execution of the received command. Possibility; the file manager finally completes the processing of the command by verifying the operational authority of the command. For a specific COS command, these four stages are not necessarily required, some stages can be omitted, or another stage of the joint; but in general, the COS with these four stages is a comparison Common. Below we will discuss COS in more detail in these four stages.
It should be noted here that the "file" concept in smart cards is different from what we usually call "files". Although the files stored in the smart card are also data units or records, they are all directly related to the specific application of the smart card.
In general, a specific application necessarily corresponds to a file in the smart card, and therefore, the file in the smart card does not have the so-called file sharing. Moreover, such documents must not only be logically complete but also contiguous in physical organization. In addition, although the file in the smart card can also have the file name (FileN8me), the file identification depends on the file identifier (F3te ldentifier) ​​corresponding to the file in the card, not the file name. Because the file name in the smart card is allowed to be repeated, it is essentially a mnemonic of the file and does not fully represent the file.
Delivery management
(Transmission Manaeer)
The transmission management mainly receives the commands issued by the reading and writing device according to the information transmission protocol used by the smart card. At the same time, the response to the command is sent in the format of the transmission protocol. It can be seen that this part is mainly related to the communication protocol specifically used by the smart card; moreover, the more complicated the communication protocol used, the more difficult and complicated the implementation of this part is.
We mentioned earlier that the information transmission protocol used by smart cards is generally T=0 protocol and T=1 protocol. If there are any differences in the implementation functions of COS between these two types of protocols, it is mainly implemented in the delivery manager. There are differences. However, whether using the T=0 protocol or the T=1 protocol, the smart card uses the asynchronous communication mode in the information exchange; and since the smart card has only one data port, the information exchange can only adopt the half-duplex mode. That is, at any one time, only one party (smart card or read/write device) on the data port can send data. The difference between the T=0 and T=1 protocols is that the units and formats of their data transmission are different. The T=0 is a single-byte character as the basic unit, and the T=1 protocol is a data block with a certain length. The basic unit for transmission.
The transfer manager also determines the correctness of the command reception while receiving the command. This kind of judgment is only for the prediction of errors that may occur during the transmission process, and does not involve the specific content of the command, so it is usually implemented by means such as parity, checksum and the like. For the packet transmission protocol, it can also be realized by judging whether the packet length is correct or not.
When it is found that the command is received incorrectly, different information exchange protocols may have different processing methods: some protocols report to the read/write device immediately, and request retransmission of the original data; others simply do the response command. A tag, which is not processed by itself, is left to react to the functional modules behind it. These are all stipulated by the exchange agreement itself.
If the delivery manager believes that the receipt of the command is correct, then it generally only passes the information part of the received command to the next-function module, ie the security manager, and filters out such as the start bit and the stop bit. Additional information about the class. Accordingly, when the transfer manager sends a response to the read/write device, each of the transfer units should be supplemented with the necessary additional information specified in the information exchange protocol.
Security System (—SecvritySCructure)
The security system of the smart card is an extremely important part of the COs of the smart card. It involves the selection of the authentication and verification methods of the card, including the permission control mechanism of the COS when accessing the files in the card, and the confidentiality of the information in the card. mechanism. It can be considered that smart cards can develop rapidly and become popular. One of the important reasons is that it can provide users with a high security guarantee through the COS security system.
The security system conceptually includes three major parts: Security Status, Security Attributes, and Security achanisms. The security state refers to a state in which the smart card is currently located, which is obtained after the smart card performs a reset response or after it processes a certain command. In fact, we can fully assume that a smart card is always in one state or the like throughout the entire work process. The security state can usually be represented by a smart card in a set of currently satisfied conditions.
The security attribute actually defines some of the conditions required to execute a command, and the command can be executed only if the smart card satisfies these conditions. Therefore, if the current security state of the smart card is compared with the security attribute of an operation, it can be easily judged according to the result of the comparison whether a command is allowed to be executed in the current state, thereby achieving security control. the goal of. Associated with the security status and security attributes is the security mechanism. The security mechanism can be considered as the transfer method and means used to implement the transfer of the security state, and generally includes: password authentication, password authentication, data authentication, and data encryption. A security state can be transferred to another state by means of the above-mentioned means, and the state is compared with a certain security attribute. If it is consistent, it indicates that the command corresponding to the attribute can be executed, which is the COS security system. Basic working principle.
From the above description of the working principle of the coS security system, we can see that the implementation of the security mechanism is a very important aspect of the security system relative to the security attributes and security status. Without security mechanisms, COS cannot do anything. From the above introduction of the security mechanism, we can see that the COS security mechanism implements the following three functions: authentication and verification, data encryption and decryption, and file access security control. Therefore, we will introduce them separately below. Among them, regarding the security control of file access, because it is very close to the file manager, we put it into the file system for discussion.
(1) Identification and verification: Identification and verification are actually two different concepts, but because they are very similar in their functions, we also discuss them at the same time, which is also beneficial to grasp this in comparison. Two concepts.
Generally, the so-called authentication refers to the verification of the legality of a smart card (or a read/write device), that is, how to determine whether a smart card (or a read/write device) is not a forged card (or a read/write device). And verify refers to the verification of the legality of the holder of the smart card, that is, how to determine that a cardholder is legally authorized. It can be seen that both of them are a kind of verification of legality, which is very similar in terms of the functions they perform. However, in the specific implementation, the means used are different because of the different objects to be verified.
Specifically, in the implementation principle, the verification is achieved by the user presenting a password to the smart card that only the person knows, and the smart card judges the correctness of the pass. During the transmission of the password, sometimes the encryption/decryption operation can be performed on the information to be transmitted in order to ensure that the user is not eavesdropped. This process is also commonly referred to as password authentication.
The authentication is performed by both the smart card and the reading and writing device performing the same encryption operation on any of the same random numbers at the same time (the DES algorithm is currently commonly used), and then judging the consistency of the two operation results to achieve the verification date.
Depending on the object being identified, COS divides the authentication into two types: internal authentication (Interna1 Authentication) and external authentication (External Authentication). The "internal" and "external" mentioned here all use smart cards as reference points. Therefore, internal authentication is the verification of the legality of the smart card by the reading and writing device; external signing is the legality of the intelligent F to the reading and writing device. verification. As for their specific implementation. We have discussed it in detail in Chapter 5 and will not be repeated here.
The smart card can effectively prevent the use of the fake card and prevent the intrusion of the illegal user through the method of authentication and verification, but it cannot prevent the eavesdropping that may occur during the information exchange process. Therefore, it is important in the communication process between the card and the read-write device. Encryption of data is presented as an effective means of anti-eavesdropping. In the following, only the important part of the encryption, the management and storage principle of the password in the COS, will be explained.
(2) Password management: Currently, the data encryption algorithm commonly used in smart cards is the DES algorithm. The reason for adopting the DES algorithm is that the algorithm has proved to be a very successful encryption algorithm, and the computational complexity of the algorithm is relatively small, which is more suitable for the case where the computing power of the smart card is not very strong. The password (or key) length of the DES algorithm is 64 bits. COS organizes the passwords used in data encryption and stores them in the form of files, called password files. The simplest password file is a collection of records of length 8 bytes, each of which corresponds to a DES password; the record of a more complex password file may also contain various passwords corresponding to the record. Attributes and checksum information attached to ensure the integrity of each record.
The part of the record header stores the attribute information of the password, for example, a password that can be applied to all application files or a password that is only available for an application file; a password that can be modified or can only be read. However: no matter what kind of password file, as a file itself, COS guarantees the security of the password file through the security control mechanism for file access.
When a data encryption operation is required, the COS selects a password from the password file to join the operation. When reading a password from a password file, just like reading the application data, just give the address where the password is located. Of course, the simple way for a member to generate a password is to randomly read a password from the password file as an encryption password. However, such a mechanism may select the same password multiple times, thereby providing the eavesdropper with a chance to decipher, and the security is not too high. Therefore, it is better to do some processing on the password itself after randomly extracting a password, so as to minimize the chance of repeated occurrence. For example, in the PBOS product, the method used is to first perform a DES encryption operation on the password selected from the password file, and then use the operation result as a data encryption password. Its calculation formula is as follows:
Key = DES(CTC, K(a))
Where K is a password randomly selected from the password file; CTC is a counter that records the number of transactions of the smart card, and the counter is incremented by one for each transaction; the key is the password to be used for the data encryption operation. Using this method can improve the security of the smart card, but it reduces the efficiency of execution. Therefore, the specific method used to generate the password should be determined according to the application scope and security requirements of the smart card.
Application manager/file manager
(Application Manager/File Manager)
Application manager
The main task of the application manager is to judge the enforceability of commands received by the smart card. As for how to judge the enforceability of a command, we have already explained it in the security system section, so we can think that the implementation of the application manager is mainly the implementation of the security mechanism of the application software in the smart card. And because the various applications of the smart card exist in the form of files, the essence of the application manager is the security control problem that we will access the file in the next section. It is on this basis that we can also think of the application manager as part of the file manager.
Document management
Like security, files are an extremely important concept in COs. A file is an organized collection of records in a data unit or card. COS implements its storage and management of individual applications by creating a corresponding file for each application. Therefore, the application files stored in the COS are all preparation data or records related to the application. In addition, the CoS for some smart cards may also contain application control files that control the application files.
In COS, all files have a unique file identifier (File ldentifier), so the file identifier can be used to directly find the desired file. In addition, each file can have a file name as a mnemonic, which differs from the file identifier in that it is repeatable. Each file in the COS is created by the publisher (Issuer) according to the application of the card during the personalization of the smart card, and the user of the card cannot usually create or delete the file. However, the user can modify the contents of the file according to the situation, and can add or delete records or data units in the file.
(l) File system: COS files can be classified into three categories according to their logical hierarchy; Master File, Dedicated File, and EIementary File. Among them, the main file is indispensable for any COS. It is the only file containing file control information and allocatable storage area. Its function is equivalent to the root file of the COS file system, which is at the highest level of the COS file system; The file is also an indispensable part. It is the file that actually stores the data unit or record of the standby application. It is at the bottom of the file system, and the special file is optional. It stores the control information of the file. Data information such as the location and size of the file. We can use the tree structure of Figure 6.38 to visually describe the basic structure of a COS file system.
Of course, for a specific COS product, it is likely that the actual classification of the file will be different depending on the application. But as long as the analysis is carefully carried out, it can be attributed to the above three logical levels. For example, the PCOS products previously granted. Its classification of files is not based on logical hierarchy, but on the purpose of the document.
Its files are divided into three categories: COS file (COSFile), password file (KeyFile) and wallet file (PursesFile).
The so-called COS file stores basic application data; the password file stores the password used for data encryption; the role of the wallet file is somewhat similar to the wallet in our daily life. It can be seen that these three types of files are essentially the same as the basic file (EF) class. In PCOS, the concept of special files is not very obvious, but in fact, if you pay attention, then from the previous discussion, it should be easy to find the bundle of files in the FAT area of ​​the product memory partition; Similar to a dedicated file; the nature of the entire PCoS card itself is actually a master file.
The cos file has four logical structures: a transparent structure, a linear fixed length structure, a linear variable length structure, and a fixed length loop structure.
Their definitions and characteristics can be found in the relevant parts of the ISO/IEC7816-4 protocol, which will not be detailed here. but. Regardless of the logical structure taken, the files in cos are physically stored continuously in the memory of the smart card. The access mode of the data in the card, the numbering method of the record, the size of the data unit, and the like are featured as a file system, and are given by the card during the reset response of the smart card. In general, the most important data access method in a smart card is the random access method, that is, the user of the card can directly access a certain data unit or record in the file after being authorized. As for what kind of operation COS can do with the file. We will discuss this in the command system of C()3.
(2) File access security: Security control of file access is a very important part of the COS system. Since the current international standard (ISO/IEC7816-4) has basically no substantive provisions in this regard, The specific implementation methods of the existing file access security control mechanisms are various. We are here to introduce two representative implementations: the authentication register mode and the state machine mode. Among them, there are PCOS, ME2000 and other products that use the authentication and registration method: STARCOS is used in the state machine.
When the authentication register mode is used, an 8-bit (or 16-bit) long area is usually set in the memory RAM as an authentication register. Identification here refers to the identification of security control passwords. The identification register reflects the security state of the smart card. In this way, the header (or file descriptor) of each file of the smart card usually stores the conditions under which the file can be accessed, generally including two conditions of reading and writing, r, respectively. Cu indicates), which constitutes the security attribute of the file. The user enters a secure password by entering the smart card. It is possible to change the security state of the card. This process is often referred to as presentation. This is the security mechanism for the authentication register. By combining the above two aspects, it is possible to control the read and write permissions of the files in the card. The specific operating mechanism is described by taking PCOS as an example.
First, the authentication register in the PBOS is an 8-bit word length, and the s-bit dI is false; the bits are respectively in one-to-one correspondence with the serial numbers of the seven security codes in the secret area of ​​the PC()3 memory. The initial value of each bit in the register is set to "0". If the user presents a secure mom to the smart card and is judged to be correct by F, the system writes "1" to the corresponding bit in the authentication register.
For example, if the second security code in the secure zone is correctly presented by the user, PCOS writes "1" in the second bit of the register. At the same time, the read and write conditions in the file descriptor are stored in Cr and Cu as a number between 0 and 7. The value corresponding to the password required to be read (or written) by the file is kept secret. The small serial number of Yu District. Before reading (or writing) a file, the system first determines whether the Cr (or Cu) bit corresponding to the authentication register has been set to "1" (if Cr is equal to 0, the file can be The user reads it at will; the same for Cu), only when the bit is "1", it means that the read (or write) permission has been met. The file can be read (or written). That is to say, if the user wants to operate on a file, it is necessary to first present the security password corresponding to the security attribute of the file. The system thus achieves the purpose of security control of access to files.
In contrast to the authentication register method, the state machine mode more clearly shows the concept of extended security state, security attributes, and security mechanisms and the relationship between them (the knowledge about state machines is not within the scope of this book, interested readers) Please check the relevant information yourself). Taking 5TARCOS as an example, it uses a mechanism for determining the state machine, which is realized by the application control file (Applicatlon ControIFile, ACF) in the system. The format of the ACF file is already a linear variable length structure file, and its rh record 01 includes the command code (INS) of all commands that the application controlled by the ACP can allow; the remaining records are respectively associated with the instruction code in record 01. A correspondence, in which all stored variants (Varient) records of the government orders. The so-called variant record refers to such records. The record stores the control information, the initial state, the possible next state, and some additional instructions for the rich, and the state transition map can be formed by using these variant records in the ACF. In the variant record, the control information part is essential. Different variant records are mainly different in two aspects: one is that the state allowed by the command is different, and the part of the instruction information starting with the CLA unit is different. This is mainly determined by the difference in the application objects that the command is to operate on.
With ACF, the COS system can achieve secure control of file access. When the system receives a command from an application to operate, it first checks if its command code is in record 01 of the corresponding ACF file. If it is not there, the system considers the command to be wrong. After finding the corresponding instruction code, the system compares the remaining part of the command with the instruction information in the standby variant record corresponding to the command according to the requirements of the control information recorded by the variant. If the comparison result is consistent, then the check is changed. Initial status information in the volume record. If all of these tests pass successfully, the system enters the next state indicated in the corresponding variant record; otherwise, continues to find the next variant record until the corresponding variant is found or all variant records corresponding to the command are checked. . If the corresponding variant record is not found, the command is illegal; otherwise, the next step is to process the command, that is, the actual processing procedure is called by COS to execute the command processing. The system enters a new state if and only if the process ends normally, and begins to wait for the next command to be received.
Basic concept / main function
basic concept
Data Element
Meaningful information in an application sense or in an internal industrial environment.
Data Unit
A minimum set of binary information that can be specifically addressed.
Record (Record)
It can be handled by the IC card as a whole, and the determined byte string can be addressed by the record number or record identifier.
Record Number
In the log file, the order, the unique number.
Record Identifier
It is possible to select at the application level that several records in a file can have the same identifier.
File
In an IC card, a collection of organized data units or records.
File Name
A byte string of a DF can be uniquely identified in the IC card.
File Identifier
Each file (MF, DF, EF) has a 2-byte identification information.
File Control Information
The logical, structural, and security attribute information of a file.
Path
Unlimited join of file identifiers.
Allocable Memory
Part of the memory contained in a file, but has not been specifically allocated.
Command- Response Pair
A collection of two messages: one command followed by a response.
Level level
From the main file, to the number of DFs in the middle of a specific file, where the level of the main file is 0.
The main function
To sum up, the smart IC card operating system should have at least the following four basic functions:
Hardware resource management function;
Communication transmission management function;
Application control management function;
Security control management function.
Each of these functions consists of several sub-functions. According to the ISO OSI reference model classification, the hardware resource management function belongs to the physical layer; the communication transmission management function belongs to the data link layer; the application control management and security control management belong to the application layer. The logical relationship between the layers is shown in the figure.
The picture shows the logical relationship between the functional layers of the smart IC card.
Hardware resource management
The hardware resources in the smart IC card are very rich, and their functions are also different, as shown in Table 3-1. Among them, EEPROM is the most important application resource for users.
Smart IC Card Hardware Function Description Hardware Resource Description Main Function
Central computing, processing, and management of MPU microprocessor systems
CAU Encryption Operation Coprocessor performs operations related to encryption and decryption
ROM read-only memory storage operating system program
Temporary storage of RAM random access temporary work data
EEPROM electrical erase memory application, data storage
I/O communication interface communication transmission
Hardware protection for SL security logic internal resources
···
The purpose of hardware resource management is to organize, coordinate and direct the operation of these hardwares, and provide corresponding program interfaces for high-level applications, making high-level application programming easier, simpler and more reliable. It is similar to the BIOS (Basic Input and Output Interface) feature on a PC, but it has a higher management level than it does. The following focuses on the organization and management of user memory.
1. The data structure of the user memory is in accordance with the ISO/IEC 7816 standard. The data structure of the user memory has four types: Linear Fixed, Linear Variable, Cyclic, and Transparent. See Figure 3-2. Users can decide which data structure to use based on the characteristics of the application data, the update rate, and other factors.
Figure 2 data organization structure
1, linear fixed structure
A typical structure is a fixed length record, in which the storage location of each record is identified by a unique record number, which can be read and written at random. According to the relevant ISO/IEC standards, the record number ranges from 1 to 253.
2, linear variable structure
For example, variable length records, in which the storage location of each record is identified by a unique record number, can be read and written randomly. According to the relevant ISO/IEC standards, the record number ranges from 1 to 254.
3, ring structure
This structure is similar to a fixed-length record of the first and last loops, and random writes are not allowed. The records are stored in a fixed order because the number of records is limited. If the number of records exceeds the limit, the newly written data will overwrite the old data.
4, transparent structure
When binary data uses this data structure, the data is generally addressed and managed by the user, and the operating system is only responsible for the allocation of storage space. The transparent data structure is suitable for storing hypertext information such as sounds and images.
Second, the file organization of the user memory According to the ISO/IEC 7816 standard, the data in the smart IC card is organized and stored in the user memory in the form of a tree file structure. The file is divided into three levels: one is the main file (Master File), forming the root of the file system, similar to the root directory in DOS; the second is the dedicated file (Dedicated File), under the main file, similar to DOS Directory; third is the child-specific file (Child-DF), the proprietary file under DF is similar to the subdirectory in DOS. Of course, there can be DF under DF, which depends mainly on the size of the user memory. In addition, there is an Elementary File that stores the actual application data and corresponding system management information. The metafile can exist at any file level.
The tree structure of the smart IC card file is shown in the figure below.
Figure 3 Smart IC card tree organization file
In the file structure of the smart IC card, the master file can only be one and generated with the operating system, and the user cannot control it; in the file access process, it cannot be accessed in layers, if you want to read and write the element under the child-specific file. The file must pass through its high-level file hierarchy; the size of a proprietary file is predetermined and unmodifiable at the time of application generation, and some operating systems can dynamically modify the size of the proprietary file during use, provided that there is sufficient storage space.
Third, the file type and its characteristics
The files of the smart IC card operating system have three levels of hierarchy. The files at each level are also divided into different categories and have different uses.
1, the main file
There must be a single master file in the system, and the master file forms the root of the smart IC card file system. The main file contains system file control information and allocable storage space, under which various files can be created.
Although the system allows various application files to be generated directly under the root, the best method for organizing files is to assign a proprietary file to each application and organize the various application data under the proprietary file of the corresponding application. The advantage of this is that the mutual interference between different applications is small, the application design is convenient, the security is higher, and the like, which is beneficial to "one card multi-purpose". The main file is generally used to store shared data between different applications, such as card serial number, cardholder data and other information.
At initialization, the main file can also be given some security features, such as prohibiting the use of certain commands of the operating system. The purpose of this is to ensure the safety management of the "one-card multi-use" cross-department or even cross-industry security management from the production of the IC card to the final application.
Once the smart IC card is inserted into the read/write device, the main file is activated immediately until the card is removed.在å¡çš„生å˜æœŸå†…,主文件ä¸èƒ½è¢«åˆ 除。
2ã€ä¸“有文件
专有文件å«æœ‰æ–‡ä»¶æŽ§åˆ¶ä¿¡æ¯åŠå¯åˆ†é…çš„å˜å‚¨ç©ºé—´ï¼Œå…¶ä¸‹å¯ä»¥å»ºç«‹å„ç§æ–‡ä»¶ã€‚
一个专有文件将被用æ¥å˜å‚¨æŸä¸€åº”用的所有数æ®ã€‚æ¯ä¸€åº”用的应用顺åºå‡ç”±è¯¥ä¸“有文件的状æ€æœºæŽ§åˆ¶ï¼Œä½¿ä¸åŒåº”用之间具有较强的独立性并且更安全。
专有文件在用户å˜å‚¨å™¨ä¸å æ®ä¸€å—é™æ€å˜å‚¨å™¨ï¼Œä¸€æ—¦ä¸“有文件建立,其å˜å‚¨å™¨çš„大å°å°±ä¸èƒ½å˜åŠ¨ï¼Œä½†åœ¨è¯¥ä¸“有文件下的元文件则å¯ä»¥é‡æ–°åˆ†é…所使用å˜å‚¨å™¨å¤§å°ï¼Œå¯ä»¥è¢«åˆ 除。专有文件下还å¯ä»¥å†å»ºç«‹ä¸“有文件。æ¤æ—¶ï¼Œè¾ƒé«˜å±‚的专有文件称为父专有文件(Parent-DF),较低层的称为å专有文件(Child-DF)。
çˆ¶ä¸“æœ‰æ–‡ä»¶æ— è®ºåœ¨é€»è¾‘ä¸Šï¼ˆæ“作系统管ç†ï¼‰è¿˜æ˜¯åœ¨ç‰©ç†ä¸Šï¼ˆç”¨æˆ·å˜å‚¨å™¨ï¼‰å‡ç›¸äº’隔离。ä¸åŒçš„专有文件å‡å¯ä½¿ç”¨ä¸»æ–‡ä»¶ä¸‹çš„公共资æºã€‚父专有文件的建立一般分æˆä¸¤ä¸ªæ¥éª¤ï¼šå…ˆé€»è¾‘创建,å³åœ¨æ“作系统ä¸ä½œä¸€åˆ›å»ºç™»è®°ï¼›å†ç‰©ç†åˆ›å»ºï¼›å®žé™…分é…一定数é‡çš„用户å˜å‚¨å™¨ã€‚分æ¥åˆ›å»ºçš„优点是å¯ä»¥ç‹¬ç«‹äºŽæ—¶é—´å’Œå˜å‚¨å™¨ä½ç½®ç”Ÿæˆå…·ä½“应用。æŸä¸€å…·ä½“的父专有文件ä¸èƒ½åœ¨å…¶å®ƒä¸“有文件或主文件ä¸åˆ é™¤ï¼Œè¯¥çˆ¶ä¸“æœ‰æ–‡ä»¶çš„åˆ é™¤æ¡ä»¶åœ¨å…¶åº”用控制文件(ACF)ä¸å®šä¹‰ï¼Œåªæœ‰æ»¡è¶³è¯¥æ¡ä»¶æ‰åˆ é™¤ã€‚è¯¥çˆ¶ä¸“æœ‰æ–‡ä»¶è¢«åˆ é™¤ä¹‹åŽï¼Œå…¶ä¸‹çš„å专有文件ã€å…ƒæ–‡ä»¶ä¹ŸåŒæ—¶è¢«åˆ 除,释放的å˜å‚¨å™¨å—å¯ç”±å…¶å®ƒçˆ¶ä¸“有文件使用。
å专有文件å¯ä»¥æ˜¯æŸä¸€å应用,å专用文件å¯æœ‰å…¶è‡ªå·²çš„应用控制文件。æŸä¸€å…·ä½“çš„å专有文件ä¸èƒ½åœ¨å…¶å®ƒä¸“有文件或主文件ä¸åˆ 除。该åä¸“æœ‰æ–‡ä»¶çš„åˆ é™¤æ¡ä»¶åœ¨åº”用控制文件ä¸å®šä¹‰ï¼Œåªæœ‰æ»¡è¶³è¯¥æ¡ä»¶æ‰å¯åˆ 除。该åä¸“æœ‰æ–‡ä»¶è¢«åˆ é™¤ä¹‹åŽï¼Œå…¶ä¸‹çš„专有文件(若还有)ã€å…ƒæ–‡ä»¶ä¹ŸåŒæ—¶è¢«åˆ 除,释放的å˜å‚¨å™¨å—å¯ç”±å…¶å®ƒå专有文件使用。
3ã€å…ƒæ–‡ä»¶
元文件å«æœ‰å®žé™…应用数æ®æˆ–文件控制信æ¯ï¼Œå…¶ä¸‹ä¸å¯å»ºç«‹ä»»ä½•æ–‡ä»¶ã€‚
元文件分为三类:一类å˜å‚¨å®žé™…的应用数æ®ï¼Œç§°ä¸ºå·¥ä½œå…ƒæ–‡ä»¶ï¼ˆWEF);å¦ä¸€ç±»å˜å‚¨ç›¸åº”的系统管ç†ä¿¡æ¯ï¼Œç§°ä¸ºç³»ç»Ÿç®¡ç†å…ƒæ–‡ä»¶ï¼ˆSMEF);在ISO/IEC 7816æ ‡å‡†ä¸è¿˜å®šä¹‰æœ‰ä¸€ç§å…¬å…±å…ƒæ–‡ä»¶ï¼ˆPEF)。
工作元文件(Working Elementary File)具有以下特性:
å˜å‚¨åº”用数æ®ï¼›
è‹¥æ¡ä»¶æ»¡è¶³å¯è¢«è¯»ã€å†™ã€åˆ 除ç‰ï¼›
å¯ä»¥å˜åœ¨äºŽä»»ä½•æ–‡ä»¶ç»“æž„ï¼›
å¯ä»¥æ˜¯ä»»ä½•ä¸€ç§æ–‡ä»¶ç»“æž„ï¼›
具有内部数æ®æ ¡éªŒï¼ˆå¦‚检查和)措施。
系统管ç†å…ƒæ–‡ä»¶ï¼ˆSystem Management EF)有以下两ç§ã€‚
1ã€å†…部ä¿å¯†æ–‡ä»¶ï¼ˆInternal Secret Files, ISF)具有以下特性:
å˜å‚¨ç³»ç»Ÿæˆ–应用ä¿å¯†æ•°æ®ï¼Œå¦‚åŠ å¯†å¯†é’¥ã€ä¸ªäººå¯†ç ç‰ï¼›
å¯è¢«è¾“å…¥ã€ä¿®æ”¹ã€è¦†ç›–,但ä¸å¯è¯»ï¼›
ä¸èƒ½éƒ¨åˆ†åˆ 除;
å¯ä»¥å˜åœ¨äºŽä»»ä½•æ–‡ä»¶å±‚次;
文件结构å¯ä¸ºçº¿æ€§å¯å˜ç»“构。
2ã€åº”用控制文件(Application Control Files, ACF)具有以下特性:
å˜å‚¨åº”用状æ€æœºæ£—应用顺åºæŽ§åˆ¶æ•°æ®ï¼›
ä¸èƒ½åˆ 除;
æ¯ä¸€æ–‡ä»¶å±‚次必须有一ACFï¼›
文件结构å¯ä¸ºçº¿æ€§å¯å˜ç»“构。
公共元文件(Public EF)主è¦ç”¨äºŽå˜å‚¨ç³»ç»Ÿæˆ–应用的公共数æ®ï¼Œå¯ä»¥æ— æ¡ä»¶å˜å–。
å››ã€æ–‡ä»¶å±žæ€§
æ¯ä¸€ç§æ–‡ä»¶å‡å…·æœ‰ç›¸åº”属性(Attributs),智能ICå¡çš„文件属性一般有4ç§ï¼š
文件å(File Name)/æ–‡ä»¶æ ‡è¯†ï¼ˆFile Identifer);
安全状æ€ï¼ˆSecurity Status);
æ“作模å¼ï¼ˆOperation Mode);
注释(Notation)。
1ã€æ–‡ä»¶å/æ–‡ä»¶æ ‡è¯†
æ¯ä¸€æ–‡ä»¶å¯ä»¥é€šè¿‡å…¶æ–‡ä»¶åæˆ–æ–‡ä»¶æ ‡è¯†æ¥å¯»å€ã€‚按ISO/IEC 7816æ ‡å‡†ï¼Œæ–‡ä»¶ç±»åž‹ä¸åŒï¼Œæ–‡ä»¶æ ‡è¯†çš„ç¼–ç 也ä¸ç›¸åŒã€‚æ£ç¡®è¯†åˆ«ã€å¯»å€ä¸€ä¸ªæ–‡ä»¶éœ€è¦ä¸€ä¸ªä»Žä¸»æ–‡ä»¶æˆ–当å‰ä¸“æœ‰æ–‡ä»¶åˆ°è¯¥æ–‡ä»¶çš„å®Œæ•´çš„æ ‡è¯†è·¯å¾„ã€‚ä»Žä¸»æ–‡ä»¶å¼€å§‹çš„è·¯å¾„ç§°ä¸ºç»å¯¹è·¯å¾„(Absolute Path),å¯ä»¥å”¯ä¸€ç¡®å®šæŸä¸€æ–‡ä»¶ï¼Œè¿™ä¸€ç‚¹å’ŒDOSæ“作系统ä¸çš„有关概念å分相似。
在ISO/IEC 7816æ ‡å‡†ä¸è§„定,æ¯ä¸€æ–‡ä»¶å‡ç”±ä¸€ä¸ª2å—èŠ‚é•¿çš„æ–‡ä»¶æ ‡è¯†å‚考确定,但在专有文件ä¸ä¹Ÿå¯ä»¥ä½¿ç”¨æ–‡ä»¶åæ¥æ ‡è¯†è¯¥æ–‡ä»¶ï¼Œä¸»è¦æ˜¯ä¸ºäº†ä¾¿äºŽåº”用设计人员设计该å¡ï¼Œç‰¹åˆ«æ˜¯å°†çˆ¶ä¸“有文件以文件åæ¥æ ‡è¯†ï¼Œæ›´å®¹æ˜“区分ã€ç†è§£â€œä¸€å¡å¤šç”¨â€ã€‚æ¤å¤–,在æŸä¸€å¼ å¡ä¸Šæ–‡ä»¶å一定è¦èƒ½å”¯ä¸€ç¡®å®šæŸä¸€æ–‡ä»¶ã€‚其实,以åå—命å该文件时æ“作系统åŒæ—¶åœ¨å†…部也自动分é…ç»™å®ƒä¸€ä¸ªæ ‡è¯†ï¼Œå¹¶é€šè¿‡æ ‡è¯†æ¥ç®¡ç†è¯¥æ–‡ä»¶ã€‚
ä¸åŒæ–‡ä»¶ç±»åž‹çš„æ ‡è¯†å…·æœ‰ä¸åŒçš„ç¼–ç 。按ISO/IEC 7816æ ‡å‡†ï¼Œæ–‡ä»¶æ ‡è¯†çš„ç¬¬ä¸€ä¸ªå—节为文件é™å®šç¬¦ï¼ˆFile Qualifier),主è¦ç”¨äºŽåŒºåˆ«æ–‡ä»¶ç±»åž‹ï¼ˆå¦‚主文件ã€ä¸“有文件ç‰ï¼‰ï¼›ç¬¬äºŒä¸ªå—节为文件索引(File Index)。其ä¸è§„定:
ä¸»æ–‡ä»¶ï¼šå…¶æ ‡è¯†ç¡®å®šä¸ºâ€œ3F00 Hâ€ï¼ˆåå…进制);
çˆ¶ä¸“æœ‰æ–‡ä»¶ï¼ˆåœ¨æ ‡å‡†ä¸æ²¡æœ‰ä½œå…·ä½“规定):一般的æ“作系统ä¸ï¼Œæ–‡ä»¶å最长为8å—节å—符串(第一个å—节ä¸èƒ½ä¸ºâ€œ20 Hâ€ï¼‰ï¼Œè‹¥æ–‡ä»¶åä¸è¶³8å—节长,æ“作系统将在其åŽä»¥â€œ20 Hâ€è¡¥è¶³å‰©ä½™å—节,所有父专有文件的åå—ä¸èƒ½ç›¸åŒï¼›
å专有文件:åä¸“æœ‰æ–‡ä»¶çš„æ–‡ä»¶æ ‡è¯†ä¸º2å—节。åŒä¸€çˆ¶ä¸“有文件下的åä¸“æœ‰æ–‡ä»¶çš„æ ‡è¯†ä¸èƒ½ç›¸åŒï¼Œä½†ä¸åŒçˆ¶ä¸“有文件下的åä¸“æœ‰æ–‡ä»¶çš„æ ‡è¯†åˆ™å¯ä»¥ç›¸åŒï¼›
å…ƒæ–‡ä»¶ï¼šæ–‡ä»¶æ ‡è¯†ä¸º2å—节。其ä¸ç¬¬ä¸€ä¸ªå—节为文件é™å®šç¬¦ï¼Œç¬¬äºŒä¸ªå—节为文件索引,在ISO/IEC 7816ä¸éƒ½æ²¡æœ‰ä½œå分明确的规定,其目的是为整个系统设计留有选择的余地。一般文件é™å®šç¬¦å¯ä»¥æ ¹æ®æƒ…况自定,当然最好ä¸ä¸Žæ ‡å‡†å†²çªã€‚文件索引也å¯è‡ªå®šï¼Œä¸€ç§å…¸åž‹çš„ç¼–ç æ ¼å¼è§è¡¨3-2。
表3-2一ç§å…ƒæ–‡ä»¶çš„典型编ç
Bg b7 b6 b5 b4 b3 b2 b1 b0 定义
× × 文件类型
0 0 WEF
0.1 ACF
1.0 ISF
1 1 æ— ç”¨Ã— × 文件层次
0.0 MF
0.1 Parent-DF
1.0 Child-DF
1 1 æ— ç”¨
× × × × 文件索引å·1-15
2ã€å®‰å…¨çŠ¶æ€
它主è¦ç”¨äºŽå®šä¹‰ä¸åŒå‘½ä»¤åœ¨ä¸åŒçŠ¶æ€ä¸‹ï¼ˆç”±æŸä¸€åº”用的状æ€æœºå†³å®šï¼‰å¯¹è¯¥æ–‡ä»¶çš„å˜å–æƒé™ã€‚
3ã€æ“作模å¼
æ“作模å¼ç”¨äºŽå®šä¹‰æ–‡ä»¶çš„é™æ€å˜å–特性,主è¦æœ‰ä»¥ä¸‹å‡ ç§ç‰¹æ€§ï¼š
å¯åˆ 除性(Erasable);
读/写特性(R/W);
å˜å–特性(Access);
一次写入ã€å¤šæ¬¡è¯»å‡ºç‰¹æ€§ï¼ˆWORM);
åªè¯»ç‰¹æ€§ï¼ˆRO);
åªå†™ç‰¹æ€§ï¼ˆWO);
å¯è®¡ç®—性(Compute):定义该文件是å¦å¯è¢«æŸäº›å‘½ä»¤å˜å–执行。
4ã€æ³¨é‡Š
注释å«æœ‰æŸä¸€æ–‡ä»¶çš„简çŸçš„说明信æ¯ï¼Œå¦‚版本å·ç‰ã€‚
在ISO/IEC 7816æ ‡å‡†ä¸ï¼Œå¯¹è¯¸å¦‚文件属性ç‰çš„定义å分简å•ï¼Œå¾ˆä¸å…·ä½“。其目的就是给系统设计人员ä¿ç•™å……分的å‘挥空间。当具体设计æŸä¸€ICå¡çš„应用系统时,必须按智能ICå¡çš„供应商的技术说明书æ“作。
é€šè®¯ä¼ è¾“ç®¡ç†
ICå¡å¿…须与相应的读写设备(IFD)通讯。从这个角度讲,智能ICå¡æ“作系统的作用就是从读写设备(IFD)接收命令ã€æ‰§è¡Œå‘½ä»¤å¹¶å°†ç»“果返回读写设备(IFD)。所以,通讯管ç†åŠŸèƒ½æ¨¡å—在æ“作系统ä¸å…·æœ‰å分é‡è¦çš„作用。
通讯管ç†åŠŸèƒ½æ¨¡å—主è¦å®žçŽ°ä»¥ä¸‹å‡ ç§åŠŸèƒ½ï¼š
实现æŸä¸€é€šè®¯å议的数æ®é“¾è·¯å±‚çš„ä¼ è¾“ç®¡ç†åŠŸèƒ½ï¼›
实现ISO/IEC 7816æ ‡å‡†è§„å®šçš„ATR(å¤ä½å“应)ç‰åŠŸèƒ½ï¼›
·为æ“作系统ä¸çš„其它功能模å—æ供相应接å£ã€‚
按ISO/IEC 7816æ ‡å‡†ï¼ŒICå¡å’Œè¯»å†™è®¾å¤‡ä¹‹é—´çš„通讯å议有多ç§ï¼Œä¸€èˆ¬ä¸€ç§ç‰¹å†™çš„å¡åªæ”¯æŒæŸä¸€ç§é€šè®¯å议。下é¢ä»¥ç¬¦åˆISO/IEC 7816-3æ ‡å‡†çš„T=1å—ä¼ è¾“å议的智能ICå¡ä¸ºä¾‹ä»‹ç»é€šè®¯ç®¡ç†åŠŸèƒ½ï¼ˆæ”¯æŒå…¶å®ƒé€šè®¯å议的å¡çš„通讯管ç†åŠŸèƒ½ä¸Žæ¤ç›¸ä¼¼ï¼‰ã€‚
ICC上电之åŽï¼ŒIFDå°†å‘ICCå‘é€å‘½ä»¤æ•°æ®ï¼Œåœ¨è¿™æ ·ä¸€æ¬¡å…¸åž‹çš„通讯过程ä¸ï¼Œé€šè®¯ç®¡ç†åŠŸèƒ½æ¨¡å—主è¦ä»Žäº‹6个æ¥éª¤çš„具体工作。è§å›¾ã€‚
通讯模å—管ç†
IFDå’ŒICC之间的通讯由IFDå¯åŠ¨ï¼ŒIFD还负责给å¡ä¾›ç”µã€‚通讯为åŠåŒå·¥æ–¹å¼ï¼ˆHalf Duplex),å³åŒæ—¶åªèƒ½æœ‰ä¸€æ–¹åœ¨ä¼ 输信æ¯ã€‚
第一æ¥ï¼šå¤ä½å“应
在ICCæ£ç¡®æ’å…¥IFD之åŽï¼Œé€šè®¯ç®¡ç†åŠŸèƒ½æ¨¡å—å°†å‘IFDå‘é€ä¸€ä¸ªå¤ä½å“应信æ¯ï¼ˆAnswer To Reset,ATR)。ATRä¸å«æœ‰å¡æ ‡è¯†æ•°æ®ï¼Œå¦‚I/O缓冲区的大å°ã€é€šè®¯é€ŸçŽ‡è½¬æ¢å› å(Conversions Factor)ç‰ä¿¡æ¯ï¼Œé€šçŸ¥IFD本ICCçš„æ“作特性,以便IFDæ£ç¡®é€‰æ‹©ç›¸åº”çš„æ“作å‚数与ICC进行通讯。ICCæ¯æ¬¡ç¡¬å¤ä½ï¼ˆå¡æ’å…¥IFD)都将å‘é€ä¸€ä¸ªATRç»™IFD。
第二æ¥ï¼šæ•°æ®æ”¶å‘
具体监控ã€æ‰§è¡Œä¼ 输å议,收å‘æ•°æ®ã€‚
第三æ¥ï¼šé“¾æŽ¥æ¨¡å¼ä¼ 输管ç†å› 为T=1åè®®ä¼ è¾“å®Œæ•´çš„ä¿¡æ¯ï¼Œå…¶å¤§å°å¯èƒ½è¶…过I/O缓冲区的大å°ã€‚为é¿å…å‡ºçŽ°ä¼ è¾“é—®é¢˜ï¼Œé€šè®¯ç®¡ç†åŠŸèƒ½æ¨¡å—将一个完整的信æ¯åˆ†å—ä¼ è¾“ã€‚
第四æ¥ï¼šä¼ 输检查通过检查æŸä¸€å—节的奇å¶æ ¡éªŒä½ã€æŸä¸€å—的检查和或长度,å‘çŽ°ä¼ è¾“é”™è¯¯å¹¶é€šçŸ¥IFD。在这ç§æƒ…况下,IFDå°†é‡å‘错误数æ®ã€‚å之,若IFD通知ICCæ•°æ®å‘é€å‡ºé”™ï¼ŒICC将执行数æ®é‡å‘æ“作。
第五æ¥ï¼šæ•°æ®ä¼ 递若ç»è¿‡ä¸Šé¢æ¥éª¤åŽæ•°æ®æ£ç¡®æŽ¥æ”¶ï¼Œé€šè®¯ç®¡ç†åŠŸèƒ½æ¨¡å—将接收数æ®ä¼ 递给下一功能模å—,如安全控制管ç†æ¨¡å—作进一æ¥å¤„ç†ã€‚å之亦然。
第å…æ¥ï¼šä¼ 输结æŸå¤„ç†è‹¥æ£ç¡®ä¼ 输åŽæ— 任何其它动作,通讯管ç†åŠŸèƒ½æ¨¡å—å°†MPU置于相应的节电方å¼ï¼Œå¦‚ç¡çœ æ–¹å¼ï¼ˆSleep Mode)以节çœåŠŸè€—。
å之,ICCå‘IFDå‘é€æœ‰å…³æ•°æ®ä¿¡æ¯ï¼Œä¹Ÿå°†æ‰§è¡Œä»¥ä¸Šè‹¥å¹²ç±»ä¼¼æ¥éª¤çš„æ“作。
应用控制管ç†
为适应智能ICå¡çš„应用,特别是对安全性è¦æ±‚较高的应用,在智能ICå¡çš„æ“作系统ä¸è¿˜æ供应用控制管ç†åŠŸèƒ½æ¨¡å—。在以上对用户å˜å‚¨å™¨çš„文件组织方å¼çš„æè¿°ä¸æ›¾ç»æ到æ¯ä¸€æ–‡ä»¶å±‚次(如MF,DFç‰ï¼‰å‡ç”±ä¸€ä¸ªåº”用控制文件,在该文件ä¸å°±å®šä¹‰æœ‰åº”用控制管ç†æ•°æ®ã€‚
应用控制管ç†åŠŸèƒ½æ¨¡å—主è¦å…·æœ‰ä¸¤ä¸ªåŠŸèƒ½ï¼šä¸€æ˜¯æ供对æŸä¸€åº”用(处于æŸä¸€æ–‡ä»¶å±‚次)的应用顺åºæµç¨‹æŽ§åˆ¶ï¼›äºŒæ˜¯æ供在ä¸åŒçš„应用顺åºçŠ¶æ€ä¸‹çš„命令执行æƒé™ã€‚这两个功能虽然å¯ä»¥åˆ†å¼€è®¨è®ºï¼Œä½†åœ¨å…·ä½“实施时å´å¯†ä¸å¯åˆ†ã€‚
1ã€åº”用顺åºæµç¨‹æŽ§åˆ¶åº”用顺åºæµç¨‹æŽ§åˆ¶å®šä¹‰äº†æŸä¸€åº”用的顺åºæµç¨‹ï¼Œå³çŠ¶æ€æœºã€‚例如,有一个较简å•çš„应用分四æ¥æ‰§è¡Œï¼ŒåŒæ—¶è¯¥åº”用具有三个状æ€ï¼Œå¯åŠ¨è¯¥åº”用需满足æ¡ä»¶1,然åŽè¿›å…¥çŠ¶æ€1,执行相应æ“作;若在状æ€1下的æ“作满足了æ¡ä»¶2,则进入状æ€2并执行相应æ“作;若在状æ€2下的æ“作满足了æ¡ä»¶3,则进入状æ€3并执行相应æ“作;就用结æŸï¼Œå¦‚下图所示。
应用æµç¨‹å›¾
å¯è§ï¼Œæ‰€è°“应用顺åºæµç¨‹æŽ§åˆ¶å°±æ˜¯å®šä¹‰äº†æŸä¸€åº”用的具体执行过程åŠç›¸åº”æ¡ä»¶ã€‚一旦确定了应用æµç¨‹ï¼ŒæŸä¸€åº”用就必须而且åªèƒ½æŒ‰å…¶è¦æ±‚执行,如在上图ä¸ä¸å¯ä»¥ä»ŽçŠ¶æ€1直接跳跃到状æ€3去执行æŸä¸€æ“作。
2ã€å‘½ä»¤æ‰§è¡Œæƒé™è¿›ä¸€æ¥æ高应用的安全性,在应用顺åºæµç¨‹ä¸è¿˜å®šä¹‰äº†åœ¨æŸä¸€åº”用的ä¸åŒçŠ¶æ€ä¸‹å¯¹å‘½ä»¤çš„执行æƒé™ã€‚如一数æ®æ–‡ä»¶ï¼Œåœ¨è¯¥æ–‡ä»¶å»ºç«‹æ—¶å®šä¹‰äº†å…¶å˜å–特性(如å¯è¯»å†™ä½†ä¸èƒ½åˆ 除),通过在该应用的顺åºæµç¨‹ä¸å®šä¹‰è¯»ã€å†™å‘½ä»¤è¿˜å¯ä»¥è¿›ä¸€æ¥é™åˆ¶å¯¹è¯¥æ–‡ä»¶çš„å˜å–。扩展上é¢çš„例å,å‡è®¾åœ¨è¯¥åº”用ä¸æœ‰ä¸€æ•°æ®æ–‡ä»¶å˜å‚¨æœ‰é‡è¦æ•°æ®ï¼Œè¯¥æ–‡ä»¶çš„属性定义为å¯è¯»å†™ï¼Œä½†æ ¹æ®åº”用需求读写æ“作åªèƒ½åœ¨çŠ¶æ€3执行,状æ€2åªèƒ½è¿›è¡Œè¯»æ“作,这就å¯ä»¥é€šè¿‡ç¦æ¢åœ¨çŠ¶æ€2执行写命令而å…许读命令,在状æ€3åŒæ—¶å…许执行读ã€å†™å‘½ä»¤çš„方法实现,如图6所示。
命令æƒé™é™åˆ¶ç¤ºæ„图
至æ¤ï¼Œä»Žåº”用顺åºæŽ§åˆ¶è§’度å¯ä»¥è®¤ä¸ºï¼Œåœ¨å»ºç«‹æŸä¸€æ–‡ä»¶æ—¶å®šä¹‰çš„属性为该文件的é™æ€å±žæ€§ï¼Œè€Œç»“åˆå…·ä½“应用定义的命令执行æƒé™åˆ™ä¸ºè¯¥æ–‡ä»¶çš„动æ€å±žæ€§ã€‚ç”±æ¤å¯è§ï¼Œåˆ©ç”¨è¿™ç§æœºåˆ¶å¯¹æ•°æ®æ–‡ä»¶çš„å˜å–é™æœŸå®‰å…¨åˆçµæ´»ã€‚
安全控制管ç†
安全控制管ç†å°±æ˜¯å¯¹æ™ºèƒ½ICå¡ä¸çš„é™æ€ã€åŠ¨æ€æ•°æ®è¿›è¡Œå®‰å…¨æŽ§åˆ¶åŠç®¡ç†ã€‚它å¯ä»¥å…·ä½“分为两ç§åŠŸèƒ½ï¼šä¸€æ˜¯å®‰å…¨ä¼ 输控制,å³å¯¹ä¼ 输数æ®çš„安全ä¿æŠ¤ï¼›äºŒæ˜¯å¯¹å†…部é™æ€å®‰å…¨æ•°æ®ï¼ˆå¦‚åŠ å¯†å¯†é’¥ç‰ã€å„ç§è®¤è¯æŽˆæƒæ“作)的控制管ç†ã€‚
一ã€å®‰å…¨ä¼ 输控制
为防æ¢æœ‰å…³ä¿¡æ¯ï¼ˆå‘½ä»¤ã€æ•°æ®ï¼‰åœ¨IFDå’ŒICCä¹‹é—´çš„ä¼ è¾“è¿‡ç¨‹ä¸è¢«æ¶æ„截å–ã€ç¯¡æ”¹ï¼Œæ高动æ€ä¼ 输信æ¯çš„安全性和å¯é 性,在智能ICå¡çš„æ“作系统ä¸æä¾›å®‰å…¨ä¼ è¾“æŽ§åˆ¶æœºåˆ¶ã€‚å…¶ä¸»è¦åŽŸç†ä¸ºï¼šæˆ–è€…é€šè¿‡å°†ä¼ è¾“çš„ä¿¡æ¯åŠ 密,使éžæ³•æˆªå–çš„ä¿¡æ¯æ— 实际应用æ„ä¹‰ï¼›æˆ–è€…å°†å¾…ä¼ è¾“çš„ä¿¡æ¯ï¼ˆæˆ–部分信æ¯ï¼‰è¿›è¡ŒåŠ å¯†ï¼Œå¹¶å°†è¯¥åŠ å¯†ä¿¡æ¯é™„åŠ åœ¨ä¼ è¾“çš„æ˜Žæ–‡ä¹‹åŽå†è¿›è¡Œä¼ 输,使æ¶æ„篡改信æ¯å˜ä¸ºä¸å¯èƒ½ï¼›å†å°±æ˜¯å°†ä»¥ä¸Šä¸¤ç§æ–¹æ³•å…±åŒä½¿ç”¨ï¼Œæ—¢å¯é˜²æ¢å¯¹ä¼ 输信æ¯çš„éžæ³•æˆªå–,åˆå¯é˜²æ¢å¯¹ä¼ 输信æ¯çš„éžæ³•ç¯¡æ”¹ã€‚
在智能ICå¡çš„æ“作系统ä¸ï¼Œä¸€èˆ¬å…·æœ‰å››ç§ä¿¡æ¯ä¼ 输方å¼ï¼š
æ˜Žæ–‡ä¼ è¾“æ–¹å¼ï¼ˆPlaintext Transmit Mode);
认è¯ä¼ 输方å¼ï¼ˆAuthentic Transmit Mode);
åŠ å¯†ä¼ è¾“æ–¹å¼(Encipher Transmit Mode);
æ··åˆä¼ 输方å¼(Mixed Transmit Mode)。
å…¶ä¸ï¼Œæ˜Žæ–‡ä¼ 输方å¼å¯¹ä¼ 输的信æ¯ä¸ä½œä»»ä½•å¤„ç†ï¼Œå…¶å®ƒä¸‰ç§ä¿¡æ¯ä¼ 输方å¼åˆ™åˆ†åˆ«å®žçŽ°ä¸‰ç§å®‰å…¨æŽ§åˆ¶ä¼ 输机制。这三ç§ä¼ 输方å¼çš„具体工作原ç†å°†åœ¨ä¸‹ä¸€ç« ä¸ç»“åˆå¯†ç 技术详细介ç»ã€‚
在具体应用ä¸ï¼Œè®¾è®¡äººå‘˜å¯ä»¥æ ¹æ®ä¸åŒçš„应用对安全性的特殊è¦æ±‚çµæ´»é‡‡ç”¨ä¸åŒçš„ä¿¡æ¯ä¼ 输方å¼ã€‚å› ä¸ºå¹¶éžæ‰€æœ‰çš„ä¿¡æ¯éƒ½éœ€è¦å®‰å…¨ä¼ è¾“ï¼ˆå°†å¢žåŠ æ—¶é—´å’Œç©ºé—´å¼€é”€ï¼‰ï¼Œæ‰€ä»¥å¤§å¤šæ•°çš„æ™ºèƒ½ICå¡æ“作系统å‡å¯å¯¹æ¯ä¸€æ¬¡ä¼ 输设定一ç§ä¼ 输方å¼ï¼Œä¾‹å¦‚å¯ä»¥ä¸€æ¬¡ä¼ 输采用认è¯ä¼ 输方å¼ï¼Œè€Œä¸‹ä¸€æ¬¡é‡‡ç”¨æ˜Žæ–‡ä¼ 输方å¼ï¼Œå†ä¸‹ä¸€æ¬¡åˆ™é‡‡ç”¨æ··åˆä¼ 输方å¼ï¼Œå分çµæ´»ã€‚
二ã€å†…部安全控制管ç†
内部安全控制管ç†çš„功能主è¦æœ‰ä¸¤ä¸ªï¼šä¸€æ˜¯å¯¹æ•°æ®åŠåŠŸèƒ½ï¼ˆå¦‚æŸä¸€å‘½ä»¤ï¼‰çš„å˜å–执行æƒé™çš„控制;二是对内部é™æ€ä¿å¯†æ•°æ®ï¼ˆå¦‚åŠ å¯†å¯†é’¥ç‰ï¼‰çš„安全管ç†ã€‚
1ã€æ•°æ®åŠåŠŸèƒ½çš„å˜å–执行æƒé™æŽ§åˆ¶
以ICå¡ä¸ºä¸å¿ƒï¼Œåœ¨å¡çš„应用ä¸ä¸»è¦å˜åœ¨ä¸¤ç§è®¤è¯æŽˆæƒè¿‡ç¨‹ï¼Œè§å›¾7。ICå¡éªŒè¯æŒå¡äººèº«ä»½çš„åˆæ³•æ€§è¿™ä¸€è¿‡ç¨‹é€šè¿‡ä¸ªäººè¯†åˆ«å·ï¼ˆPIN)æ¥å®Œæˆï¼›è€ŒICå¡å’Œåº”用终端之间的认è¯åˆ™é€šè¿‡ç›¸åº”的认è¯è¿‡ç¨‹æ¥å®Œæˆã€‚
ICå¡åº”用ä¸å˜åœ¨çš„两ç§è®¤è¯æŽˆæƒè¿‡ç¨‹
1)ã€ä¸ªäººè¯†åˆ«å·(Personal Identification Number,PIN)
PIN是ICå¡ä¸çš„ä¿å¯†æ•°æ®ã€‚PIN的主è¦ç”¨é€”是ä¿è¯åªæœ‰åˆæ³•æŒå¡äººæ‰èƒ½ä½¿ç”¨è¯¥å¡æˆ–该å¡ä¸çš„æŸä¸€é¡¹æˆ–å‡ é¡¹åŠŸèƒ½ï¼Œä»¥é˜²æ¢æ‹¾åˆ°è¯¥å¡çš„人æ¶æ„使用或éžæ³•ä¼ªé€ 。å¡åº”用å‘行部门将æ¯ä¸€å¼ ICå¡å‡åˆå§‹åŒ–一个PIN并将它ç»å®‰å…¨æ¸ é“分å‘给相应æŒå¡äººã€‚使用时首先è¦æ±‚æŒå¡äººè¾“å…¥PIN,若输入的PIN和该å¡ä¸å˜å‚¨çš„PIN相åŒåˆ™è¯æ˜Žæ¤æŒå¡äººåˆæ³•ï¼Œå¯ä»¥ä½¿ç”¨è¯¥å¡ã€‚
一般较简å•çš„ICå¡ä¸åªæœ‰ä¸€ä¸ªPIN,在较å¤æ‚çš„å¡ï¼ˆå¦‚智能ICå¡ï¼‰ä¸å¯ä»¥å˜åœ¨å‡ 个PIN,如多功能å¡ä¸çš„æ¯ä¸€åŠŸèƒ½å°±å¯å…·æœ‰ä¸€ä¸ªPIN。简å•ICå¡ä¸PINçš„ä½æ•°è¾ƒçŸï¼ˆå¦‚4ä½äºŒè¿›åˆ¶ï¼‰ï¼Œåœ¨è¾ƒå¤æ‚的智能ICå¡ä¸PINçš„ä½æ•°è¾ƒé•¿ï¼ˆå¦‚1~8ä½å进制)。为进一æ¥æ高使用PIN的安全性,æ¯ä¸€ä¸ªPIN还é…有一错误计数器(Error Counter)。该计数器用以记录ã€é™åˆ¶PIN输入错误的次数,若一次连ç»çš„输入错误次数超过å¡ä¸è§„定次数则å¡è‡ªé”;而在该é™åˆ¶æ¬¡æ•°å†…åªè¦PIN输入æ£ç¡®ä¸€æ¬¡å°±å¯ä½¿ç”¨è¯¥å¡ï¼Œä¸”错误计数器å¤ä½ï¼Œå³ä¸‹æ¬¡ä½¿ç”¨è¾“å…¥PIN时还具有å¡ä¸è§„定的最大的试探次数。
一旦å¡è‡ªé”,简å•çš„ICå¡å°±ä¸å¯å†ç”¨ï¼Œè€Œå¤æ‚的智能ICå¡è¿˜å¯é€šè¿‡ä¸ªäººè§£é”ç (Personal Unblocking Code,PUC)将å¡æ‰“开。一般,一个PUCåªç”¨äºŽä¸€ä¸ªPIN,并且也å¯ä»¥æœ‰é”™è¯¯è®¡æ•°å™¨ã€‚è‹¥åˆæ³•æŒå¡äººå¿˜è®°PIN而将å¡é”ä½ï¼Œåˆ™ä½¿ç”¨PUCå°†å¡æ‰“开时还å¯ä»¥è¾“入一个新的PIN。
在智能ICå¡æ“作系统ä¸ï¼ŒPIN还å¯ä»¥æœ‰ä»¥ä¸‹å‡ ç§å±žæ€§ã€‚
·å¯ä¿®æ”¹æ€§(Modifiable):PIN建立之åŽå¯ä»¥ä¿®æ”¹ã€‚
·ä¸å¯ä¿®æ”¹æ€§(Non- Modifiable):一旦PIN建立之åŽå°±ä¸å¯ä¿®æ”¹ã€‚
·临时失效性(Temp-Deactivated):通过命令å¯ä½¿æŸä¸€PIN临时失效,ä¸èµ·ä½œç”¨ï¼Œå½“然还å¯ä»¥é€šè¿‡å¦ä¸€å‘½ä»¤å†å°†å…¶æ¿€æ´»ç‰ç‰ã€‚
å¦å¤–,在智能ICå¡æ“作系统ä¸ï¼ŒPIN也å¯æŒ‰ä»¥ä¸‹ä¸¤ç§å½¢å¼å‡ºçŽ°ã€‚
·全局PIN(Global PIN):处于系统的较高层次(如主文件)ä¸ï¼Œä¸€æ—¦å› 错误计数溢出ç‰åŽŸå› 自é”,也åŒæ—¶é”ä½ä½¿ç”¨è¯¥PIN的其它应用层次。
·局部PIN(Local PI N):处于æŸä¸€å…·ä½“åº”ç”¨å±‚æ¬¡ï¼Œä¸€æ—¦å› é”™è¯¯è®¡æ•°æº¢å‡ºç‰åŽŸå› 自é”,则仅é”ä½è¯¥å±‚次有应用。
2)ã€å®‰å…¨è®¤è¯
ICå¡å’Œåº”用终端之间的认è¯æŽˆæƒçš„用途就是相互确认åˆæ³•æ€§ï¼Œç›®çš„在于防æ¢ä¼ªé€ 应用终端åŠç›¸åº”çš„ICå¡ã€‚它一般有三ç§è®¤è¯æ–¹å¼ï¼š
内部认è¯(Internal Authentication)
应用终端验è¯ICå¡çš„åˆæ³•æ€§ï¼›
PIN功能简å•æ±‡æ€»
功能简å•ICå¡å¤æ‚ICå¡å¦‚智能ICå¡
PIN å¦æ˜¯
PINæ•°é‡ä¸€ä¸ªè‹¥å¹²ä¸ª
PINä½æ•°è¾ƒçŸï¼Œå¦‚4ä½äºŒè¿›åˆ¶æ•°è¾ƒé•¿/å¯è‡ªå®šä¹‰ï¼Œå¦‚1~8ä½å进制数
PIN输入错误é™åˆ¶æ¬¡æ•°è¾ƒå°‘,如3次较长/å¯è‡ªå®šä¹‰ï¼Œå¦‚1~15次
PINæž„æˆæ–¹å¼ç¡¬ä»¶è½¯ä»¶æˆ–软硬件共åŒæž„æˆ
全局/局部PIN å¦æ˜¯
å¯ä¿®æ”¹æ€§ç‰å…¶å®ƒå±žæ€§å¦æ˜¯
个人解é”ç (PUC) å¦æ˜¯
PIN应用示æ„图
外部认è¯(External Authentication):ICå¡éªŒè¯åº”用终端的åˆæ³•æ€§ï¼›
相互认è¯(Mutual Authentication):ICå¡å’Œåº”用终端相互验è¯åˆæ³•æ€§ã€‚
由以上论述å¯è§ï¼Œåœ¨å¯¹å®‰å…¨æ€§è¦æ±‚较高的应用(如金èžåº”用)ä¸ï¼Œåªæœ‰ç»¼åˆä½¿ç”¨PIN和安全认è¯æ‰èƒ½æ供较为完善的安全ä¿æŠ¤ã€‚而在一般的ICå¡çš„应用ä¸ï¼Œå¯ä»¥æ ¹æ®å…·ä½“情况优化选择å„ç§å®‰å…¨æŽªæ–½ï¼Œä»¥è¾¾åˆ°å®žçŽ°è¾ƒé«˜æ€§èƒ½ä»·æ ¼æ¯”的目的。
2ã€å†…部é™æ€å®‰å…¨æ•°æ®çš„管ç†
内部é™æ€å®‰å…¨æ•°æ®ä¸»è¦æŒ‡å˜å‚¨äºŽIC å¡å†…部的PINã€PUCã€åŠ 密密钥ã€è§£å¯†å¯†é’¥ç‰é‡è¦æ•°æ®ã€‚ç§°å…¶ä¸ºå†…éƒ¨æ˜¯å› ä¸ºå®ƒä»¬åœ¨åº”ç”¨å‘¨æœŸï¼ˆå¹¶éžæ•´ä¸ªç”Ÿå˜å‘¨æœŸï¼‰ä¸ï¼Œä¸€æ—¦å»ºç«‹å°±ä¸ä¼šåœ¨ICå¡å¤–出现,而åªèƒ½åœ¨å¡çš„å†…éƒ¨ä½¿ç”¨ã€‚è¿™æ ·åšçš„目的当然是为了进一æ¥æ高ICå¡çš„安全性。
在智能ICå¡æ“作系统ä¸ï¼Œä¸“é—¨æä¾›ISF元文件å˜å‚¨è¿™äº›å®‰å…¨æ•°æ®ã€‚一般æ¯ä¸€æ–‡ä»¶å±‚次(æ¯ä¸€åº”用,æŸä¸€DF)å‡æœ‰ä¸€ä¸ªISF元文件å˜å‚¨ç›¸åº”层次(相应应用)的有关安全数æ®ã€‚
ä¸åŒç§ç±»çš„安全数æ®ï¼ˆå¦‚PINï¼ŒåŠ å¯†å¯†é’¥ï¼‰å…·æœ‰ä¸åŒçš„属性åŠåº”用特性。内部é™æ€å®‰å…¨æ•°æ®ç®¡ç†çš„主è¦åŠŸèƒ½å°±æ˜¯å½“æŸä¸€åº”用需è¦æŸä¸€å®‰å…¨æ•°æ®æ—¶æ£€æŸ¥å…¶åˆæ³•æ€§ã€å¯èŽ·å¾—性ç‰ï¼Œå¹¶å…·ä½“执行相应的æ“作。
ä¸åŒçš„智能ICå¡æ“作系统,内部é™æ€å®‰å…¨æ•°æ®çš„管ç†ä¹Ÿä¸å°½ç›¸åŒï¼Œæ„Ÿå…´è¶£çš„人士å¯ä»¥å‚阅有关ISO/IEC 7816æ ‡å‡†åŠç›¸åº”æ“作系统的技术说明书。
三ã€æ™ºèƒ½ICå¡æ“作系统的信æ¯ç»“æž„
在IFDå’ŒICC之间的信æ¯äº¤æ¢æ˜¯å‘½ä»¤-å“应对(Command-Response Pair)结构,如IFDå‘é€ä¸€ä¸ªå‘½ä»¤åˆ°ICC,ICC执行命令并将å“应信æ¯è¿”回给IFDï¼Œå…¸åž‹çš„ä¼ è¾“ç»“æž„è§å›¾9。
IFDå’ŒICC之间的信æ¯ä¼ 输
按有关ISO/IEC 7816æœ‰å…³æ ‡å‡†å®šä¹‰ï¼Œä¸€ä¸ªåº”ç”¨å议数æ®å•å…ƒ(APDU)或者å«æœ‰å‘½ä»¤ä¿¡æ¯(Command Message)或者å«æœ‰å“应信æ¯(Response Message),å¯ä»¥ä»ŽIFDä¼ è¾“åˆ°ICC,å之亦然。其ä¸APDUå¯ä»¥ç†è§£ä¸ºIFDå’ŒICCä¹‹é—´ä¸€æ¬¡é€šè®¯ä¼ è¾“çš„æœ€å°ä¿¡æ¯å•ä½ï¼Œå¦‚æŸä¸€å‘½ä»¤ç‰ã€‚
ä¿¡æ¯ç»“æž„
ä¿¡æ¯ç»“构:按ISO/IEC 7816æœ‰å…³æ ‡å‡†ï¼Œä¿¡æ¯ç»“构有两ç§ï¼šå‘½ä»¤ä¿¡æ¯ç»“æž„ã€å“应信æ¯ç»“构。
--命令信æ¯ç»“æž„
命令信æ¯ç»“构由两部分组æˆï¼š4个å—节的命令头(Header),必备部分;紧接命令头为一长度å¯å˜çš„æ•°æ®ä½“(Body),å¯é€‰ã€‚
命令信æ¯ç»“æž„
Header(命令头) Body(æ•°æ®ä½“)
CLA INS P1 P2 Lc Field Data Field Le Field
命令信æ¯ç»“æž„ä¸æ¯ä¸€å—段å‡å…·æœ‰ä¸åŒå«ä¹‰ã€‚è‹¥Le=0,则为请求相应å“应数æ®çš„最大长度。
命令信æ¯ç»“æž„ä¸çš„å—段å«ä¹‰
å—段å称长度(å—节) å«ä¹‰
CLA 指令类别(CLAss) 1 指令类别
INS 指令ç (INStruction) 1 指令ç
P1 å‚æ•°1(Parameter 1) 1 指令å‚æ•°1
P2 å‚æ•°2(Parameter 2) 1 指令å‚æ•°2
Lcå—段长度å¯å˜ï¼Œâ‰¤3 æ•°æ®å—段的长度
Dataå—段数æ®å¯å˜ï¼Œ=Lc æ•°æ®å—段
Leå—段长度å¯å˜ï¼Œâ‰¤3 预计å“应数æ®çš„最大长度
ä¾æ®ä¸åŒçš„命令,其信æ¯ç»“构也ä¸ç›¸åŒï¼Œä¸€èˆ¬æœ‰ä»¥ä¸‹4ç§ç»“构。
结构1
在结构1ä¸ï¼Œæ²¡æœ‰Lcã€LeåŠDataå—段,既没有éšå‘½ä»¤ä¸€èµ·å‘é€çš„æ•°æ®ï¼Œä¹Ÿæ²¡æœ‰å“应数æ®ã€‚
结构2
在结构2ä¸ï¼ŒLe为空,既没有å“应数æ®ã€‚
结构3
结构3ä¸ï¼ŒLc为空,å³æ²¡æœ‰æ•°æ®å—段。
结构4
在结构4ä¸ï¼Œæ‰€æœ‰å—段å‡å˜åœ¨ã€‚
--å“应信æ¯ç»“æž„
å“应信æ¯ç»“构也由两部分组æˆï¼šå¯å˜é•¿åº¦çš„æ•°æ®ä½“(Body),å¯é€‰ï¼›Â·2å—节的状æ€ä¿¡æ¯(Trailer),必备。
å“应信æ¯ç»“æž„ä¸è‰è¯ä¸åŒå—段的å«ä¹‰è§è¡¨
å—段å称长度(å—节) å«ä¹‰
Dataå—段数æ®å—段å¯å˜ï¼Œ= Lr 实际å“应数æ®é•¿åº¦
SW1 状æ€å—节1 1 命令处ç†çŠ¶æ€ç‰æ•°æ®ä¿¡æ¯
SW2 状æ€å—节2 1 命令处ç†çŠ¶æ€ç‰æ•°æ®ä¿¡æ¯
综上所述,在IFDå’ŒICC实际的通讯过程ä¸ï¼Œå‘½ä»¤-å“应对信æ¯ç»“构具有4ç§ç»„åˆæƒ…况
情况命令数æ®ä¿¡æ¯å“应数æ®ä¿¡æ¯
1 æ— æ•°æ®å—æ®µæ— æ•°æ®å—段
2 有数æ®å—æ®µæ— æ•°æ®å—段
3 æ— æ•°æ®å—段有数æ®å—段
4 有数æ®å—段有数æ®å—段
命令ã€å“应数æ®ä¿¡æ¯ç»“æž„ä¸æœ‰å…³å—段的编ç 规则ã€å…·ä½“应用ç‰ï¼Œè¯·å‚考ISO/IEC 7816æœ‰å…³æ ‡å‡†æˆ–æŸä¸€å…·ä½“智能ICå¡æ“作系统的技术说明书。
命令类型
--é¢å‘æ•°æ®ç®¡ç†çš„命令
é¢å‘æ•°æ®ï¼ˆæˆ–文件)管ç†çš„命令æ供对ä¸åŒç»“æž„çš„æ•°æ®æ–‡ä»¶çš„å˜å–æ“作åŠæŽ§åˆ¶ç‰å‘½ä»¤ï¼Œå…¸åž‹çš„命令如:
·创建文件命令(Create File Command);
·关é—文件命令(Close File Command);
·读二进制数æ®å‘½ä»¤(Read Binary Command);
·写二进制数æ®å‘½ä»¤(Write Binary Command);
Â·åˆ é™¤äºŒè¿›åˆ¶æ•°æ®å‘½ä»¤(Erase Binary Command);
·读记录命令(Read Record Command);
·写记录命令(Write Record Command);
Â·åˆ é™¤è®°å½•å‘½ä»¤(Erase Record Command);
·选择文件命令(Select File Command);ç‰ã€‚
--命令类型--é¢å‘é€šè®¯ä¼ è¾“çš„å‘½ä»¤
在ISO/IEC 7816æ ‡å‡†ä¸è¿˜ç‰¹åˆ«å®šä¹‰äº†ä¸¤ä¸ªé¢å‘é€šè®¯ä¼ è¾“çš„å‘½ä»¤:
获å–å“应命令(Get Response Command)ï¼›
包装命令(Envelope Command)。
åœ¨æ ‡å‡†çš„å‘½ä»¤è¯´æ˜Žä¸æŒ‡å‡ºï¼Œå½“ä¸èƒ½ç”¨å·²çŸ¥åè®®ä¼ è¾“å‘½ä»¤æˆ–å“应数æ®ä¿¡æ¯æ—¶å¯ä»¥ä½¿ç”¨è¿™ä¸¤ä¸ªå‘½ä»¤è¿›è¡Œæœ‰å…³ä¿¡æ¯çš„ä¼ è¾“ã€‚è¿™ä¸¤ä¸ªå‘½ä»¤å‡ç”±IFDåˆå§‹å¯åŠ¨ï¼ŒèŽ·å–å“应命令用于从ICC到IFDæ–¹å‘ä¿¡æ¯çš„ä¼ è¾“ï¼ŒåŒ…è£…å‘½ä»¤ç”¨äºŽä»ŽIFD到ICCæ–¹å‘ä¿¡æ¯çš„ä¼ è¾“ã€‚
--é¢å‘安全控制管ç†çš„命令
内部认è¯å‘½ä»¤(Internal Authenticate Command)ï¼›
外部认è¯å‘½ä»¤(External Authenticate Command)ï¼›
相互认è¯å‘½ä»¤(Mutual Authenticate Command)ï¼›
生æˆéšæœºæ•°å‘½ä»¤(Create Random Number Command)ï¼›
PINæ ¡éªŒå‘½ä»¤(PIN Verify Command)ï¼›
安全数æ®æŽ§åˆ¶ç®¡ç†æŒ‡ä»¤ç±»ï¼ˆæ˜¯ä¸€å°ç±»æŒ‡ä»¤ï¼Œä¸»è¦ç”¨äºŽå¯†é’¥ã€PINã€PUCç‰å®‰å…¨æ•°æ®çš„生æˆã€åˆ 除ã€çŠ¶æ€æŸ¥è¯¢ç‰ï¼Œåœ¨ä¸åŒçš„æ“作系统的具体实现上差别很大)。
--éƒ¨åˆ†æ ‡å‡†æŒ‡ä»¤
指令指令ç (INS)(åå…进制) 说明
Erase Binary 0E åˆ é™¤äºŒè¿›åˆ¶æ•°æ®å‘½ä»¤
Verify 20 PINæ ¡éªŒå‘½ä»¤
Extemal Authenticate 82 外部认è¯å‘½ä»¤
Internal Authenticate 88 内部认è¯å‘½ä»¤
Select File A4 文件选择命令
Read Binary B0 读二进制数æ®å‘½ä»¤
Read Record(s) B2 读记录命令
Get Response C0 获å–å“应命令
Envelope C2 包装命令
Write Binary D0 写二进制数æ®å‘½ä»¤
Write Record D2 写记录命令
智能å¡èŠ¯ç‰‡æ“作系统STARCOS
智能å¡èŠ¯ç‰‡æ“作系统STARCOS(Smart Cark Chip Operation System)是由德国G&Då…¬å¸å’ŒGMDå…¬å¸åˆä½œå¼€å‘的智能å¡å¡ç‰‡çº§çš„一个完整的æ“作系统。它æ供适åˆå…·ä½“应用的æ“作和管ç†çš„20ä½™æ¡æŒ‡ä»¤ï¼Œè€Œä¸”å…¶é€æ˜Žçš„结构使得用户å¯ä»¥é›†æˆè‡ªå®šä¹‰çš„指令。该æ“作系统åŒæ ·å¾ˆå¥½åœ°è€ƒè™‘了与现有的和将æ¥çš„ISOæ ‡å‡†çš„å…¼å®¹æ€§ï¼ˆISO/IEC CD 7816。4/Sept.1992)。
Giesecke&Derient是德国最大的å¡ç‰‡ç”Ÿäº§åŽ‚家,一个åŠä¸–纪以æ¥ï¼Œä»¥é¢†å…ˆçš„钞票å°åˆ·å’Œè‡ªåŠ¨åˆ†æ¸…技术为全世界四å多个国家的ä¸å¤®é“¶è¡ŒæœåŠ¡ã€‚
在ä¸å›½ï¼ŒG&Dä¿
Ningbo XISXI E-commerce Co., Ltd , https://www.petspetsaccessories.com