Electronic information storage medium, IC chip, IC card, command processing method, and program for electronic information storage medium
The IC card system addresses unexpected commands from general-purpose OS by implementing command discrimination and response mechanisms to ignore or process commands without changing its state, ensuring error-free processing.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- DAI NIPPON PRINTING CO LTD
- Filing Date
- 2024-10-07
- Publication Date
- 2026-04-17
AI Technical Summary
IC cards can experience unexpected operations when connected to external terminal devices with general-purpose OS, leading to potential errors due to commands received at unexpected timings.
The system includes command receiving, discrimination, and response mechanisms in IC cards to identify and handle predetermined commands, allowing the IC card to ignore or process them without changing its state, ensuring error-free processing.
This approach prevents corruption of the IC card's state by unexpected commands, enabling error-free processing of requests from terminal devices.
Smart Images

Figure 2026066883000001_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical fields of electronic information storage media, IC chips, IC cards, command processing methods, and programs for electronic information storage media.
Background Art
[0002] An IC card is connected to an external terminal device such as a dedicated terminal or a personal computer, receives commands from the terminal device, and returns responses for use in safe storage of data and cryptographic operations, etc. For example, in Patent Document 1, based on the result of comparison between first date information stored in a memory and second date information obtained by analyzing a command received from an external device, it is determined whether to execute data appending processing to the memory based on the command. When the second date information is newer than the first date information, the appending processing is executed, a response to the command is generated, and the generated response is transmitted to the external device. A portable electronic device is disclosed.
Prior Art Documents
Patent Documents
[0003]
Patent Document 1
Summary of the Invention
Problems to be Solved by the Invention
[0004] However, when a general-purpose OS (Operating System) is installed in an external terminal device, commands may be sent from the general-purpose OS at a timing not assumed by the issuer of the IC card. When such a command is received, there is a risk that the IC card may cause an unexpected operation during processing, such as in the middle of a sequence spanning a plurality of commands requested from an application of the terminal device.
[0005] Therefore, the present invention has been made in view of the above problems, and aims to provide an electronic information storage medium, etc., that can process requests from applications of terminal devices to which IC cards are connected without causing errors. [Means for solving the problem]
[0006] To solve the above problems, the invention described in claim 1 is an electronic information storage medium capable of communicating with a terminal device, comprising: command receiving means for receiving commands from the terminal device; command discrimination means for determining whether the received command is a predetermined command; and response means for responding to the terminal device without performing processing according to the received command and without changing the state of the electronic information storage medium, or performing processing according to the received command and changing the state and responding to the terminal device.
[0007] The invention described in claim 2 is characterized in that, in the electronic information storage medium described in claim 1, the predetermined command is an ignore command that is ignored so as not to perform processing according to the command, and the response means, when the received command is the ignore command, responds to the terminal device without performing processing according to the received command and without changing the state of the electronic information storage medium.
[0008] The invention described in claim 3 is characterized in that, in the electronic information storage medium described in claim 1 or claim 2, the predetermined command is a corresponding command which is part of a series of commands that need to be processed sequentially in the electronic information storage medium, and the response means, if the received command is not the corresponding command, does not perform processing according to the received command and does not change the state of the electronic information storage medium, and responds to the terminal device.
[0009] The invention described in claim 4 is characterized in that the electronic information storage medium described in claim 1 or claim 2 further comprises command registration means for pre-registering a predetermined command and a response in which no processing is performed in accordance with the received command and the state of the electronic information storage medium is not changed.
[0010] The invention described in claim 5 is an IC chip capable of communicating with a terminal device, comprising: command receiving means for receiving commands from the terminal device; command discrimination means for determining whether the received command is a predetermined command; and response means for responding to the terminal device without performing processing according to the received command and without changing the state of the IC chip, or performing processing according to the received command and changing the state and responding to the terminal device. It is characterized by having the following features.
[0011] The invention described in claim 6 is an IC card capable of communicating with a terminal device, comprising: command receiving means for receiving commands from the terminal device; command determination means for determining whether the received command is a predetermined command; and response means for responding to the terminal device without performing processing according to the received command and without changing the state of the IC card, or performing processing according to the received command and changing the state and responding to the terminal device. It is characterized by having the following features.
[0012] The invention described in claim 7 is a command processing method for an electronic information storage medium capable of communicating with a terminal device, characterized by comprising: a command reception step of receiving a command from the terminal device; a command determination step of determining whether the received command is a predetermined command; and a response step of responding to the terminal device in accordance with the determination, without performing processing according to the received command and without changing the state of the electronic information storage medium, or performing processing according to the received command and changing the state and responding to the terminal device.
[0013] The invention described in claim 8 is a program for an electronic information storage medium capable of communicating with a terminal device, characterized in that a computer functions as a command receiving means for receiving commands from the terminal device, a command discrimination means for determining whether the received command is a predetermined command, and a response means for responding to the terminal device without performing processing according to the received command and without changing the state of the electronic information storage medium, or performing processing according to the received command and changing the state and responding to the terminal device. [Effects of the Invention]
[0014] According to the present invention, in an electronic information storage medium capable of communicating with a terminal device, a command is received from the terminal device, the received command is determined to be a predetermined command, and depending on the determination, the electronic information storage medium responds to the terminal device without performing processing according to the received command and without changing the state of the electronic information storage medium, or it responds to the terminal device after performing processing according to the received command and changing the state. By not changing the state of the electronic information storage medium in response to the determination of a predetermined command, the state is not corrupted by unexpected commands, and therefore, processing requested by the application of the terminal device to which the IC card is connected can be processed without errors. [Brief explanation of the drawing]
[0015] [Figure 1] This is a schematic diagram showing an example of the overall configuration of the IC card processing system according to this embodiment. [Figure 2] An example of the general configuration of an IC chip is shown in block 1. [Figure 3A] This is a schematic diagram showing an example of an IC card database. [Figure 3B] This is a schematic diagram showing an example of an IC card database. [Figure 4] This is a block diagram showing an example of the overall configuration of a terminal device. [Figure 5A] This is a schematic diagram showing an example of the configuration of a registration command for registering ignore commands. [Figure 5B] It is a schematic diagram showing an example of the configuration of a ignore command. [Figure 6] It is a flowchart showing an example of the operation of the registration process of the ignore command. [Figure 7] It is a sequence diagram showing an example of the operation of an IC card processing system. [Figure 8] It is a schematic diagram showing an example of the transition of the state of an IC card. [Figure 9] It is a flowchart showing an example of the operation of the processing of an IC card. [Figure 10] It is a flowchart showing a first modification example of the operation of the processing of an IC card. [Figure 11] It is a flowchart showing a second modification example of the operation of the processing of an IC card. [Embodiments for Carrying Out the Invention]
[0016] Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. The embodiments described below are embodiments when the present invention is applied to an IC card processing system.
[0017] [1. Outline Configuration of IC Card Processing System S] (1.1 Configuration and Functions of IC Card Processing System S) First, referring to the drawings and the like, the outline configuration of the IC card processing system S according to the present embodiment will be described. FIG. 1 is a schematic diagram showing an example of the outline configuration of the IC card processing system according to the present embodiment. <00001IC cards 5 include, for example, authentication cards for logging into PC terminals connected to local networks via a reader / writer, cash cards for ATMs (Automatic Teller Machines), credit cards for shopping, cards for Electronic Toll Collection (ETC) systems on toll roads, cards for electronic money as an example of a payment service, cards for public transport tickets, and My Number cards for identity verification.
[0020] The terminal device 20 may be, for example, a PC terminal, an ATM device, or a payment terminal. The terminal device 20 also includes a configuration terminal for initializing the IC card 5.
[0021] The IC card 5 and the terminal device 20 are connected by a contact-type reader / writer and / or a contactless reader / writer provided in the terminal device 20.
[0022] In the case of contact-type communication, where communication is performed via contact connection, the IC card 5 has connection terminals. In the case of contactless communication, where communication is performed via wireless communication, the IC card 5 has an antenna and is capable of short-range wireless communication with the terminal device 20. Technologies such as NFC (Near Field Communication), Bluetooth (registered trademark), or UWB (Ultra Wide Band) are used for short-range wireless communication. The IC card 5 may have connection terminals and an antenna to support both contact-type and contactless communication.
[0023] (1.2 Overview of IC Chip 10) Next, the configuration and function of the IC chip 10 will be explained using diagrams. Figure 2 is a block diagram showing an example of the overall configuration of the IC chip 10. Figures 3A and 3B are schematic diagrams showing an example of an IC card database.
[0024] As shown in Figure 2, the IC chip 10 is composed of a processor 11, RAM (Random Access Memory) 12, ROM (Read Only Memory) 13, NVM (Nonvolatile Memory) 14, and I / O 15, etc.
[0025] The processor 11 executes the computer program implemented in the IC card 5 and controls the overall operation of the IC card 5. The processor 11 performs various processes according to the program stored in the ROM 13 or NVM 14. For example, the processor 11 performs predetermined processing in response to a command received from the terminal device 20 and transmits a response as a result of the processing to the terminal device 20.
[0026] RAM12 will be the main memory for IC card 5.
[0027] ROM13 stores control programs and other information in advance.
[0028] NVM14 is a non-volatile memory that can be written to and rewritten, such as an EEPROM or flash ROM. A database necessary for processing by the processor 11 is formed in NVM14.
[0029] I / O15 is the interface used when communicating with the front-end reader / writer. In the case of contact-type communication, I / O15 is connected to the connection terminal of IC card 5. In the case of contactless communication, I / O15 is connected to the antenna of IC card 5.
[0030] ROM13 or NVM14 stores various software such as the card OS (Operating System) and applications. For example, this software provides memory management for the memory of the IC chip 10, a secure execution environment for applications, and transmission control (communication compliant with ISO / IEC 7816) when communicating with the front end using the I / O 15 of the IC chip 10. Through this software, security functions such as encryption key management, cryptographic calculations using encryption keys, and digital signature generation / verification functions are realized on the IC chip 10.
[0031] RAM12 or NVM14 temporarily stores information indicating the processing status of commands received from the connected terminal device 20, as an example of the state of the IC card 5 or IC chip 10 (an example of the state of the electronic information storage medium). For example, as shown in Figure 3A, command identification information that identifies the command received from the terminal device 20 and command identification information for the next expected command are recorded.
[0032] Here, command-specific information refers to values such as CLA (class byte) indicating the command hierarchy, INS (instruction byte) indicating the command type, P1 and P2 indicating parameters corresponding to INS, Lc (length field for coding number Nc) indicating the length of the command's Data, and Data (command data field) indicating the command's data body. The header of a command APDU consists of CLA, INS, P1, and P2. The body of a command APDU consists of optional Lc, Data, etc.
[0033] Each command is identified by command-specific information such as CLA, INS, P1, and P2. Each response is identified by response-specific information such as SW (Status word).
[0034] ROM13 or NVM14 stores programs for processing these commands, APDU response information, and authentication data used for mutual authentication to establish a secure channel (e.g., a key set including a secure channel encryption key, a secure channel MAC key, and a data encryption key).
[0035] Furthermore, NVM14 has a list of ignore commands (an example of a predetermined command) that are ignored so as not to be processed according to the command. As shown in Figure 3B, the command identification information of the command to be ignored and the response identification information of how to respond to the ignored command are stored together in association.
[0036] (1.3 Configuration and functions of terminal device 20) Next, the configuration and functions of the terminal device 20 will be explained using Figure 4. Figure 4 is a block diagram showing an example of the general configuration of the terminal device.
[0037] As shown in Figure 4, the terminal device 20 comprises a communication unit 21, a storage unit 22, a display unit 23, an operation unit 24, a control unit 25, and an input / output interface unit 26. The control unit 25 and the input / output interface unit 26 are connected via a system bus 27.
[0038] The communication unit 21 has wired and / or wireless reader / writer functionality for the IC card 5. The communication unit 21 controls communication with the IC card 5.
[0039] The storage unit 22 is composed of, for example, a hard disk drive, a silicon disk drive, etc. The storage unit 22 stores the terminal's operating system (terminal OS) and applications (terminal AP). The applications include mutual authentication processing programs, key generation programs, signature verification programs, data encryption programs, certificate management programs, etc.
[0040] The storage unit 22 stores authentication data (for example, a key set including a secure channel encryption key, a secure channel MAC key, and a data encryption key) used for mutual authentication processing to establish a secure channel with the IC card 5.
[0041] The display unit 23 is composed of, for example, a liquid crystal display element or an organic EL (Electro-Luminescence) element. The operation unit 24 is composed of, for example, a keyboard and a mouse.
[0042] The control unit 25 includes, for example, a CPU, ROM, and RAM. The control unit 25 reads and executes various programs stored in the ROM, RAM, and memory unit 22 using the CPU. For example, the control unit 25 performs mutual authentication processing to establish a secure session with the IC card 5 according to a mutual authentication processing program.
[0043] The input / output interface unit 26 is the interface between the communication unit 21 and the storage unit 22 and the control unit 25.
[0044] [2. Operation of IC card processing system S] Next, the operation of the IC card processing system S will be explained using diagrams.
[0045] (2.1 Operation of the process for registering ignore commands) First, the operation of the process of registering ignore commands between the IC card 5 and each terminal device 20, 30 will be explained using diagrams. Figure 5A is a schematic diagram showing an example of the configuration of a registration command for registering ignore commands. Figure 5B is a schematic diagram showing an example of the configuration of an ignore command. Figure 6 is a flowchart showing an example of the operation of the ignore command registration process.
[0046] First, after the IC card 5 is connected to the reader / writer of the terminal device 20 for configuring the IC card 5, an application for registering ignore commands is launched on the terminal device 20. Command identification information for the ignore command to be registered is input from the operation unit 24 of the terminal device 20. The terminal device 20 generates an ignore command registration command 30 and sends it to the IC card 5.
[0047] Here, as shown in Figure 5A, the registration command 30 has a header section 31 of the registration command and an ignore command section 32 that indicates the ignore command and the corresponding SW (Status word). As shown in Figure 5B, the ignore command section 32 has a command identification section 33 that identifies the ignore command and a corresponding SW 34 that indicates the response when an ignore command is received. The ignore command is a command issued from the terminal OS of the terminal device 20 to the IC card 5. For example, it is a Select command in which the terminal OS selects the IC card 5. Note that the Select command has patterns with and without DATA, as shown in Figure 5B.
[0048] Next, as shown in Figure 6, the IC card 5 receives a command to register an ignore command (step S1). Specifically, the IC chip 10 receives the command to register an ignore command 30 from the configuration terminal device 20.
[0049] Next, the IC card 5 updates the ignore command list (step S2). Specifically, as shown in Figure 3B, the IC chip 10 adds command identification information (command identification unit 33) and response identification information (corresponding SW 34) to the ignore command section 32 of the received registered command 30. Note that "Command A," "Command B," and "Command C" are handled by the command identification unit 33, while "Response A," "Response B," and "Response C" are handled by the corresponding SW 34.
[0050] Next, the IC card 5 transmits SW (step S3). Specifically, after registering the ignore command, the IC chip 10 transmits SW, such as a message indicating successful processing, to the application on the terminal device 20 for registering the ignore command.
[0051] Next, the IC card 5 terminates command processing (step S4). Specifically, the IC chip 10 finishes registering one ignore command and enters a wait state.
[0052] Steps S1 to S3 are repeated for each ignore command to be registered. As described above, ignore commands are registered in advance before the IC card 5 is issued.
[0053] (2.2 Operation of IC card processing in this embodiment) Next, the operation of the IC card processing in this embodiment will be explained with reference to the figures. Figure 7 is a sequence diagram showing an example of the operation of the IC card processing system. Figure 8 is a schematic diagram showing an example of the state transition of the IC card. Figure 9 is a flowchart showing an example of the operation of the IC card processing.
[0054] First, after the IC card 5 is connected to the reader / writer of the terminal device 20, such as a PC terminal, a predetermined application (terminal AP) is launched on the terminal device 20. The terminal device 20 then sends commands corresponding to the terminal AP to the IC card 5.
[0055] The commands sent here are, for example, some commands in a group of commands that complete processing over multiple attempts, or commands that take a long time to process. A group of commands is used when processing large amounts of data. Examples of such commands include UPDATE commands for updating data, WRITE commands for writing large amounts of data, PUT DATA commands used to store one or more data items, and Perform Security Operation commands used when handling digital certificates. Examples of commands that take a long time to process include key generation commands (GENERATE ASYMMETRIC KEY PAIR) and commands that perform cryptographic calculations (commands that complete processing over multiple attempts, Perform Security Operation).
[0056] For example, if processing is completed in three separate commands, as shown in Figure 7, each command in the command group is sent from the terminal AP of the terminal device 20 via the terminal OS, divided into "Command 1 / 3", "Command 2 / 3", and "Command 3 / 3".
[0057] If IC card 5 supports command chaining, the 5th bit of the CLA byte for "command 1 / 3" and "command 2 / 3" may be set to "1" because there are subsequent commands, and the 5th bit of the CLA byte for "command 3 / 3" may be set to "0" because there are no subsequent commands. Also, if a command is part of a command group that is completed by multiple commands, or if it is a command that takes a long time to process, the terminal device 20 may send a message to IC card 5 in advance indicating that such a command will be sent next. In this case, as shown in Figure 8, the state of IC card 5 in RAM 12 or NVM 14 will be state a, with the received command column showing "none" and the next expected command column showing "command 1 / 3". These command columns may contain command identification information, or they may simply be indicated by 0 or 1 to indicate presence or absence. Alternatively, the terminal device 20 may send information to IC card 5 in advance indicating that it will send the three commands "command 1 / 3", "command 2 / 3", and "command 3 / 3".
[0058] Next, as shown in Figure 9, the IC card 5 receives a command (step S10). Specifically, the IC chip 10 receives a command from the terminal device 20. As shown in Figure 7, this command may come from the terminal AP of the terminal device 20 or from the terminal OS of the terminal device 20.
[0059] Thus, the IC card 5 and the IC chip 10 function as an example of command receiving means for receiving commands from the terminal device.
[0060] Next, the IC card 5 determines whether or not it is an ignore command (step S11). Specifically, the IC chip 10 reads the command identification information of the received command, refers to the ignore command list of the NVM 14, compares the command identification information of the received command with the command identification information of the ignore command list, and determines whether or not it is an ignore command.
[0061] More specifically, as shown in Figure 7, when the terminal AP of the terminal device 20 sends "command 1 / 3", "command 2 / 3", "command 3 / 3", or "command 4" and the IC card 5 receives it, the IC chip 10 determines that it is not a command to ignore.
[0062] On the other hand, as shown in Figure 7, when the terminal OS of the terminal device 20 sends "command A" or "command B" and the IC card 5 receives it, the IC chip 10 determines that it is a command to ignore.
[0063] Thus, the IC card 5 and the IC chip 10 function as an example of a command determination means that determines whether the received command is a predetermined command.
[0064] If the command is not ignored (step S11; NO), the IC card 5 transmits the processing result and SW (step S12). Specifically, the IC chip 10 processes according to the received command, transmits the processing result and SW to the terminal device 20, and changes the state of the IC card 5.
[0065] Here, we will explain the state transitions of IC card 5. As shown in Figure 7, when IC card 5 receives "command 1 / 3", IC chip 10 reads the 5th bit of the CLA byte of "command 1 / 3", which is "1". As shown in Figure 8, it writes the command identification information of "command 1 / 3" to the received command field and writes the command identification information of "command 1 / 3" as "command 2 / 3" to the next expected command field. In this way, the state of IC card 5 or IC chip 10 changes from state a to state b. Next, when IC card 5 receives "command 2 / 3", IC chip 10 reads the 5th bit of the CLA byte of "command 2 / 3", which is "1". As shown in Figure 8, it writes the command identification information of "command 2 / 3" to the received command field and writes the command identification information of "command 2 / 3" as "command 3 / 3" to the next expected command field, and the state of IC card 5 or IC chip 10 changes from state b to state c. Next, when IC card 5 receives "command 3 / 3", IC chip 10 reads the 5th bit of the CLA byte of "command 2 / 3", which is "0". As shown in Figure 8, it writes the command identification information of "command 3 / 3" to the received command field, writes a blank or "0" to the next expected command field, and the state of IC card 5 or IC chip 10 changes from state c to state d.
[0066] Furthermore, if the IC chip 10 does not need to respond with a processing result, it will only transmit SW.
[0067] Thus, the IC card 5 and IC chip 10 function as examples of response means that, in response to the determination, either respond to the terminal device without performing processing according to the received command and without changing the state of the electronic information storage medium (the state of the IC chip or the state of the IC card), or respond to the terminal device after performing processing according to the received command and changing the state.
[0068] If it is an ignore command (step S11; YES), the IC card 5 maintains its state and responds with the corresponding SW (step S13). For example, as shown in Figure 7, if it is an ignore command "command A", the IC chip 10 does not execute "command A" and does not change the current state c. The IC chip 10 then refers to the ignore command list of the NVM 14, reads the corresponding response "response A" for the ignore command "command A", and sends it to the terminal device 20.
[0069] Furthermore, as shown in Figure 7, if the terminal device 20 receives an ignore command "Command B" while processing "Command 4" from the terminal AP, the IC chip 10 does not execute "Command B" and does not change its current state. The IC chip 10 then refers to the ignore command list of the NVM 14, reads the corresponding response "Response B" for the ignore command "Command B", and transmits it to the terminal device 20.
[0070] Thus, the IC card 5 and IC chip 10 function as an example of a response means that, depending on the determination, responds to the terminal device without performing processing according to the received command and without changing the state of the electronic information storage medium (the state of the IC chip or the state of the IC card), or performs processing according to the received command and changes the state and responds to the terminal device. Furthermore, if the received command is an ignore command, the IC card 5 and IC chip 10 function as an example of a response means that responds to the terminal device without performing processing according to the received command and without changing the state of the electronic information storage medium (the state of the IC chip or the state of the IC card).
[0071] After processing in step S12 or step S13, the IC card 5 terminates command processing (step S14). Specifically, the IC chip 10 finishes processing the received command and waits for the next command from the terminal device 20.
[0072] As described above, when the terminal device 20 receives "command 1 / 3", "command 2 / 3", "command 3 / 3", and "command 4" from the terminal AP, the IC chip 10 performs the processing from steps S10 to S14. However, if an ignore command is received in the middle of a series of commands such as "command 1 / 3", "command 2 / 3", and "command 3 / 3", or if an ignore command is received in the middle of processing, such as "command 4", the processing in step S13 is performed.
[0073] As described above, according to the above embodiment, the IC card 5 (or IC chip 10) that can communicate with the terminal device 20 receives a command from the terminal device 20, determines whether the received command is a predetermined command, and responds to the terminal device 20 without changing the state of the IC card 5 (or IC chip 10) by not performing processing according to the received command, or by changing the state by performing processing according to the received command and responding to the terminal device 20. By not changing the state of the IC card 5 (or IC chip 10) in response to the determination of a predetermined command, the state is not corrupted by unexpected commands, and the processing requested by the application of the terminal device 20 to which the IC card 5 is connected can be processed without errors. As shown in Figure 7, the processing sequence for the command group is not disrupted, and processing can be performed without interruption or errors.
[0074] If a given command is an ignore command that is ignored so as not to perform processing according to the command, and the received command is an ignore command, then by ignoring the processing according to the received command and responding to the terminal device 20 without changing the state of the IC card 5 (or IC chip 10), the processing requested by the application of the terminal device 20 can be processed without error by ignoring the processing of the ignore command and not changing the state.
[0075] If a predetermined command and a response indicating that the state of the IC card 5 (or IC chip 10) will not be changed without performing processing according to the received command are registered in association beforehand, then when the state of the IC card 5 (or IC chip 10) will not be changed without performing processing according to the received command, the terminal OS of the terminal device 20 can respond, and the processing requested by the application of the terminal device 20 can be processed without errors.
[0076] (First variation) Next, a first modified example of the operation of the IC card 5 will be described with reference to a diagram. Note that the same reference numerals will be used for parts that are the same as or corresponding to the above embodiment, and only the different configurations and operations will be described. The same applies to other embodiments and modified examples.
[0077] Figure 10 is a flowchart showing a first modified example of the operation of the IC card 5.
[0078] As shown in Figure 10, the IC card 5 receives a command (step S20). Specifically, as in step S10, the IC chip 10 receives a command from the terminal device 20.
[0079] Next, the IC card 5 determines whether or not it is a corresponding command (step S21). Specifically, the IC chip 10 reads the command identification information of the received command, and in the RAM 12 or NVM 14, it refers to the state of the IC card 5 and compares the command identification information of the received command with the command identification information of the "next expected command" to determine whether or not it is a corresponding command (an example of a predetermined command). A corresponding command is part of a series of commands that need to be processed sequentially in the electronic information storage medium (IC chip 10 or IC card 5).
[0080] In the case of "Command 4" in Figure 7, the RAM 12 or NVM 14 may store the state of the IC card 5 or IC chip 10, indicating whether the command is being processed or has finished. By referring to the state of the IC card 5 or IC chip 10, the IC chip 10 may determine that it is not a corresponding command if the command is being processed, and determine that it is a corresponding command if the command processing has finished. Thus, a corresponding command may be a command that is determined by whether or not it is being processed.
[0081] If the command is correct (step S21; YES), the IC card 5 transmits the processing result and SW (step S22). Specifically, as in step S12, the IC chip 10 processes the received command, transmits the processing result and SW to the terminal device 20, and changes the state of the IC card 5.
[0082] If the command is not compatible (step S21; NO), the IC card 5 maintains its state and responds with a predetermined switch (step S23). Specifically, the IC chip 10 does not execute the received command and does not change the current state of the IC card 5 or the IC chip 10. The IC chip 10 then sends an APDU response to the terminal device 20 as the predetermined switch, indicating command failure such as "Command is not permitted."
[0083] Thus, the IC card 5 and IC chip 10 function as an example of a response means that, when the received command is not the corresponding command, does not perform processing according to the received command and does not change the state of the electronic information storage medium (the state of the IC chip or the state of the IC card) in response to the terminal device.
[0084] After processing in step S22 or step S23, the IC card 5 terminates command processing as in step S14 (step S24).
[0085] According to the above modified example, if a predetermined command is a corresponding command that is part of a series of commands that need to be processed sequentially on the IC card 5 (or IC chip 10), and the received command is not a corresponding command, then by not performing processing according to the received command and responding to the terminal device 20 without changing the state of the IC card 5 (or IC chip 10), the processing requested by the application on the terminal device 20 can be processed without errors by ignoring the processing of commands other than the corresponding command and not changing the state. Furthermore, processing requested by the application on the terminal device 20 can be processed without errors even without registering ignore commands.
[0086] (Second variation) Next, a second modified example of the operation of the IC card 5 will be explained with reference to a diagram. This is an operation that combines the operation of the IC card 5 in this embodiment with the first modified example of the operation of the operation in this embodiment.
[0087] Figure 11 is a flowchart showing a second modified example of the operation of the IC card 5.
[0088] As shown in Figure 11, the IC card 5 receives a command (step S30). Specifically, as in step S10, the IC chip 10 receives a command from the terminal device 20.
[0089] Next, IC card 5 determines whether or not it is an ignore command, as in step S11 (step S31).
[0090] If it is an ignore command (step S31; YES), IC card 5 maintains its state as in step S13 and responds to the corresponding SW (step S32).
[0091] If it is not an ignore command (step S31; NO), IC card 5 determines whether it is a corresponding command, as in step S21 (step S33).
[0092] If the command is not a corresponding one (step S33; NO), the IC card 5 maintains its state as in step S23 and responds to the predetermined SW (step S34).
[0093] If it is a corresponding command (step S33; YES), IC card 5 transmits the processing result and SW as in step S12 (step S35).
[0094] After processing in step S32, step S34, or step S35, the IC card 5 terminates command processing as in step S14 (step S36).
[0095] Note that the order of steps S31 and S33 can be reversed.
[0096] According to the above modification, a response corresponding to the ignore command can be made to the ignore command, and even if the command is from a terminal OS that is not registered as an ignore command, the processing requested by the application of the terminal device 20 can be processed without causing an error. [Explanation of Symbols]
[0097] 5: IC card 10. IC chip (electronic information storage medium) 20: Terminal device
Claims
1. In an electronic information storage medium capable of communicating with a terminal device, Command receiving means for receiving commands from the aforementioned terminal device, A command determination means for determining whether the received command is a predetermined command, A response means that, in accordance with the determination, responds to the terminal device without performing processing according to the received command and without changing the state of the electronic information storage medium, or responds to the terminal device after performing processing according to the received command and changing the state, An electronic information storage medium characterized by having the following features.
2. In the electronic information storage medium described in claim 1, The aforementioned predetermined command is an ignore command that ignores the command so as not to perform the processing according to the command. An electronic information storage medium characterized in that, when the response means is the ignored command, it does not perform any processing according to the received command and does not change the state of the electronic information storage medium, and responds to the terminal device.
3. In the electronic information storage medium according to claim 1 or claim 2, The predetermined command is a corresponding command that is part of a series of commands that need to be processed sequentially in the electronic information storage medium. An electronic information storage medium characterized in that, if the response means does not receive a command that is not the corresponding command, it does not perform any processing according to the received command and does not change the state of the electronic information storage medium, and responds to the terminal device.
4. In the electronic information storage medium according to claim 1 or claim 2, An electronic information storage medium further comprising command registration means for pre-registering, in association with a predetermined command and a response in which no processing is performed according to the received command and the state of the electronic information storage medium is not changed.
5. In an IC chip capable of communicating with a terminal device, Command receiving means for receiving commands from the aforementioned terminal device, A command determination means for determining whether the received command is a predetermined command, A response means that, in accordance with the determination, responds to the terminal device without performing processing according to the received command and without changing the state of the IC chip, or performs processing according to the received command and changes the state and responds to the terminal device; An IC chip characterized by having the following features.
6. In an IC card capable of communicating with a terminal device, Command receiving means for receiving commands from the aforementioned terminal device, A command determination means for determining whether the received command is a predetermined command, A response means that, in accordance with the determination, responds to the terminal device without performing processing according to the received command and without changing the state of the IC card, or responds to the terminal device after performing processing according to the received command and changing the state, An IC card characterized by having the following features.
7. In a command processing method for an electronic information storage medium capable of communicating with a terminal device, A command reception step in which a command is received from the terminal device, A command determination step to determine whether the received command is a predetermined command, A response step in which, in accordance with the determination, the system responds to the terminal device without performing any processing according to the received command and without changing the state of the electronic information storage medium, or performs any processing according to the received command and changes the state and responds to the terminal device; A command processing method characterized by including the following.
8. In a program for an electronic information storage medium capable of communicating with a terminal device, Computers, Command receiving means for receiving commands from the terminal device, A command determination means for determining whether the received command is a predetermined command, and A program for an electronic information storage medium, characterized in that, in response to the aforementioned determination, it functions as a response means to either respond to the terminal device without performing processing according to the received command and without changing the state of the electronic information storage medium, or to perform processing according to the received command and change the state and respond to the terminal device.
Citation Information
Patent Citations
Portable electronic device and method of controlling portable electronic device
JP2014139803A