JP5214291B2 - IC card and IC card control method - Google Patents

IC card and IC card control method Download PDF

Info

Publication number
JP5214291B2
JP5214291B2 JP2008071712A JP2008071712A JP5214291B2 JP 5214291 B2 JP5214291 B2 JP 5214291B2 JP 2008071712 A JP2008071712 A JP 2008071712A JP 2008071712 A JP2008071712 A JP 2008071712A JP 5214291 B2 JP5214291 B2 JP 5214291B2
Authority
JP
Japan
Prior art keywords
file
command
access
channel
priority
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2008071712A
Other languages
Japanese (ja)
Other versions
JP2009230214A (en
JP2009230214A5 (en
Inventor
厚志 高橋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toshiba Corp
Original Assignee
Toshiba Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Toshiba Corp filed Critical Toshiba Corp
Priority to JP2008071712A priority Critical patent/JP5214291B2/en
Priority to SG200806667-2A priority patent/SG151197A1/en
Priority to US12/205,235 priority patent/US20090083273A1/en
Priority to FR0856176A priority patent/FR2923630B1/en
Publication of JP2009230214A publication Critical patent/JP2009230214A/en
Publication of JP2009230214A5 publication Critical patent/JP2009230214A5/ja
Application granted granted Critical
Publication of JP5214291B2 publication Critical patent/JP5214291B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

この発明は、例えば、制御素子、通信インターフェース、不揮発性メモリなどを有するICチップが内蔵されたICカード、および、ICカードの制御方法に関する。 The present invention relates to an IC card incorporating an IC chip having a control element, a communication interface, a nonvolatile memory, and the like , and a method for controlling the IC card , for example.

一般に、携帯可能電子装置としてのICカードは、プラスチックなどで形成されたカード状の筐体内に制御素子及び各種メモリなどを有するICチップが埋め込まれている。このようなICカード内の不揮発性メモリには、種々のアプリケーションプログラム、データファイルなどが格納されている。このようなICカードでは、外部装置から与えられるコマンドの処理方法として、論理チャネルという機能を有するものがある。論理チャネルの機能を有するICカードでは、各論理チャネルでそれぞれ別の系統の処理を並列的に実施できる。   In general, an IC card as a portable electronic device has an IC chip having a control element and various memories embedded in a card-like casing made of plastic or the like. Various application programs, data files, and the like are stored in the nonvolatile memory in such an IC card. Some IC cards have a function of a logical channel as a method of processing a command given from an external device. In an IC card having a logical channel function, different systems of processing can be performed in parallel on each logical channel.

たとえば、後述する非特許文献1(ISO/IEC7816−4:2005Section5.3.3)では、複数の異なる論理チャネルで、1つのファイルにアクセスすることを許可あるいは不許可にすることがファイルの制御情報によって制御可能である。しかしながら、1つのファイルへのアクセスが許可されている場合、複数のチャネルから当該ファイルに対し、書き込み、削除等のアクセスが可能となってしまう。このため、従来のICカードでは、あるチャネルで、書き込み、書き換え、削除、データ消去などのファイルのデータあるいはファイルの状態を変更させる処理を実施した場合、同一ファイルにアクセスしている別のチャネルでは、これまで行ってきた処理と整合が取れなくなる場合があるという問題がある。
ISO/IEC7816−4:2005Section5.3.3
For example, according to Non-Patent Document 1 (ISO / IEC7816-4: 2005 Section 5.3.3) described later, file control information may permit or deny access to one file on a plurality of different logical channels. It is controllable by. However, when access to one file is permitted, access such as writing and deleting can be performed on the file from a plurality of channels. For this reason, in a conventional IC card, when processing for changing file data or file status such as writing, rewriting, deleting, and erasing data is performed on one channel, another channel accessing the same file There is a problem in that it may become inconsistent with the processing performed so far.
ISO / IEC7816-4: 2005 Section 5.3.3

この発明の一形態は、上記のような問題点を解決するものであり、複数のチャネルからの処理要求に対する処理において整合性を保つことができるICカード、および、ICカードの制御方法を提供することを目的とする。 An embodiment of the present invention solves the above-described problems , and provides an IC card that can maintain consistency in processing for processing requests from a plurality of channels , and an IC card control method. For the purpose.

この発明の一形態としてのICカードは、外部装置から与えられるコマンドに対する処理を行うものにおいて、複数のチャネルで外部装置との通信を行う通信手段と、ファイルの定義情報と前記定義情報で定義されるファイルのデータとを記憶する記憶手段と、前記ファイルへのアクセスに優先権を有するチャネルを示す情報を前記ファイルの定義情報に設定する設定手段と、前記通信手段により受信した前記ファイルへのアクセスを要求するコマンドのチャネルが当該ファイルへのアクセスに優先権を有するチャネルである場合、前記コマンドで要求される前記ファイルへの処理を実行する第1の処理手段と、前記通信手段により受信した前記ファイルへのアクセスを要求するコマンドのチャネルが当該ファイルへのアクセスに優先権がないチャネルである場合、前記通信手段により受信した前記コマンドに対する処理が実行可能か否かを判断する判断手段と、前記判断手段により前記コマンドに対する処理が実行可能であると判断した場合、前記コマンドに対する処理を実行する第2の処理手段と、前記判断手段により前記コマンドに対する処理が実行不可であると判断した場合、前記コマンドに対する処理を実行せずに、ファイルへのアクセスに優先権がないため実行不可となったことを示すレスポンスを前記外部装置へ送信する第3の処理手段とを有する。 An IC card according to an aspect of the present invention performs processing for a command given from an external device, and is defined by communication means for communicating with the external device through a plurality of channels, file definition information, and the definition information. Storage means for storing file data , setting means for setting information indicating a channel having priority for access to the file in the definition information of the file, and access to the file received by the communication means If the channel of the command requesting the command is a channel having priority in accessing the file, the first processing means for executing the processing for the file requested by the command and the received by the communication means The command channel that requests access to a file has no priority in accessing that file. If a channel, if it is determined the determining means processing of the command received to determine whether viable, the process for the command by the determining means is executable by the communication means, processing for the command If the determination unit determines that the process for the command is not executable by the second processing unit for executing the command, the process for the command is not executed, and the file access has no priority and cannot be executed. And a third processing means for transmitting to the external device a response indicating that

この発明の一形態としてのICカードの制御方法は、複数のチャネルで外部装置との通信を行う通信手段と、ファイルの定義情報と前記定義情報で定義されるファイルのデータとを記憶する記憶手段とを有するICカードの制御方法であって、前記ファイルへのアクセスに優先権を有するチャネルを示す情報を前記ファイルの定義情報に設定し、前記ファイルへのアクセスを要求するコマンドのチャネルが当該ファイルへのアクセスに優先権を有するチャネルである場合、当該コマンドで要求される前記ファイルへの処理を実行し、前記ファイルへのアクセスを要求するコマンドのチャネルが当該ファイルへのアクセスに優先権がないチャネルである場合、前記コマンドに対する処理が実行可能か否かを判断し、前記判断により前記コマンドに対する処理が実行可能であると判断した場合、前記コマンドに対する処理を実行し、前記判断により前記コマンドに対する処理が実行不可であると判断した場合、前記コマンドに対する処理を実行せずに、ファイルへのアクセスに優先権がないため実行不可となったことを示すレスポンスを前記外部装置へ送信するAn IC card control method according to an aspect of the present invention includes: a communication unit that communicates with an external device through a plurality of channels; and a storage unit that stores file definition information and file data defined by the definition information an IC card control method with bets, and sets information indicating a channel having a priority access to said file definition information of the file, the channel is the file commands requesting access to the file If the channel has priority for access to the file, the process of the file requested by the command is executed, and the command channel requesting access to the file does not have priority for access to the file. If a channel, determines whether the processing to the command is executable, the command by the determining If against process is determined to be executable, and execute the processing for the command, if the process for the command by the determining determines that the unexecutable, without performing the processing for the command to a file A response is sent to the external device indicating that execution is not possible because there is no priority for access .

この発明の一形態によれば、複数のチャネルからの処理要求に対する処理において整合性を保つことができるICカード、および、ICカードの制御方法を提供することができる。 According to one aspect of the present invention, it is possible to provide an IC card that can maintain consistency in processing for processing requests from a plurality of channels , and an IC card control method.

以下、この発明の実施の形態について図面を参照して説明する。
図1は、本実施の形態に係るICカード(携帯可能電子装置)2、および、ICカード2との通信機能を有する外部装置としてのICカード処理装置1の構成例を概略的に示すブロック図である。
まず、上記ICカード処理装置1の構成について説明する。
上記ICカード処理装置1は、図1に示すように、端末装置11、ディスプレイ12、キーボード13、テンキー14、及び、カードリーダライタ15などを有している。
Embodiments of the present invention will be described below with reference to the drawings.
FIG. 1 is a block diagram schematically showing a configuration example of an IC card (portable electronic device) 2 according to the present embodiment and an IC card processing device 1 as an external device having a communication function with the IC card 2. It is.
First, the configuration of the IC card processing apparatus 1 will be described.
As shown in FIG. 1, the IC card processing device 1 includes a terminal device 11, a display 12, a keyboard 13, a numeric keypad 14, a card reader / writer 15, and the like.

上記端末装置11は、ICカード処理装置1全体の動作を制御するものである。上記端末装置11は、CPU、種々のメモリ及び各種インターフェースなどにより構成される。たとえば、上記端末装置11は、パーソナルコンピュータ(PC)により構成される。
上記端末装置11は、上記カードリーダライタ15によりICカード2へコマンドを送信する機能、ICカード2から受信したデータを基に種々の処理を行う機能などを有している。たとえば、上記端末装置11は、カードリーダライタ15を介してICカード2にデータの書き込みコマンドを送信することによりICカード2内の不揮発性メモリにデータを書き込む制御を行う。また、上記端末装置11は、ICカード2に読み取りコマンドを送信することによりICカード2からデータを読み出す制御を行う。
The terminal device 11 controls the operation of the entire IC card processing device 1. The terminal device 11 includes a CPU, various memories, various interfaces, and the like. For example, the terminal device 11 is configured by a personal computer (PC).
The terminal device 11 has a function of transmitting a command to the IC card 2 by the card reader / writer 15 and a function of performing various processes based on data received from the IC card 2. For example, the terminal device 11 performs control to write data into the nonvolatile memory in the IC card 2 by transmitting a data write command to the IC card 2 via the card reader / writer 15. The terminal device 11 controls to read data from the IC card 2 by transmitting a read command to the IC card 2.

上記ディスプレイ12は、上記端末装置11の制御により種々の情報を表示する表示装置である。上記キーボード13は、当該ICカード処理装置1の操作員が操作する操作部として機能し、操作員により種々の操作指示やデータなどが入力される。上記テンキー14は、使用者IDあるいはパスワードなど数字などの情報を入力する為の入力部として機能する。   The display 12 is a display device that displays various information under the control of the terminal device 11. The keyboard 13 functions as an operation unit operated by an operator of the IC card processing apparatus 1, and various operation instructions and data are input by the operator. The numeric keypad 14 functions as an input unit for inputting information such as numbers such as a user ID or a password.

上記カードリーダライタ15は、上記ICカード2との通信を行うためのインターフェース装置である。上記カードリーダライタ15は、上記ICカード2の通信方式に応じたインターフェースにより構成される。たとえば、上記ICカード2が接触型のICカードである場合、上記カードリーダライタ15は、ICカード2のコンタクト部と物理的かつ電気的に接続するための接触部などにより構成される。また、上記ICカード2が非接触型のICカードである場合、上記カードリーダライタ15は、ICカード2との無線通信を行うためのアンテナおよび通信制御などにより構成される。上記カードリーダライタ15では、上記ICカード2に対する電源供給、クロック供給、リセット制御、データの送受信が行われるようになっている。このような機能によってカードリーダライタ15は、上記端末装置11による制御に基づいて上記ICカード2の活性化(起動)、種々のコマンドの送信、及び送信したコマンドに対する応答の受信などを行なう。   The card reader / writer 15 is an interface device for communicating with the IC card 2. The card reader / writer 15 is configured by an interface corresponding to the communication method of the IC card 2. For example, when the IC card 2 is a contact type IC card, the card reader / writer 15 is constituted by a contact portion for physically and electrically connecting with a contact portion of the IC card 2. When the IC card 2 is a non-contact type IC card, the card reader / writer 15 includes an antenna for performing wireless communication with the IC card 2 and communication control. The card reader / writer 15 performs power supply, clock supply, reset control, and data transmission / reception with respect to the IC card 2. With such a function, the card reader / writer 15 performs activation (activation) of the IC card 2, transmission of various commands, reception of responses to the transmitted commands, and the like based on control by the terminal device 11.

次に、上記ICカード2のハードウエア構成例について説明する。
上記ICカード2は、上記ICカード処理装置1などの上位機器から電力などの供給を受けた際、活性化される(動作可能な状態になる)ようになっている。例えば、上記ICカード2が接触型の通信によりICカード処理装置1と接続される場合、つまり、ICカード2が接触型のICカードで構成される場合、上記ICカード2は、通信インターフェースとしてのコンタクト部を介してICカード処理装置1からの動作電源及び動作クロックの供給を受けて活性化される。
Next, a hardware configuration example of the IC card 2 will be described.
The IC card 2 is activated (becomes operable) when receiving power or the like from a host device such as the IC card processing device 1. For example, when the IC card 2 is connected to the IC card processing device 1 by contact communication, that is, when the IC card 2 is configured by a contact IC card, the IC card 2 is used as a communication interface. It is activated upon receipt of an operation power supply and an operation clock from the IC card processing apparatus 1 through the contact portion.

また、上記ICカード2が非接触型の通信方式によりICカード処理装置1と接続される場合、つまり、上記ICカード2が非接触式のICカードで構成される場合、上記ICカード2は、通信インターフェースとしてのアンテナ及び変復調回路などを介してICカード処理装置1からの電波を受信し、その電波から図示しない電源部により動作電源及び動作クロックを生成して活性化するようになっている。   Further, when the IC card 2 is connected to the IC card processing apparatus 1 by a non-contact communication method, that is, when the IC card 2 is configured by a non-contact IC card, the IC card 2 is A radio wave is received from the IC card processing device 1 via an antenna as a communication interface, a modulation / demodulation circuit, and the like, and an operation power supply and an operation clock are generated from the radio wave by a power supply unit (not shown) and activated.

図2は、本実施の形態に係るICカード2のハードウエア構成例を概略的に示すブロック図である。上記ICカード2は、本体Cを構成する筐体内にモジュールMが内蔵されている。上記モジュールMは、1つまたは複数のICチップCaと通信用の外部インターフェース(通信インターフェース)とが接続された状態で一体的に形成され、ICカード2の本体C内に埋設されている。また、上記ICカード2のモジュールMは、図2に示すように、制御部21、通信インターフェース22、ROM23、RAM24、不揮発性メモリ25などを有してしている。   FIG. 2 is a block diagram schematically showing a hardware configuration example of the IC card 2 according to the present embodiment. The IC card 2 has a module M built in a casing constituting the main body C. The module M is integrally formed in a state where one or a plurality of IC chips Ca and a communication external interface (communication interface) are connected, and is embedded in the main body C of the IC card 2. The module M of the IC card 2 includes a control unit 21, a communication interface 22, a ROM 23, a RAM 24, a nonvolatile memory 25, and the like as shown in FIG.

上記制御部21は、当該ICカード2全体の制御を司るものである。上記制御部21は、上記ROM23あるいは上記不揮発性メモリ25に記憶されている制御プログラムや制御データに基づいて動作することにより、種々の機能を実現する。たとえば、上記制御部21は、オペレーティングシステムのプログラムを実行することにより、当該ICカード2の基本的な動作制御を行う。また、上記制御部21は、アプリケーションプログラムを実行することにより、当該ICカード2の運用形態に応じた種々の動作制御を行う。   The control unit 21 controls the entire IC card 2. The control unit 21 realizes various functions by operating based on a control program and control data stored in the ROM 23 or the nonvolatile memory 25. For example, the control unit 21 performs basic operation control of the IC card 2 by executing an operating system program. The control unit 21 executes various application controls according to the operation mode of the IC card 2 by executing an application program.

上記通信インターフェース22は、上記ICカード処理装置1のカードリーダライタ15との通信を行うためのインターフェースである。当該ICカード2が接触型のICカードとして実現される場合、上記通信インターフェース22は、上記ICカード処理装置1のカードリーダライタ15と物理的かつ電気的に接触して信号の送受信を行うための通信制御部とコンタクト部とにより構成される。また、当該ICカード2が非接触型のICカードとして実現される場合、通信インターフェース22は、上記ICカード処理装置1のカードリーダライタ15との無線通信を行うための変復調回路などの通信制御部とアンテナとにより構成される。   The communication interface 22 is an interface for communicating with the card reader / writer 15 of the IC card processing apparatus 1. When the IC card 2 is realized as a contact-type IC card, the communication interface 22 is in physical and electrical contact with the card reader / writer 15 of the IC card processing device 1 for transmitting and receiving signals. It is comprised by a communication control part and a contact part. When the IC card 2 is realized as a non-contact type IC card, the communication interface 22 is a communication control unit such as a modulation / demodulation circuit for performing wireless communication with the card reader / writer 15 of the IC card processing device 1. And an antenna.

上記ROM23は、予め制御用のプログラムや制御データなどが記憶されている不揮発性のメモリである。上記ROM23は、製造段階で制御プログラムや制御データなどが記憶された状態でICカード2内に組み込まれるものである。つまり、上記ROM23に記憶されている制御プログラムや制御データは、予め当該ICカード2の仕様に応じて組み込まれる。
上記RAM24は、ワーキングメモリとして機能する揮発性のメモリである。また、上記RAM24は、制御部21が処理中のデータなどを一時保管するバッファとしても機能する。例えば、上記RAM24は、上記通信インターフェース22を介してICカード処理装置1から受信したデータを一時保管するようになっている。また、上記RAM24上には、種々の動作状態などを管理するための管理テーブルが適宜構成されるようになっている。たとえば、後述する論理チャネルは、RAM24上に構成されるチャネル管理テーブル24aによりカレントファイルなどが管理されるようになっている。
The ROM 23 is a non-volatile memory in which a control program and control data are stored in advance. The ROM 23 is incorporated in the IC card 2 in a state where a control program, control data, and the like are stored at the manufacturing stage. That is, the control program and control data stored in the ROM 23 are incorporated according to the specifications of the IC card 2 in advance.
The RAM 24 is a volatile memory that functions as a working memory. The RAM 24 also functions as a buffer for temporarily storing data being processed by the control unit 21. For example, the RAM 24 temporarily stores data received from the IC card processing apparatus 1 via the communication interface 22. On the RAM 24, a management table for managing various operation states and the like is appropriately configured. For example, in a logical channel described later, a current file and the like are managed by a channel management table 24a configured on the RAM 24.

上記不揮発性メモリ25は、例えば、EEPROM(Electrically Erasable Programmable Read-Only Memory)あるいはフラッシュROMなどのデータの書き込み及び書換えが可能な不揮発性のメモリにより構成される。上記不揮発性メモリ25には、当該ICカード2の運用用途に応じて制御プログラムや種々のデータが書込まれる。また、上記不揮発性メモリ25上には、電源供給がなくなった後もデータを保持しておくことが必要な管理テーブルも設けられる。たとえば、上記不揮発性メモリ25には、プログラムファイルあるいはデータファイルなどが定義され、それらのファイルに制御プログラムや種々のデータが書き込まれる。上記不揮発性メモリ25に格納されるファイルは、ファイル定義情報によって定義され、ファイル定義情報により定義された記憶領域にファイル本体としてのデータが格納されるようになっている。   The non-volatile memory 25 is constituted by a non-volatile memory capable of writing and rewriting data, such as an EEPROM (Electrically Erasable Programmable Read-Only Memory) or a flash ROM. In the non-volatile memory 25, a control program and various data are written according to the usage application of the IC card 2. The nonvolatile memory 25 is also provided with a management table that needs to retain data even after power supply is stopped. For example, program files or data files are defined in the nonvolatile memory 25, and control programs and various data are written in these files. The file stored in the non-volatile memory 25 is defined by file definition information, and data as a file body is stored in a storage area defined by the file definition information.

次に、上記のようなICカード2で使用可能な論理チャネルについて説明する。
上記ICカード2は、複数の論理チャネルごとにファイルへのアクセス管理などを行う機能を有している。たとえば、論理チャネル1と論理チャネル2では、それぞれカレントファイルを設定することができる。このような場合、論理チャネル1で与えられたコマンドは、論理チャネル1のカレントファイルをアクセス対象として処理を行い、論理チャネル2で与えられたコマンドは、論理チャネル2のカレントファイルをアクセス対象として処理を行う。言い換えると、ICカード処理装置1は、ICカード2に対して複数の論理チャネルでファイルへのアクセスを要求する各種コマンドを与えることにより、各論理チャネルごとに異なる系列の処理群を当該ICカード2に実行させることができる。上記のような各論理チャネルのカレントファイルは、たとえば、ワーキングメモリとしてのRAM24上に構成されるチャネル管理テーブル24aにより管理されるものである。
Next, logical channels that can be used in the IC card 2 as described above will be described.
The IC card 2 has a function of managing access to files for each of a plurality of logical channels. For example, the current file can be set for each of the logical channel 1 and the logical channel 2. In such a case, the command given on the logical channel 1 is processed with the current file of the logical channel 1 as an access target, and the command given on the logical channel 2 is processed with the current file on the logical channel 2 as an access target. I do. In other words, the IC card processing device 1 gives various commands for requesting access to a file through a plurality of logical channels to the IC card 2, thereby assigning processing groups of different series for each logical channel. Can be executed. The current file of each logical channel as described above is managed by, for example, a channel management table 24a configured on the RAM 24 as a working memory.

また、論理チャネルは、各コマンドで指定されるものである。たとえば、図3は、ISO/IEC7816−4で規定されるコマンドの構成例を示す図である。図3に示すように、ISO/IEC7816−4で規定されるコマンドは、「CLA」、「INS」、「P1」、「P2」、「Le」、「DATA」などにより構成される。このような構成のコマンドにおいて使用する論理チャネルは、「CLA」(CLAバイト、CLAデータ)で指定される。図3に示す構成例では、各コマンドのCLAバイトは8ビットで構成されている。このような各コマンドのCLAバイトにおけて、第1ビット(b1)及び第2ビット(b2)が当該コマンドの論理チャネル(論理チャネル番号)を指定するものである。このような構成では、各コマンドにおいて「00」(論理チャネル「#0」)、「01」(論理チャネル「#1」)、「10」(論理チャネル「#2」)、「11」(論理チャネル「#3」)の最大4個の論理チャネルが設定可能である。   The logical channel is specified by each command. For example, FIG. 3 is a diagram illustrating a configuration example of a command defined by ISO / IEC7816-4. As shown in FIG. 3, the commands defined by ISO / IEC7816-4 are composed of “CLA”, “INS”, “P1”, “P2”, “Le”, “DATA”, and the like. The logical channel used in the command having such a configuration is designated by “CLA” (CLA byte, CLA data). In the configuration example shown in FIG. 3, the CLA byte of each command is composed of 8 bits. In such a CLA byte of each command, the first bit (b1) and the second bit (b2) designate the logical channel (logical channel number) of the command. In such a configuration, in each command, “00” (logical channel “# 0”), “01” (logical channel “# 1”), “10” (logical channel “# 2”), “11” (logical Up to four logical channels of channel “# 3”) can be set.

なお、ISO/IEC7816−4では、MANAGE CHANNELコマンドにより所望の論理チャネルを使用可能な状態とするように規定されている。通常、所定の1つの論理チャネル(たとえば、論理チャネル「#0」)は、常時使用可能とされている。従って、論理チャネルを意識せずに処理を行う場合、所定の1つの論理チャネルで種々の処理が実行される。これに対して、複数の論理チャネルを使用する場合(たとえば、論理チャネル「#1」、「#2」、「#3」を使用する場合)、予めMANAGE CHANNELコマンドにより使用する論理チャネルを使用可能な状態にする必要がある。また、各論理チャネルは、チャネルを閉塞することを要求する所定のコマンドに応じて閉塞される処理が行われるようになっている。   ISO / IEC 7816-4 stipulates that a desired logical channel can be used by a MANAGE CHANNEL command. Normally, one predetermined logical channel (for example, logical channel “# 0”) is always usable. Therefore, when processing is performed without being conscious of the logical channel, various processing is executed on one predetermined logical channel. On the other hand, when multiple logical channels are used (for example, when logical channels “# 1”, “# 2”, “# 3” are used), logical channels used in advance by the MANAGE CHANNEL command can be used. It is necessary to be in a proper state. In addition, each logical channel is subjected to a process of being blocked in response to a predetermined command requesting to block the channel.

次に、上記不揮発性メモリ25に記憶される各ファイルのファイル定義情報に含まれるファイル制御情報について説明する。
図4は、ファイル定義情報に含まれるファイル制御情報の構成例を示す図である。
図4に示すように、ファイル制御情報は、「ファイルID」、「ファイルサイズ」、「セキュリティ属性」、「ファイルタイプ」、「アクセスチャネル番号」などの情報により構成される。「ファイルID」は、当該ファイルを識別するための識別情報である。「ファイルサイズ」は、当該ファイルのデータサイズを示す情報である。「セキュリティ属性」は、当該ファイルに対するセキュリティ設定を示す情報である。「アクセスチャネル番号」は、当該ファイルへのアクセスに優先権が与えられている論理チャネルを示す情報である。「アクセスチャネル番号」は、必ずしも設定されるものではなく、未設定の状態である場合もありうる。たとえば、1つの論理チャネルだけで処理が実行されている場合、「アクセスチャネル番号」は、設定する必要がないものと考えられる。
Next, file control information included in the file definition information of each file stored in the nonvolatile memory 25 will be described.
FIG. 4 is a diagram illustrating a configuration example of file control information included in the file definition information.
As shown in FIG. 4, the file control information includes information such as “file ID”, “file size”, “security attribute”, “file type”, and “access channel number”. “File ID” is identification information for identifying the file. “File size” is information indicating the data size of the file. “Security attribute” is information indicating a security setting for the file. “Access channel number” is information indicating a logical channel to which priority is given to access to the file. The “access channel number” is not necessarily set, and may not be set. For example, when the process is executed with only one logical channel, it is considered that the “access channel number” does not need to be set.

上記アクセスチャネル番号により特定される優先権(アクセス優先権)とは、当該ファイルのデータに変化が生じる可能性があるコマンドの実行権限であるものとする。ファイルのデータに変化が生じる可能性があるコマンドとしては、たとえば、データの書換えを要求するコマンド、データの消去を要求するコマンド、あるいは、ファイルの削除を要求するコマンドなどが想定される。すなわち、上記アクセスチャネル番号が設定されている場合、優先権が与えられている論理チャネルでのみ、当該ファイルのデータ本体に変化が生じる可能性があるコマンドが実行可能となるようになっている。   The priority specified by the access channel number (access priority) is assumed to be a command execution right that may change the data of the file. As a command that may cause a change in file data, for example, a command requesting data rewriting, a command requesting data erasure, or a command requesting file deletion is assumed. That is, when the access channel number is set, a command that may cause a change in the data body of the file can be executed only on the logical channel to which priority is given.

これに対して、ファイルのデータ本体に変化が生じないコマンドについては、上記優先権の有無に関係なく各論理チャネルでの実行が許容される。ファイルのデータ本体に変化が生じないコマンドとしては、たとえば、データの読み出しを要求するコマンド、あるいは、ファイルの選択を要求するコマンドなどが想定される。すなわち、上記アクセスチャネル番号が設定されている場合であっても、ファイルのデータ本体に変化が生じないコマンドは、優先権が与えられていない論理チャネルにも実行が許容される。   On the other hand, a command that does not change the data body of the file is allowed to be executed on each logical channel regardless of the presence or absence of the priority. As a command that does not change the data body of the file, for example, a command that requests reading of data or a command that requests selection of a file is assumed. That is, even when the access channel number is set, a command that does not change the data body of the file is allowed to be executed even for a logical channel to which priority is not given.

次に、上記ICカード2における第1の動作例について説明する。
図5は、上記ICカード処理装置1から受信した種々のコマンドに対する第1の動作例を説明するためのフローチャートである。
ここでは、複数の論理チャネルがオープンされている状態であるものとする。なお、複数の論理チャネルがオープンされていない場合(所定の1つの論理チャネルのみでの処理状態である場合)、複数の論理チャネルでの処理に対して整合性を保つための制御が不要であるため、後述するアクセス優先権に応じたアクセス制限が不要であるものとする。
Next, a first operation example in the IC card 2 will be described.
FIG. 5 is a flowchart for explaining a first operation example for various commands received from the IC card processing apparatus 1.
Here, it is assumed that a plurality of logical channels are open. When a plurality of logical channels are not opened (when processing is performed with only one predetermined logical channel), control for maintaining consistency with respect to processing with a plurality of logical channels is not required. For this reason, it is assumed that access restriction according to the access priority described later is not required.

まず、上記ICカード処理装置1からコマンドを受信した場合(ステップS11、YES)、上記ICカード2の制御部21は、受信コマンドの処理内容を判別する。当該受信コマンドがカレントファイルの選択を要求するコマンド(指定ファイルを当該論理チャネルのカレントファイルに設定することを要求するコマンド)である場合(ステップS12、YES)、上記制御部21は、指定されたファイルを当該コマンドの論理チャネルにおけるカレントファイルとして設定する(ステップS13)。   First, when a command is received from the IC card processing device 1 (YES in step S11), the control unit 21 of the IC card 2 determines the processing content of the received command. When the received command is a command requesting selection of the current file (a command requesting setting of the specified file as the current file of the logical channel) (step S12, YES), the control unit 21 specifies the specified file. The file is set as the current file in the logical channel of the command (step S13).

上記受信コマンドで指定されたファイルを当該論理チャネルのカレントファイルに設定すると、上記制御部21は、当該受信コマンドの論理チャネルにおけるカレントファイルとして選択したファイルへのアクセスに優先権を有する論理チャネルが設定済みであるか否かを判断する(ステップS14)。これは、当該ファイルのファイル制御情報においてアクセスチャネル番号が設定されているか否かを判断される。   When the file specified by the reception command is set as the current file of the logical channel, the control unit 21 sets a logical channel having priority for access to the file selected as the current file in the logical channel of the reception command. It is determined whether it has been completed (step S14). This is determined whether or not an access channel number is set in the file control information of the file.

この判断により選択したファイルへのアクセスに優先権を有する論理チャネルが設定されていないと判断した場合(ステップS14、NO)、上記制御部21は、当該ファイルへのアクセス優先権を当該コマンドの論理チャネルに設定する(ステップS15)。当該ファイルへのアクセス優先権は、当該ファイルのファイル制御情報に当該論理チャネルを示す情報をアクセスチャネル番号として付加することにより設定される。
また、上記判断により選択したファイルへのアクセスに優先権を有する論理チャネルが設定済みであると判断した場合(ステップS14、YES)、あるいは、上記ステップS15のアクセス優先権の設定処理が完了した場合、上記制御部21は、上記受信コマンドに対するレスポンスとしてカレントファイルの設定が正常終了した旨をICカード処理装置1へ送信する(ステップS16)。
If it is determined by this determination that a logical channel having priority for access to the selected file is not set (step S14, NO), the control unit 21 assigns access priority to the file to the logical of the command. A channel is set (step S15). The access priority to the file is set by adding information indicating the logical channel to the file control information of the file as an access channel number.
Also, when it is determined that a logical channel having priority for access to the file selected by the above determination has been set (step S14, YES), or when the access priority setting processing at step S15 is completed Then, the control unit 21 transmits to the IC card processing device 1 that the setting of the current file has been normally completed as a response to the received command (step S16).

また、上記受信コマンドがファイルへのアクセスを要求するコマンド(たとえば、データ読み出し、データ書込み、データ消去、ファイル削除などを要求するコマンド)である場合(ステップS21、YES)、上記制御部21は、当該受信コマンドの論理チャネルと当該論理チャネルのカレントファイル(アクセス対象のファイル)に設定されているアクセスチャネル番号とが一致するか否かを判断する(ステップS22)。これは、当該論理チャネルに現在のカレントファイルに対するアクセス優先権が与えられているか否かを判断するものである。   When the received command is a command requesting access to a file (for example, a command requesting data read, data write, data erase, file delete, etc.) (step S21, YES), the control unit 21 It is determined whether the logical channel of the received command matches the access channel number set in the current file (accessed file) of the logical channel (step S22). This is to determine whether or not the logical channel is given access priority for the current current file.

受信コマンドの論理チャネルと当該論理チャネルのカレントファイルのアクセスチャネル番号とが一致すると判断した場合、つまり、当該論理チャネルがカレントファイルにアクセス優先権を有すると判断した場合(ステップS22、YES)、上記制御部21は、当該受信コマンドに応じた処理を実行し(ステップS23)、そのコマンド処理の結果を受信コマンドに対するレスポンスとしてICカード処理装置1へ送信する(ステップS24)。   When it is determined that the logical channel of the received command matches the access channel number of the current file of the logical channel, that is, when it is determined that the logical channel has access priority to the current file (YES in step S22), The control unit 21 executes processing according to the received command (step S23), and transmits the result of the command processing to the IC card processing device 1 as a response to the received command (step S24).

また、受信コマンドの論理チャネルと当該論理チャネルのカレントファイルのアクセスチャネル番号とが一致しないと判断した場合、つまり、当該論理チャネルがカレントファイルにアクセス優先権を有していないと判断した場合(ステップS22、NO)、上記制御部21は、当該受信コマンドの処理内容が実行を許容されるものであるか否かを判断する(ステップS25)。アクセス優先権によるアクセス制限は、たとえば、アクセス優先権が設定されていない論理チャネルでは、ファイルのデータ本体が変化する可能性がある処理を要求するコマンドは実行できないように制限される。たとえば、データの書換え、データの消去、ファイルの削除などのコマンドは、当該アクセス優先権が設定されていない論理チャネルでは、実行できないように制限される。これに対して、アクセス優先権が設定されていない論理チャネルであっても、ファイルのデータ本体が変化しないような処理を要求するコマンドは実行できる。たとえば、データの読出しなどのコマンドは、アクセス優先権が設定されていない論理チャネルであっても実行が許容される。   If it is determined that the logical channel of the received command does not match the access channel number of the current file of the logical channel, that is, if it is determined that the logical channel does not have access priority to the current file (step (S22, NO), the control unit 21 determines whether or not the processing content of the received command is permitted to be executed (step S25). The access restriction based on the access priority is restricted such that, for example, a command requesting a process that may change the data body of the file cannot be executed in a logical channel in which the access priority is not set. For example, commands such as data rewriting, data erasure, and file deletion are restricted so that they cannot be executed on a logical channel for which the access priority is not set. On the other hand, even for a logical channel for which access priority is not set, a command requesting processing that does not change the data body of the file can be executed. For example, a command such as data read is allowed to be executed even on a logical channel for which access priority is not set.

上記判断により受信コマンドが実行可能なものであると判断された場合(ステップS25、YES)、上記制御部21は、当該受信コマンドを実行し(ステップS23)、その処理結果をレスポンスとしてICカード処理装置1へ送信する(ステップS24)。また、上記判断により受信コマンドが実行不可となるものであると判断された場合(ステップS25、NO)、上記制御部21は、当該受信コマンドの実行することなく、当該受信コマンドに対するレスポンスとして当該ファイルへのアクセス優先権がないため実行不可となった旨をICカード処理装置1へ送信する(ステップS26)。   When it is determined by the above determination that the received command can be executed (step S25, YES), the control unit 21 executes the received command (step S23), and the IC card process is performed using the processing result as a response. It transmits to the apparatus 1 (step S24). If it is determined by the above determination that the received command is not executable (step S25, NO), the control unit 21 does not execute the received command, and executes the file as a response to the received command. To the IC card processing device 1 is transmitted to the IC card processing apparatus 1 (step S26).

また、上記受信コマンドが論理チャネルの閉塞を要求するコマンドである場合(ステップS31、YES)、上記制御部21は、当該受信コマンドで指定された論理チャネルを閉塞させる(ステップS32)。上記論理チャネルを閉塞させると、上記制御部21は、当該論理チャネルにアクセス優先権を設定している各ファイルのファイル制御情報におけるアクセスチャネル番号をクリアする(ステップS33)。これらの処理が完了すると、上記制御部21は、上記受信コマンドに対するレスポンスとして論理チャネルの閉塞が正常終了した旨をICカード処理装置1へ送信する(ステップS34)。   When the received command is a command requesting blocking of the logical channel (step S31, YES), the control unit 21 blocks the logical channel designated by the received command (step S32). When the logical channel is blocked, the control unit 21 clears the access channel number in the file control information of each file for which access priority is set for the logical channel (step S33). When these processes are completed, the control unit 21 transmits to the IC card processing apparatus 1 that the logical channel blockage has ended normally as a response to the received command (step S34).

なお、ファイルの選択を要求するコマンド、ファイルへのアクセスを要求するコマンド、および、論理チャネルの閉塞を要求するコマンド以外のコマンドについては、論理チャネルごとのファイルへのアクセス制御を考慮すべきものでないと考えられるため、各コマンドの処理内容に応じた処理が実行される(ステップS35)。   For commands other than commands that request file selection, commands that request access to files, and commands that request blocking of logical channels, access control to files for each logical channel should not be considered. Since it is considered, processing corresponding to the processing content of each command is executed (step S35).

次に、上述した第1の動作例を適用したICカード2における具体例な動作例について説明する。
図6は、ICカード2に与えられるコマンド群C1〜C11の例を示す図である。また、図7は、上記第1の動作例に従って動作するICカード2が図6に示す一連のコマンドに対して実行する動作を説明するための図である。ここで、図6に示すコマンドは、少なくとも論理チャネル1と論理チャネル2とがオープンの状態となっているICカード2に与えられる一連のコマンドであるものとする。
Next, a specific operation example in the IC card 2 to which the first operation example described above is applied will be described.
FIG. 6 is a diagram showing an example of command groups C1 to C11 given to the IC card 2. FIG. 7 is a diagram for explaining an operation that the IC card 2 that operates according to the first operation example executes in response to the series of commands shown in FIG. Here, it is assumed that the commands shown in FIG. 6 are a series of commands given to the IC card 2 in which at least the logical channel 1 and the logical channel 2 are open.

まず、論理チャネル1を指定したファイルAの選択要求コマンドC1を受信した場合、上記ICカード2の制御部21は、上記ステップS12〜S16を説明したような処理を行う。すなわち、上記制御部21は、ファイルAを論理チャネル1のカレントファイルに設定し、ファイルAにアクセスチャネル番号が設定されているか否かを確認する。この時点では、ファイルAにアクセスチャネル番号が設定されていないものとすると、上記制御部21は、ファイルAのアクセスチャネル番号として論理チャネル1を示す「1」を設定する。   First, when the selection request command C1 for the file A specifying the logical channel 1 is received, the control unit 21 of the IC card 2 performs the processes described in steps S12 to S16. That is, the control unit 21 sets the file A as the current file of the logical channel 1 and checks whether an access channel number is set in the file A. At this time, assuming that no access channel number is set for file A, the control unit 21 sets “1” indicating logical channel 1 as the access channel number of file A.

この状態において論理チャネル2を指定したファイルAの選択要求コマンドC2を受信した場合、上記制御部21は、上記ステップS12〜S16の処理を行う。この場合、ファイルAにはアクセスチャネル番号として「1」が設定済みであるため、上記制御部21は、ファイルAを論理チャネル2のカレントファイルに設定するだけで、ファイルAのアクセスチャネル番号を書換えないようにする。   In this state, when the selection request command C2 of the file A specifying the logical channel 2 is received, the control unit 21 performs the processes of steps S12 to S16. In this case, since “1” is already set as the access channel number for file A, the control unit 21 rewrites the access channel number of file A simply by setting file A as the current file of logical channel 2. Do not.

さらに、論理チャネル1を指定した読み出し要求コマンドC3を受信すると、上記制御部21は、上記ステップS21〜S26の処理として、ファイルAの読み出し処理を行う。これは、論理チャネル1のカレントファイル(ファイルA)には論理チャネルにアクセス優先権があるためである。従って、上記制御部21は、ファイルAのデータを読み出して、読み出したデータを当該コマンドC3のレスポンスデータとして送信する。   Further, when the read request command C3 specifying the logical channel 1 is received, the control unit 21 performs a file A read process as the processes of steps S21 to S26. This is because the logical channel 1 current file (file A) has access priority to the logical channel. Therefore, the control unit 21 reads the data of the file A and transmits the read data as response data of the command C3.

また、論理チャネル2を指定した読み出し要求コマンドC4を受信した場合も、上記制御部21は、ファイルAの読み出し処理を行う。これは、論理チャネル2のカレントファイル(ファイルA)には論理チャネル1にアクセス優先権があるが、読み出しコマンドはアクセス優先権がなくとも実行可能なコマンドであるためである。従って、上記制御部21は、当該コマンドC4の実行を許容し、ファイルAのデータを読み出して、読み出したデータを当該コマンドC4のレスポンスデータとして送信する処理を行う。   In addition, when the read request command C4 specifying the logical channel 2 is received, the control unit 21 performs the file A read process. This is because the current file (file A) of logical channel 2 has access priority in logical channel 1, but the read command is a command that can be executed without access priority. Therefore, the control unit 21 allows the execution of the command C4, reads the data of the file A, and transmits the read data as response data of the command C4.

次に、論理チャネル2を指定したデータの書込み要求コマンドC5を受信した場合、上記制御部21は、上記ステップ21〜S26の処理として、当該コマンドC5の実行を不可とする。これは、論理チャネル2のカレントファイル(ファイルA)には論理チャネル「1」にアクセス優先権があり、かつ、データの書込み要求コマンドはアクセス優先権がなければ実行不可なコマンドであるためである。従って、上記制御部21は、当該コマンドC5に応じた処理を実行不可として、当該コマンドC5が実行不可であった旨を当該コマンドC5のレスポンスとして送信にする。   Next, when the data write request command C5 specifying the logical channel 2 is received, the control unit 21 disables the execution of the command C5 as the processing of steps 21 to S26. This is because the current file (file A) of the logical channel 2 has access priority to the logical channel “1”, and the data write request command cannot be executed without access priority. . Therefore, the control unit 21 disables execution of the process according to the command C5, and transmits that the command C5 cannot be executed as a response to the command C5.

さらに、論理チャネル1を指定したデータの書込み要求コマンドC6を受信した場合、上記制御部21は、当該コマンドC6を実行する。これは、論理チャネル1のカレントファイル(ファイルA)には論理チャネル「1」にアクセス優先権があるためである。すなわち、上記制御部21は、当該コマンドC6で指定されている処理内容に従って、ファイルAのデータを書換え、その処理結果を当該コマンドC6のレスポンスとして送信する処理を行う。   Further, when the data write request command C6 specifying the logical channel 1 is received, the control unit 21 executes the command C6. This is because the current file (file A) of logical channel 1 has access priority to logical channel “1”. That is, the control unit 21 rewrites the data of the file A according to the processing content specified by the command C6, and transmits the processing result as a response to the command C6.

次に、論理チャネル1の閉塞を要求するコマンドC7を受信した場合、上記制御部21は、上記ステップ31〜S34の処理として、論理チャネル1を閉塞させる処理を行う。この場合、上記制御部21は、論理チャネル1を閉塞させ、論理チャネル1におけるカレントファイルの設定をクリアするとともに、論理チャネル1にアクセス優先権を与えていたファイルAのアクセスチャネル番号をクリアする。これにより、上記ファイルAに対する論理チャネル1のアクセス優先権がクリアされ、ファイルAにはどの論理チャネルにもアクセス優先権が付与されていない状態となる。   Next, when the command C7 for requesting the blocking of the logical channel 1 is received, the control unit 21 performs a process of blocking the logical channel 1 as the process of steps 31 to S34. In this case, the control unit 21 closes the logical channel 1, clears the current file setting in the logical channel 1, and clears the access channel number of the file A that has given the access priority to the logical channel 1. As a result, the access priority of the logical channel 1 with respect to the file A is cleared, and no access priority is given to any logical channel in the file A.

この状態において、論理チャネル2を指定したデータの書込み要求コマンドC8を受信した場合、上記制御部21は、上記ステップ21〜S26の処理として、当該コマンドC8の実行を不可とする。これは、論理チャネル2のカレントファイル(ファイルA)にはアクセス優先権を有する論理チャネルが設定されていないためである。第1の動作例では、このようなアクセスチャネル番号が設定されていない場合であっても、データの書込みなどの処理を不可としている。従って、上記制御部21は、当該コマンドC8に応じた処理を実行不可として、当該コマンドC8が実行不可であった旨を当該コマンドC8のレスポンスとして送信にする。   In this state, when the data write request command C8 designating the logical channel 2 is received, the control unit 21 disables the execution of the command C8 as the processing of steps 21 to S26. This is because a logical channel having access priority is not set in the current file (file A) of logical channel 2. In the first operation example, even when such an access channel number is not set, processing such as data writing is disabled. Therefore, the control unit 21 disables execution of the process according to the command C8, and transmits that the command C8 cannot be executed as a response to the command C8.

次に、論理チャネル2を指定したファイルAの選択要求コマンドC9を受信すると、上記制御部21は、上記ステップS12〜S16の処理として、ファイルAを論理チャネル2のカレントファイルに設定し、ファイルAのアクセスチャネル番号を論理チャネル「2」に設定する処理を行う。これは、ファイルAの選択要求を受けた際に、当該ファイルAにアクセスチャネル番号が設定されていないためである。すなわち、ファイルAに対するアクセル優先権を有していた論理チャネル1が閉塞された場合には当該ファイルAのアクセスチャネル番号もクリアされる。このため、論理チャネル1の閉塞後に論理チャネル2で受信したファイルAの選択要求に応じて、ファイルAのアクセス優先権が論理チャネル2に付与されるようになっている。言い換えると、第1の動作例では、ファイルAにアクセス優先権が与えられていない論理チャネル2は、アクセス優先権が与えられている論理チャネル1が閉塞した後に、ファイルAの選択要求コマンドを実行することにより、ファイルAに対するアクセス優先権を得ることができるようになっている。   Next, when the selection request command C9 of the file A specifying the logical channel 2 is received, the control unit 21 sets the file A as the current file of the logical channel 2 as the processing of the steps S12 to S16, and the file A The access channel number is set to the logical channel “2”. This is because an access channel number is not set for the file A when a selection request for the file A is received. That is, when the logical channel 1 having the accelerator priority for the file A is blocked, the access channel number of the file A is also cleared. For this reason, the access priority of the file A is given to the logical channel 2 in response to the selection request of the file A received by the logical channel 2 after the logical channel 1 is closed. In other words, in the first operation example, the logical channel 2 to which the access priority is not given to the file A executes the selection request command for the file A after the logical channel 1 to which the access priority is given is blocked. By doing so, the access priority for the file A can be obtained.

従って、上記コマンドC9の実行後に論理チャネル2を指定したファイルAの書き込み要求コマンドC10を受信した場合、上記制御部21は、当該コマンドC10で指定されている処理内容に従って、ファイルAのデータを書換え、その処理結果を当該コマンドC10のレスポンスとして送信する処理を行う。これは、論理チャネル2のカレントファイル(ファイルA)のアクセス優先権が論理チャネル「2」にあるために、当該データ書込み要求コマンドC10が実行可能であるからである。   Therefore, when the write request command C10 of the file A specifying the logical channel 2 is received after the execution of the command C9, the control unit 21 rewrites the data of the file A according to the processing content specified by the command C10. Then, the processing result is transmitted as a response to the command C10. This is because the access priority of the current file (file A) of the logical channel 2 is in the logical channel “2”, so that the data write request command C10 can be executed.

次に、論理チャネル2の閉塞を要求するコマンドC11を受信した場合、上記制御部21は、上記ステップ31〜S34の処理として、論理チャネル2を閉塞させ、論理チャネル2におけるカレントファイルの設定をクリアするとともに、論理チャネル2にアクセス優先権を与えていたファイルAのアクセスチャネル番号をクリアする。これにより、上記ファイルAには、どの論理チャネルにもアクセス優先権が付与されていない状態となる。   Next, when the command C11 requesting blocking of the logical channel 2 is received, the control unit 21 closes the logical channel 2 and clears the setting of the current file in the logical channel 2 as the processing of the above steps 31 to S34. At the same time, the access channel number of the file A that has given the access priority to the logical channel 2 is cleared. As a result, no access priority is given to any logical channel in the file A.

上記のように、第1の動作例では、ファイルの選択要求コマンドを受けた場合に、選択されるファイルにアクセス優先権が設定されている論理チャネルがなければ、当該コマンドの論理チャネルに対して選択するファイルに対するアクセス優先権を与えるようになっている。さらに、論理チャネルに与えられたアクセス優先権は、当該論理チャネルが閉塞するまで保持されるようになっている。これにより、最初にカレントファイルとして選択した論理チャネルにおいては、当該ファイルをアクセス対象とする各種のコマンドを許容するが、それ以外の論理チャネルにおいては、当該ファイルに対するアクセスを制限することが可能となる。この結果として、複数の論理チャネルで特定のファイルをアクセス対象とする処理要求を受けた場合であっても、各処理の整合性を保つことが可能となる。   As described above, in the first operation example, when a file selection request command is received, if there is no logical channel for which the access priority is set in the selected file, the command is assigned to the logical channel of the command. Access priority is given to the selected file. Furthermore, the access priority given to a logical channel is held until the logical channel is blocked. As a result, in the logical channel first selected as the current file, various commands for accessing the file are allowed, but in other logical channels, access to the file can be restricted. . As a result, the consistency of each process can be maintained even when a process request for accessing a specific file through a plurality of logical channels is received.

次に、上記ICカード2における第2の動作例について説明する。
本第2の動作例は、上記第1の動作例に加えて、他の論理チャネルにアクセス優先権が与えられている場合に、実行可能なコマンドの制限されていることをICカード処理装置(コマンドの送信元)1に通知する処理を行うものである。なお、実行可能なコマンドが制限されていることは、任意のコマンドに対するレスポンスとして通知することが可能である。ここでは、ファイル選択要求コマンドで選択するファイルに対して別の論理チャネルにアクセス優先権が与えられていた場合に、当該コマンドの論理チャネルでは、選択したファイルに対するコマンドが制限される旨を通知するものとする。
Next, a second operation example in the IC card 2 will be described.
In the second operation example, in addition to the first operation example, when an access priority is given to another logical channel, it is confirmed that an executable command is limited. Command sender) 1 is notified. It is possible to notify that a command that can be executed is limited as a response to an arbitrary command. Here, when access priority is given to another logical channel for the file selected by the file selection request command, the logical channel of the command notifies that the command for the selected file is restricted. Shall.

図8は、上記第2の動作例を説明するためのフローチャートである。
図8に示す第2の動作例は、図5に示す第1の動作例にステップS41とS42とが加えられたものとなっている。従って、図8に示すステップS41およびS42以外の各ステップは、図5に示す各ステップと同様な処理であるため、ここでは、詳細な説明を省略するものとする。
FIG. 8 is a flowchart for explaining the second operation example.
The second operation example shown in FIG. 8 is obtained by adding steps S41 and S42 to the first operation example shown in FIG. Therefore, since each step other than steps S41 and S42 shown in FIG. 8 is the same processing as each step shown in FIG. 5, detailed description thereof will be omitted here.

すなわち、上記ステップS14において、受信したファイル選択要求コマンドに応じてカレントファイルとして選択したファイルにアクセスチャネル番号が既に設定されている場合(ステップS14、YES)、上記制御部21は、当該コマンドの論理チャネルと選択したファイルのアクセスチャネル番号とが一致するか否かを判定する(ステップS41)。この判定により当該ファイル選択要求コマンドの論理チャネルと選択したファイルのアクセスチャネル番号とが一致すると判定された場合(ステップS41、YES)、上記制御部21は、上記ステップS16へ進み、通常の正常を示すレスポンスをICカード処理装置1へ送信する。   That is, when the access channel number has already been set in the file selected as the current file in response to the received file selection request command in step S14 (YES in step S14), the control unit 21 determines the logic of the command. It is determined whether or not the channel matches the access channel number of the selected file (step S41). If it is determined by this determination that the logical channel of the file selection request command matches the access channel number of the selected file (YES in step S41), the control unit 21 proceeds to step S16 and performs normal normality. The response shown is transmitted to the IC card processing apparatus 1.

これに対して、上記判定により当該ファイル選択要求コマンドの論理チャネルと選択したファイルのアクセスチャネル番号とが一致しないと判定された場合(ステップS41、NO)、上記制御部21は、当該コマンドに対するレスポンスとして、当該論理チャネルでは選択したファイルに対して実行可能なコマンドが制限される旨を当該コマンドに対する処理結果とともにICカード処理装置1へ送信する(ステップS42)。この場合、上記制御部21は、実行可能なコマンドが制限される旨の通知だけでなく、具体的に実行不可となるコマンド(あるいは実行が許容されるコマンド)を示す情報をレスポンスとして通知するようにしても良い。   On the other hand, when it is determined that the logical channel of the file selection request command does not match the access channel number of the selected file (NO in step S41), the control unit 21 responds to the command. As a result, a command that the executable command for the selected file is restricted in the logical channel is transmitted to the IC card processing apparatus 1 together with the processing result for the command (step S42). In this case, the control unit 21 not only notifies that an executable command is limited, but also notifies information indicating a command that cannot be specifically executed (or a command that is allowed to be executed) as a response. Anyway.

次に、上述した第2の動作例を適用したICカード2における具体例な動作例について説明する。
図9は、上記第2の動作例に従って動作するICカード2が図6に示す一連のコマンドに対して実行する動作を説明するための図である。なお、図6に示すコマンドC2以外の各コマンドに対する動作は、上述した図8に示す第1の動作例の動作を同様であるため、詳細な説明を省略するものとする。
Next, a specific operation example in the IC card 2 to which the above-described second operation example is applied will be described.
FIG. 9 is a diagram for explaining the operation that the IC card 2 that operates according to the second operation example executes in response to the series of commands shown in FIG. The operation for each command other than the command C2 shown in FIG. 6 is the same as the operation of the first operation example shown in FIG. 8 described above, and detailed description thereof will be omitted.

すなわち、論理チャネル1を指定したファイルAの選択要求コマンドC1に応じてファイルAのアクセスチャネル番号が論理チャネル1を示す「1」に設定された状態であるものとする。この状態において論理チャネル1を指定したファイルAの選択要求コマンドC2を受信した場合、上記制御部21は、上記ステップS12〜S16、S41、S42の処理として、ファイルAを論理チャネル2のカレントファイルに設定し、ファイルAにアクセスチャネル番号として「1」が設定済みであることを確認する。この場合、上記制御部21は、ファイルAにはアクセスチャネル番号として「1」が設定済みであるため、論理チャネル2では実行可能なコマンドが制限される旨を処理の実行結果とともに上記コマンドC2のレスポンスとして送信する。   That is, it is assumed that the access channel number of the file A is set to “1” indicating the logical channel 1 in response to the selection request command C1 of the file A specifying the logical channel 1. In this state, when the selection request command C2 of the file A specifying the logical channel 1 is received, the control unit 21 changes the file A to the current file of the logical channel 2 as the processing of steps S12 to S16, S41, and S42. Confirm that “1” is already set as the access channel number in file A. In this case, since “1” is already set as the access channel number in the file A, the control unit 21 indicates that the command executable in the logical channel 2 is limited together with the execution result of the command C2. Send as a response.

上記のような第2の動作例によれば、ファイル選択要求によりカレントファイルを設定した場合、当該カレントファイルへのアクセス優先権が当該コマンドの論理チャネルとは別の論理チャネルに与えられていれば、当該コマンドの論理チャネルでは当該ファイルに対して実行可能なコマンドが制限される旨を通知することが可能となる。   According to the second operation example as described above, when the current file is set by the file selection request, the access priority to the current file is given to a logical channel different from the logical channel of the command. It is possible to notify that the command that can be executed on the file is restricted in the logical channel of the command.

次に、上記ICカード2における第3の動作例について説明する。
本第3の動作例は、上記第1の動作例に加えて、特定のファイルにアクセス優先権が与えられている論理チャネルが閉塞される場合に、当該ファイルのアクセス優先権を別の論理チャネルに移す処理を行うものである。ここでは、閉塞される論理チャネルにアクセス優先権が与えられているファイルを選択している別の論理チャネルに当該ファイルのアクセス優先権を与えることを想定して説明するものとする。
Next, a third operation example in the IC card 2 will be described.
In the third operation example, in addition to the first operation example, when a logical channel to which an access priority is given to a specific file is blocked, the access priority of the file is changed to another logical channel. The process to move to is performed. Here, the description will be made assuming that the access priority of the file is given to another logical channel that has selected the file to which the access priority is given to the logical channel to be blocked.

図10は、上記第3の動作例を説明するためのフローチャートである。
図10に示す第3の動作例は、図5に示す第1の動作例に、ステップS51とS52とが加えられたものとなっている。従って、図10に示すステップS51およびS52以外の各ステップは、図5に示す各ステップと同様な処理であるため、ここでは、詳細な説明を省略するものとする。
FIG. 10 is a flowchart for explaining the third operation example.
The third operation example shown in FIG. 10 is obtained by adding steps S51 and S52 to the first operation example shown in FIG. Accordingly, each step other than steps S51 and S52 shown in FIG. 10 is the same processing as each step shown in FIG. 5, and therefore detailed description thereof will be omitted here.

すなわち、上記ステップS32において、ある論理チャネルが閉塞されるものとする。この場合、上記制御部21は、閉塞する論理チャネルに与えられているアクセス優先権を別の論理チャネルに移すことが可能であるか否かを判断する(ステップS51)。すなわち、上記制御部21は、閉塞する論理チャネルにアクセス優先権が与えられているファイルを検出する。閉塞する論理チャネルにアクセス優先権が与えられているファイルが検出されると、上記制御部21は、検出されたファイルが別の論理チャネルで選択されているか否かを判断する。この判断により閉塞する論理チャネルにアクセス優先権が与えられているファイルを選択している論理チャネルが存在すると判断した場合、上記制御部21は、アクセス優先権の移動が可能であると判断する。   In other words, it is assumed that a certain logical channel is blocked in step S32. In this case, the control unit 21 determines whether or not the access priority given to the logical channel to be blocked can be transferred to another logical channel (step S51). That is, the control unit 21 detects a file in which access priority is given to the logical channel to be blocked. When a file in which access priority is given to the logical channel to be blocked is detected, the control unit 21 determines whether the detected file is selected in another logical channel. If it is determined by this determination that there is a logical channel that selects a file to which access priority is given to the logical channel to be blocked, the control unit 21 determines that the access priority can be transferred.

上記判断により閉塞する論理チャネルにアクセス優先権が与えられているファイルが別の論理チャネルで選択されていると判断した場合、上記制御部21は、当該ファイルのファイル制御情報におけるアクセスチャネル番号を当該ファイルを選択していると判断された別の論理チャネルに書き換える(ステップS52)。これにより、閉塞する論理チャネルにアクセス優先権を設定していたファイルのアクセス優先権は閉塞する論理チャネルから当該ファイルを選択している別の論理チャネルに移動される。   If it is determined by the above determination that the file to which the access priority is given to the logical channel to be blocked is selected by another logical channel, the control unit 21 determines the access channel number in the file control information of the file. The file is rewritten to another logical channel determined to have selected the file (step S52). As a result, the access priority of the file for which the access priority has been set for the logical channel to be blocked is moved from the logical channel to be blocked to another logical channel that has selected the file.

また、上記判断により閉塞する論理チャネルに与えられているアクセス優先権が移動できないと判断した場合(たとえば、閉塞する論理シャネルにアクセス優先権が与えられているファイルが別の論理チャネルで選択されていない場合)、上記制御部21は、当該ファイルのファイル制御情報におけるアクセスチャネル番号(閉塞する論理チャネルを示す情報)をクリアする(ステップS33)。   If it is determined by the above determination that the access priority given to the logical channel to be blocked cannot be moved (for example, a file to which access priority is given to the logical channel to be blocked is selected on another logical channel). If not, the control unit 21 clears the access channel number (information indicating the logical channel to be blocked) in the file control information of the file (step S33).

次に、上述した第3の動作例を適用したICカード2における具体例な動作例について説明する。
図11は、上記第3の動作例に従って動作するICカード2が図6に示す一連のコマンドに対して実行する動作を説明するための図である。なお、図6に示すコマンドC7以外の各コマンドに対する動作は、上述した図8に示す第1の動作例の動作を同様であるため、詳細な説明を省略するものとする。
Next, a specific operation example in the IC card 2 to which the above-described third operation example is applied will be described.
FIG. 11 is a diagram for explaining an operation executed by the IC card 2 that operates according to the third operation example with respect to the series of commands shown in FIG. The operation for each command other than the command C7 shown in FIG. 6 is the same as the operation of the first operation example shown in FIG. 8 described above, and thus detailed description thereof will be omitted.

すなわち、ファイルAのアクセスチャネル番号が論理チャネル1を示す「1」に設定され、かつ、論理チャネル2のカレントファイルがファイルAに設定されている状態において、論理チャネル1の閉塞を要求するコマンドC7を受信した場合、上記制御部21は、上記ステップS31〜S34、S51、S52の処理として、論理チャネル1を閉塞し、ファイルAのアクセスチャネル番号を「1」から「2」に書き換える。   That is, in the state where the access channel number of the file A is set to “1” indicating the logical channel 1 and the current file of the logical channel 2 is set to the file A, the command C7 that requests blocking of the logical channel 1 The control unit 21 closes the logical channel 1 and rewrites the access channel number of the file A from “1” to “2” as the processing of steps S31 to S34, S51, and S52.

上記のような第3の動作例によれば、論理チャネルが閉塞される場合に、当該論理チャネルに与えられているファイルのアクセス優先権を当該ファイルを選択している別の論理チャネルに移行させるようにしたものである。アクセス優先権が与えられている論理チャネルが閉塞されれば、当該ファイルを選択するコマンドを再度実行しなくとも、当該ファイルを選択している別の論理チャネルは、当該ファイルのアクセス優先権を自動的に得ることが可能となる。   According to the third operation example as described above, when a logical channel is blocked, the access priority of a file given to the logical channel is transferred to another logical channel that selects the file. It is what I did. If the logical channel to which the access priority is given is blocked, another logical channel that selects the file automatically sets the access priority of the file without executing the command to select the file again. Can be obtained.

次に、上記ICカード2における第4の動作例について説明する。
本第4の動作例は、上記第1の動作例に加えて、アクセス優先権が取得可能なファイルに関する情報をICカード処理装置(コマンドの送信元)1に通知する処理を行うものである。なお、アクセス優先権が取得可能なファイルに関する情報は、任意のコマンドに対するレスポンスとして通知することが可能である。ここでは、アクセス優先権が設定されていないためにコマンド(例えば、データ書換えコマンド)が実行できなかった場合に、当該コマンドのレスポンスとして、当該コマンドの論理チャネルで当該ファイルのアクセス優先権を取得することが可能である旨を通知するものとする。
Next, a fourth operation example in the IC card 2 will be described.
In the fourth operation example, in addition to the first operation example, a process for notifying the IC card processing device (command transmission source) 1 of information related to a file for which an access priority can be acquired is performed. Note that information regarding a file for which access priority can be acquired can be notified as a response to an arbitrary command. Here, when a command (for example, a data rewrite command) cannot be executed because the access priority is not set, the access priority of the file is acquired as a response to the command using the logical channel of the command. It shall be notified that it is possible.

図12は、上記第4の動作例を説明するためのフローチャートである。
図12に示す第4の動作例は、図5に示す第1の動作例に、ステップS61とS62とが加えられたものとなっている。従って、図12に示すステップS61およびS62以外の各ステップは、図5に示す各ステップと同様な処理であるため、ここでは、詳細な説明を省略するものとする。
FIG. 12 is a flowchart for explaining the fourth operation example.
The fourth operation example shown in FIG. 12 is obtained by adding steps S61 and S62 to the first operation example shown in FIG. Accordingly, each step other than steps S61 and S62 shown in FIG. 12 is the same processing as each step shown in FIG. 5, and therefore detailed description thereof will be omitted here.

すなわち、上記ステップS25において、受信コマンドの当該論理チャネルにアクセス優先権が設定されていないために当該受信コマンドの実行不可であると判断された場合、上記制御部21は、当該受信コマンドが処理対象としているファイルに対するアクセス優先権が当該受信コマンドの論理チャネルで取得可能な状態であるか否かを判断する(ステップS61)。これは、当該ファイルのファイル制御情報においてアクセスチャネル番号が設定されているか否かにより判断することが可能である。   That is, in step S25, when it is determined that the received command cannot be executed because the access priority is not set for the logical channel of the received command, the control unit 21 determines that the received command is a processing target. It is determined whether or not the access priority for the file to be acquired is in a state that can be acquired by the logical channel of the received command (step S61). This can be determined based on whether or not an access channel number is set in the file control information of the file.

上記判断により当該受信コマンドの論理チャネルで上記アクセス優先権が取得可能であると判断した場合(ステップS61、YES)、上記制御部21は、当該受信コマンドが実行不可である旨とともに、当該ファイルのアクセス優先権を当該論理チャネルで取得可能な状態である旨の情報を当該受信コマンドのレスポンスとしてICカード処理装置1へ送信する(ステップS62)。なお、上記アクセス優先権が取得可能な状態でないと判断した場合(ステップS61、NO)、上記制御部21は、当該受信コマンドが実行不可である旨とともに、当該ファイルのアクセス優先権が設定されている論理チャネルを示す情報を送信するようにしても良い。   If it is determined by the above determination that the access priority can be acquired on the logical channel of the received command (step S61, YES), the control unit 21 indicates that the received command cannot be executed and the file Information indicating that the access priority can be acquired on the logical channel is transmitted to the IC card processing apparatus 1 as a response to the received command (step S62). If it is determined that the access priority is not available (step S61, NO), the control unit 21 indicates that the received command cannot be executed and the access priority of the file is set. Information indicating the existing logical channel may be transmitted.

次に、上述した第4の動作例を適用したICカード2における具体例な動作例について説明する。
図13は、上記第4の動作例に従って動作するICカード2が図6に示す一連のコマンドに対して実行する動作を説明するための図である。なお、図6に示すコマンドC8以外の各コマンドに対する動作は、上述した図8に示す第1の動作例の動作を同様であるため、詳細な説明を省略するものとする。
Next, a specific operation example in the IC card 2 to which the above-described fourth operation example is applied will be described.
FIG. 13 is a diagram for explaining an operation that the IC card 2 that operates according to the fourth operation example executes in response to the series of commands shown in FIG. The operation for each command other than the command C8 shown in FIG. 6 is the same as the operation of the first operation example shown in FIG. 8 described above, and detailed description thereof will be omitted.

すなわち、上記コマンドC7に応じて論理チャネル1を閉塞する際に、論理チャネル1にアクセス優先権が与えられていたファイルAのアクセスチャネル番号がクリアされている状態であるものとする。この状態において、論理チャネル2を指定したデータの書込み要求コマンドC8を受信した場合、上記制御部21は、上記ステップ21〜S26の処理として、当該コマンドC8の実行を不可とする。これは、論理チャネル2のカレントファイル(ファイルA)のアクセスチャネル番号が「2」(論理チャネル2)に設定されていないためである。   That is, when the logical channel 1 is closed in response to the command C7, the access channel number of the file A to which the access priority is given to the logical channel 1 is cleared. In this state, when the data write request command C8 designating the logical channel 2 is received, the control unit 21 disables the execution of the command C8 as the processing of steps 21 to S26. This is because the access channel number of the current file (file A) of logical channel 2 is not set to “2” (logical channel 2).

さらに、第4の動作例では、上記コマンドC8の実行を不可とした場合、上記制御部21は、上記コマンドC8の処理対象とするファイルAのアクセスチャネル番号が未設定であるか否かを判断する。ここでは、上記コマンドC8を受信した時点においてファイルAのアクセスチャネル番号がクリアされている状態である。このため、上記制御部21は、上記コマンドC8に対するレスポンスとして、上記コマンドC8がアクセス優先権がないために実行不可となった旨と、当該ファイルAのアクセス優先権が当該論理チャネルで取得可能である旨とをICカード処理装置1へ送信する。   Furthermore, in the fourth operation example, when the execution of the command C8 is disabled, the control unit 21 determines whether or not the access channel number of the file A to be processed by the command C8 is not set. To do. Here, the access channel number of file A is cleared when the command C8 is received. Therefore, as a response to the command C8, the control unit 21 can acquire that the command C8 cannot be executed because it does not have access priority, and can acquire the access priority of the file A on the logical channel. A message to the effect is transmitted to the IC card processing apparatus 1.

上記のような第4の動作例によれば、アクセス優先権がないために実行不可となったコマンドについては、当該コマンドが処理対象とするファイルのアクセスチャネル番号が未設定であれば、上記コマンドが実行不可である旨と当該ファイルに対するアクセス優先権が取得可能な状態である旨とをレスポンスとして送信するようにしたものである。これにより、第3の動作例のようにアクセス優先権を自動的に移動させたくない場合であっても、アクセス優先権が取得可能な状態であるか否かを適宜ICカード処理装置に通知することができ、効率的な処理が可能となる。   According to the fourth operation example described above, for a command that cannot be executed due to lack of access priority, if the access channel number of a file to be processed by the command is not set, the command Is transmitted as a response indicating that the file cannot be executed and that the access priority for the file can be acquired. As a result, even when it is not desired to automatically move the access priority as in the third operation example, the IC card processing device is appropriately notified whether or not the access priority can be acquired. And efficient processing becomes possible.

次に、上記ICカード2における第5の動作例について説明する。
本第5の動作例は、上記第1の動作例に加えて、ファイルへのアクセス優先権がない論理チャネルでの処理において、別の論理チャネル(アクセス優先権を有する論理チャネル)でのコマンドによる当該ファイルの変化を示す情報を、ICカード処理装置(コマンドの送信元)1に通知する処理を行うものである。なお、ファイルの状態変化を示す情報は、当該ファイルのアクセス優先権がない論理チャネルでの任意のコマンドに対するレスポンスとして通知することが可能である。ここでは、アクセス優先権が設定されていないためにコマンド(例えば、データ書換えコマンド)が実行できなかった場合、当該コマンドがアクセス対象とするファイルが別の論理チャネルにおけるコマンドでデータが変化されていれば、その旨を当該コマンドのレスポンスとして通知するものとする。
Next, a fifth operation example in the IC card 2 will be described.
In the fifth operation example, in addition to the first operation example, in processing on a logical channel having no access priority to a file, a command in another logical channel (logical channel having access priority) is used. Processing for notifying the IC card processing device (command transmission source) 1 of information indicating the change of the file is performed. Note that information indicating a change in the state of a file can be notified as a response to an arbitrary command in a logical channel that does not have access priority for the file. Here, if a command (for example, a data rewrite command) cannot be executed because the access priority is not set, the file to be accessed by the command has been changed by a command in another logical channel. If so, it is notified as a response to the command.

図14は、上記第5の動作例を説明するためのフローチャートである。
図14に示す第5の動作例は、図5に示す第1の動作例に、ステップS71とS72とが加えられたものとなっている。従って、図14に示すステップS71およびS72以外の各ステップは、図5に示す各ステップと同様な処理であるため、ここでは、詳細な説明を省略するものとする。
FIG. 14 is a flowchart for explaining the fifth operation example.
In the fifth operation example shown in FIG. 14, steps S71 and S72 are added to the first operation example shown in FIG. Therefore, since each step other than steps S71 and S72 shown in FIG. 14 is the same processing as each step shown in FIG. 5, detailed description thereof will be omitted here.

すなわち、上記ステップS25において、受信コマンドの当該論理チャネルにファイルへのアクセス優先権が設定されていないために当該受信コマンドが実行不可であると判断された場合、上記制御部21は、当該受信コマンドが処理対象としているファイルに対して別の論理チャネル(アクセス優先権を有する論理チャネル)でデータの変化を伴う処理が実行されているか否かを判断する(ステップS71)。これは、当該コマンドがアクセス対象するファイルが別の論理チャネルでの処理により変化している可能性があるか否かをを判断するものである。つまり、上記制御部21は、当該コマンドのアクセス対象ファイルに対して、アクセス優先権を有する論理チャネルでのコマンドによりデータが変化する可能性がある処理が実行されているか否かを判断する。   That is, in step S25, if it is determined that the received command cannot be executed because the access priority to the file is not set in the logical channel of the received command, the control unit 21 It is determined whether or not a process involving a data change is being executed on another logical channel (logical channel having access priority) for the file to be processed (step S71). This is to determine whether there is a possibility that the file to be accessed by the command may have changed due to processing in another logical channel. That is, the control unit 21 determines whether or not a process in which data may change due to a command on a logical channel having access priority is being executed on the access target file of the command.

上記判断により当該受信コマンドがアクセス対象とするファイルに対して別の論理チャネルでデータが変化する可能性がある処理が実行されていると判断した場合(ステップS71、YES)、上記制御部21は、当該受信コマンドのレスポンスとして、実行不可である旨の情報と、当該ファイルが別の論理チャネルでデータが変更される可能性のある処理が実施されている旨の情報とをICカード処理装置1へ送信する(ステップS72)。なお、上記受信コマンドがアクセス対象とするファイルに対して別の論理チャネルでデータが変化する可能性がある処理が実行されていないと判断した場合(ステップS71、NO)、上記制御部21は、当該受信コマンドのレスポンスとして、実行不可である旨の情報と、当該ファイルに対してデータが変更されるような処理が実施されていない旨の情報とを送信するようにしても良い。   When it is determined by the above determination that a process that may change data on another logical channel is performed on the file to be accessed by the received command (YES in step S71), the control unit 21 As a response to the received command, the IC card processing device 1 includes information indicating that the execution is not possible and information indicating that the file may be subjected to processing that may change data on another logical channel. (Step S72). When it is determined that the process that may change the data in another logical channel is not executed for the file to be accessed by the received command (step S71, NO), the control unit 21 As a response to the received command, information indicating that execution is not possible and information indicating that processing for changing data on the file is not performed may be transmitted.

なお、上記のような処理を実現するため、アクセス優先権が設定されているファイル(あるいはアクセスチャネル番号が設定されていたファイル)については、少なくともデータが変更される可能性があるコマンドを実行した場合、その処理内容をRAM24などの記憶部に記憶しておくようにするものとする。これは、たとえば、上記ステップS23におけるコマンド処理として、実行した処理内容を示す情報をRAM24に記憶することにより実現される。   In order to realize the above processing, at least a command whose data may be changed was executed for a file for which access priority was set (or a file for which an access channel number was set) In this case, the processing contents are stored in a storage unit such as the RAM 24. This is realized, for example, by storing information indicating the executed processing content in the RAM 24 as the command processing in step S23.

次に、上述した第5の動作例を適用したICカード2における具体例な動作例について説明する。
図15は、上記第5の動作例に従って動作するICカード2が図6に示す一連のコマンドに対して実行する動作を説明するための図である。なお、図6に示すコマンドC8以外の各コマンドに対する動作は、上述した図8に示す第1の動作例の動作を同様であるため、詳細な説明を省略するものとする。
Next, a specific operation example in the IC card 2 to which the above-described fifth operation example is applied will be described.
FIG. 15 is a diagram for explaining an operation executed by the IC card 2 operating according to the fifth operation example with respect to the series of commands shown in FIG. The operation for each command other than the command C8 shown in FIG. 6 is the same as the operation of the first operation example shown in FIG. 8 described above, and detailed description thereof will be omitted.

すなわち、上記コマンドC6に応じてファイルAに対するアクセス優先権を有する論理チャネル1でファイルAにデータの書換え処理が実行された状態であるものとする。この状態において、論理チャネル2を指定したデータの書込み要求コマンドC8を受信した場合、上記制御部21は、上記ステップ21〜S25の処理として、当該コマンドC8の実行を不可とする。これは、論理チャネル2のカレントファイル(ファイルA)のアクセスチャネル番号が「2」(論理チャネル2)に設定されていないためである。   That is, it is assumed that data rewrite processing has been executed for file A in logical channel 1 having access priority to file A in response to command C6. In this state, when the data write request command C8 designating the logical channel 2 is received, the control unit 21 disables the execution of the command C8 as the processing of steps 21 to S25. This is because the access channel number of the current file (file A) of logical channel 2 is not set to “2” (logical channel 2).

さらに、第5の動作例では、上記コマンドC8の実行を不可とした場合、上記制御部21は、上記コマンドC8が処理対象とするファイルAに対して別の論理チャネルでデータが変化する可能性があるコマンドを実行しているか否かを判断する。ここでは、上記コマンドC8を受信した時点において既にコマンドC6の処理として論理チャネル1でファイルAに対するデータの書換え処理が実施されている。このため、上記制御部21は、上記コマンドC8に対するレスポンスとして、上記コマンドC8がアクセス優先権がないために実行不可となった旨の情報と、当該ファイルAに対して別の論理チャネルでデータの書換え処理が実施されている旨の情報とをICカード処理装置1へ送信する。   Furthermore, in the fifth operation example, when the execution of the command C8 is disabled, the control unit 21 may change data in another logical channel with respect to the file A to be processed by the command C8. Determine whether a command is being executed. Here, when the command C8 is received, the data rewrite processing for the file A is already performed in the logical channel 1 as the processing of the command C6. For this reason, the control unit 21 responds to the command C8 with information that the command C8 cannot be executed because it does not have access priority and the data of the file A on another logical channel. Information indicating that the rewriting process is being performed is transmitted to the IC card processing apparatus 1.

上記のような第5の動作例によれば、アクセス優先権がないためにコマンドが実行不可となった場合、当該コマンドが処理対象とするファイルに対して別の論理チャネル(アクセス優先権がある論理チャネル)でデータが変化する可能性があるコマンドが実施済みであれば、上記コマンドが実行不可である旨と当該ファイルに対して別の論理チャネルでデータが変化する可能性があるコマンドが実施済みである旨とをレスポンスとして送信するようにしたものである。これにより、アクセス優先権がない論理チャネルでは実行可能なコマンドが制限されているファイルに対して、アクセス優先権がある別の論理チャネルで実行された処理内容を適宜ICカード処理装置に通知することができ、その結果として効率的な処理が可能となる。   According to the fifth operation example as described above, when a command cannot be executed because there is no access priority, another logical channel (with access priority) for the file to be processed by the command. If a command that may change data on a logical channel) has been executed, the command cannot be executed and a command that may change data on another logical channel is executed for the file. The fact that it has been completed is transmitted as a response. As a result, the processing contents executed on another logical channel with access priority are appropriately notified to the IC card processing device for a file in which commands executable on the logical channel without access priority are restricted. As a result, efficient processing becomes possible.

なお、この発明は、上述した実施の形態そのままに限定されるものではなく、実施段階ではその要旨を逸脱しない範囲で構成要素を変形して具現化できる。また、上記実施形態に開示されている複数の構成要素の適宜な組み合わせにより、種々の発明を形成できる。例えば、実施形態に示される全構成要素から幾つかの構成要素を削除してもよい。更に、異なる実施形態に亘る構成要素を適宜組み合わせてもよい。   Note that the present invention is not limited to the above-described embodiment as it is, and can be embodied by modifying the constituent elements without departing from the scope of the invention in the implementation stage. In addition, various inventions can be formed by appropriately combining a plurality of components disclosed in the embodiment. For example, some components may be deleted from all the components shown in the embodiment. Furthermore, you may combine the component covering different embodiment suitably.

ICカードと、ICカードとの通信機能を有するICカード処理装置の構成例を概略的に示すブロック図である。It is a block diagram which shows roughly the structural example of an IC card processing apparatus which has a communication function with an IC card and an IC card. ICカードのハードウエア構成例を概略的に示すブロック図である。It is a block diagram which shows roughly the hardware structural example of an IC card. コマンドの構成例を示す図。The figure which shows the structural example of a command. ファイル制御情報の構成例を示す図。The figure which shows the structural example of file control information. 種々のコマンドに対する第1の動作例を説明するためのフローチャート。The flowchart for demonstrating the 1st operation example with respect to various commands. ICカードに与えられるコマンド群の例を示す図である。It is a figure which shows the example of the command group given to an IC card. 第1の動作例に従って動作するICカードが図6に示す一連のコマンドに対して実行する動作を説明するための図。The figure for demonstrating the operation | movement which the IC card which operate | moves according to a 1st operation example performs with respect to the series of commands shown in FIG. 第2の動作例を説明するためのフローチャート。The flowchart for demonstrating the 2nd operation example. 第2の動作例に従って動作するICカードが図6に示す一連のコマンドに対して実行する動作を説明するための図。The figure for demonstrating the operation | movement which the IC card which operate | moves according to a 2nd operation example performs with respect to a series of commands shown in FIG. 第3の動作例を説明するためのフローチャート。The flowchart for demonstrating the 3rd operation example. 第3の動作例に従って動作するICカードが図6に示す一連のコマンドに対して実行する動作を説明するための図。The figure for demonstrating the operation | movement which the IC card which operate | moves according to a 3rd operation example performs with respect to the series of commands shown in FIG. 第4の動作例を説明するためのフローチャート。10 is a flowchart for explaining a fourth operation example. 第4の動作例に従って動作するICカードが図6に示す一連のコマンドに対して実行する動作を説明するための図。The figure for demonstrating the operation | movement which the IC card which operate | moves according to a 4th operation example performs with respect to the series of commands shown in FIG. 第5の動作例を説明するためのフローチャート。10 is a flowchart for explaining a fifth operation example. 第5の動作例に従って動作するICカードが図6に示す一連のコマンドに対して実行する動作を説明するための図。The figure for demonstrating the operation | movement which the IC card which operate | moves according to a 5th operation example performs with respect to the series of commands shown in FIG.

符号の説明Explanation of symbols

C…本体、M…モジュール、Ca…ICチップ、1…ICカード処理装置、2…ICカード、11…端末装置、12…ディスプレイ、13…キーボード、14…テンキー、15…カードリーダライタ、21…制御部、22…通信インターフェース、23…ROM、24…RAM、25…不揮発性メモリ。   C ... Main body, M ... Module, Ca ... IC chip, 1 ... IC card processing device, 2 ... IC card, 11 ... Terminal device, 12 ... Display, 13 ... Keyboard, 14 ... Numeric keypad, 15 ... Card reader / writer, 21 ... Control unit, 22 ... communication interface, 23 ... ROM, 24 ... RAM, 25 ... nonvolatile memory.

Claims (8)

外部装置から与えられるコマンドに対する処理を行うICカードにおいて、
複数のチャネルで外部装置との通信を行う通信手段と、
ファイルの定義情報と前記定義情報で定義されるファイルのデータとを記憶する記憶手段と、
前記ファイルへのアクセスに優先権を有するチャネルを示す情報を前記ファイルの定義情報に設定する設定手段と、
前記通信手段により受信した前記ファイルへのアクセスを要求するコマンドのチャネルが当該ファイルへのアクセスに優先権を有するチャネルである場合、前記コマンドで要求される前記ファイルへの処理を実行する第1の処理手段と、
前記通信手段により受信した前記ファイルへのアクセスを要求するコマンドのチャネルが当該ファイルへのアクセスに優先権がないチャネルである場合、前記通信手段により受信した前記コマンドに対する処理が実行可能か否かを判断する判断手段と、
前記判断手段により前記コマンドに対する処理が実行可能であると判断した場合、前記コマンドに対する処理を実行する第2の処理手段と、
前記判断手段により前記コマンドに対する処理が実行不可であると判断した場合、前記コマンドに対する処理を実行せずに、ファイルへのアクセスに優先権がないため実行不可となったことを示すレスポンスを前記外部装置へ送信する第3の処理手段と、
を有することを特徴とするICカード
In an IC card that processes a command given from an external device,
A communication means for communicating with an external device through a plurality of channels;
Storage means for storing file definition information and file data defined by the definition information;
Setting means for setting information indicating a channel having a priority for access to the file in the definition information of the file;
When a channel of a command requesting access to the file received by the communication means is a channel having a priority for access to the file, a first process for executing processing on the file requested by the command is executed. Processing means;
If the channel of the command that requests access to the file received by the communication means is a channel that does not have priority for access to the file, whether or not the process for the command received by the communication means can be executed. A judging means for judging;
A second processing unit that executes processing for the command when the determination unit determines that processing for the command is executable;
When the determination unit determines that the process for the command is not executable, the process for the command is not executed, and a response indicating that the process cannot be executed because there is no priority for access to the file. Third processing means for transmitting to the device;
An IC card characterized by comprising:
前記設定手段は、前記通信手段によりファイルを選択するコマンドを受信した場合、当該コマンドで選択されるファイルに対する優先権が未設定であれば、当該ファイルに対するアクセスの優先権を当該コマンドのチャネルに設定する、
ことを特徴とする前記請求項1に記載のICカード
When the setting means receives a command for selecting a file by the communication means, if the priority for the file selected by the command is not set, the access priority for the file is set in the channel of the command. To
The IC card according to claim 1, wherein:
さらに、アクセス対象とするファイルを選択するコマンドを受信した場合、当該コマンドのチャネルが当該ファイルへのアクセスに優先権がないチャネルであれば、当該チャネルでのファイルへのアクセスが制限される旨を通知する通知手段を有する、
ことを特徴とする前記請求項1又は2の何れかに記載のICカード
Furthermore, when a command for selecting a file to be accessed is received, if the channel of the command is a channel for which priority is not given to access to the file, access to the file through the channel is restricted. Having a notification means to notify,
The IC card according to claim 1, wherein the IC card is characterized in that
さらに、前記優先権が与えられているチャネルが閉塞された場合、当該ファイルへのアクセスの優先権を当該ファイルを選択している別のチャネルに変更する設定変更手段を有する、
ことを特徴とする前記請求項1乃至3の何れか1項に記載のICカード
Furthermore, when the channel to which the priority is given is blocked, it has setting change means for changing the priority of access to the file to another channel that selects the file.
The IC card according to any one of claims 1 to 3, characterized in that:
さらに、前記優先権が未設定のファイルに対してアクセスを要求するコマンドを受信した場合、当該ファイルに対するアクセスの優先権を当該コマンドのチャネルに設定することが可能な状態である旨を報知する報知手段を有する、
ことを特徴とする前記請求項1乃至4の何れか1項に記載のICカード
Further, when a command for requesting access to a file for which the priority is not set is received, a notification for notifying that the access priority for the file can be set in the channel of the command Having means,
The IC card according to any one of claims 1 to 4, wherein:
さらに、前記優先権が与えられていないチャネルのコマンドに対する応答として、当該コマンドがアクセス対象とするファイルに対して前記優先権が与えられている別のチャネルで実行済みの処理内容を通知する応答を行う応答手段を有する、
ことを特徴とする前記請求項1乃至5の何れか1項に記載のICカード
Further, as a response to the command of the channel to which the priority is not given, a response for notifying the contents of processing executed in another channel to which the priority is given to the file to be accessed by the command is sent. Having response means to perform,
The IC card according to any one of claims 1 to 5, wherein the IC card is characterized in that
複数のチャネルで外部装置との通信を行う通信手段と、ファイルの定義情報と前記定義情報で定義されるファイルのデータとを記憶する記憶手段とを有するICカードの制御方法であって、
前記ファイルへのアクセスに優先権を有するチャネルを示す情報を前記ファイルの定義情報に設定し、
前記ファイルへのアクセスを要求するコマンドのチャネルが当該ファイルへのアクセスに優先権を有するチャネルである場合、当該コマンドで要求される前記ファイルへの処理を実行し、
前記ファイルへのアクセスを要求するコマンドのチャネルが当該ファイルへのアクセスに優先権がないチャネルである場合、前記コマンドに対する処理が実行可能か否かを判断し、
前記判断により前記コマンドに対する処理が実行可能であると判断した場合、前記コマンドに対する処理を実行し、
前記判断により前記コマンドに対する処理が実行不可であると判断した場合、前記コマンドに対する処理を実行せずに、ファイルへのアクセスに優先権がないため実行不可となったことを示すレスポンスを前記外部装置へ送信する、
ことを特徴とするICカードの制御方法。
An IC card control method comprising: a communication unit that communicates with an external device using a plurality of channels; and a storage unit that stores file definition information and file data defined by the definition information,
Set information indicating the channel having priority to access the file in the definition information of the file,
When the channel of the command that requests access to the file is a channel that has priority for access to the file, execute processing for the file requested by the command,
If the channel of the command requesting access to the file is a channel that does not have priority for access to the file, determine whether the process for the command can be executed,
If it is determined that the process for the command is executable by the determination, the process for the command is executed ,
If it is determined by the determination that the process for the command is not executable, the external device receives a response indicating that the process cannot be executed without executing the process for the command and the file access has no priority. Send to
An IC card control method characterized by the above.
外部装置から与えられるコマンドに対する処理を行うICカードにおいて、
複数のチャネルで外部装置との通信を行う通信手段と、ファイルの定義情報と前記定義情報で定義されるファイルのデータとを記憶する記憶手段と、前記ファイルへのアクセスに優先権を有するチャネルを示す情報を前記ファイルの定義情報に設定する設定手段と、前記通信手段により受信した前記ファイルへのアクセスを要求するコマンドのチャネルが当該ファイルへのアクセスに優先権を有するチャネルである場合、前記コマンドで要求される前記ファイルへの処理を実行する第1の処理手段と、前記通信手段により受信した前記ファイルへのアクセスを要求するコマンドのチャネルが当該ファイルへのアクセスに優先権がないチャネルである場合、前記通信手段により受信した前記コマンドに対する処理が実行可能か否かを判断する判断手段と、前記判断手段により前記コマンドに対する処理が実行可能であると判断した場合、前記コマンドに対する処理を実行する第2の処理手段と、前記判断手段により前記コマンドに対する処理が実行不可であると判断した場合、前記コマンドに対する処理を実行せずに、ファイルへのアクセスに優先権がないため実行不可となったことを示すレスポンスを前記外部装置へ送信する第3の処理手段と、を具備するモジュールと、
前記モジュールを具備する本体と、
を有することを特徴とするICカード。
In an IC card that processes a command given from an external device,
A communication means for communicating with an external device through a plurality of channels; a storage means for storing file definition information and file data defined by the definition information; and a channel having priority for access to the file. The setting means for setting the information to be indicated in the definition information of the file, and the command channel that requests access to the file received by the communication means is a channel that has priority for access to the file. The first processing means for executing the processing for the file requested in step (1) and the command channel for requesting access to the file received by the communication means are channels for which priority is not given to access to the file. If, determine the processing to the command received by the communication means to determine whether viable Determining means, when it is determined that processing of the command can be executed by the determining means, and second processing means for executing processing for the command, the process for the command by the determining means is not executable And a third processing means for transmitting to the external device a response indicating that the processing cannot be executed without executing the processing for the command and the file access has no priority and thus cannot be executed. When,
A main body comprising the module;
An IC card characterized by comprising:
JP2008071712A 2007-09-20 2008-03-19 IC card and IC card control method Expired - Fee Related JP5214291B2 (en)

Priority Applications (4)

Application Number Priority Date Filing Date Title
JP2008071712A JP5214291B2 (en) 2008-03-19 2008-03-19 IC card and IC card control method
SG200806667-2A SG151197A1 (en) 2007-09-20 2008-09-03 Portable electronic apparatus and control method for portable electronic apparatus
US12/205,235 US20090083273A1 (en) 2007-09-20 2008-09-05 Portable electronic apparatus and control method for portable electronic apparatus
FR0856176A FR2923630B1 (en) 2007-09-20 2008-09-15 PORTABLE ELECTRONIC DEVICE AND METHOD FOR CONTROLLING A PORTABLE ELECTRONIC DEVICE

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008071712A JP5214291B2 (en) 2008-03-19 2008-03-19 IC card and IC card control method

Publications (3)

Publication Number Publication Date
JP2009230214A JP2009230214A (en) 2009-10-08
JP2009230214A5 JP2009230214A5 (en) 2010-10-28
JP5214291B2 true JP5214291B2 (en) 2013-06-19

Family

ID=41245576

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008071712A Expired - Fee Related JP5214291B2 (en) 2007-09-20 2008-03-19 IC card and IC card control method

Country Status (1)

Country Link
JP (1) JP5214291B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7224243B2 (en) 2019-06-10 2023-02-17 株式会社ディスコ Flange mechanism

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6252341B2 (en) * 2014-04-28 2017-12-27 大日本印刷株式会社 Electronic information storage medium, information processing method, and information processing program

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3691871B2 (en) * 1995-03-20 2005-09-07 富士通株式会社 Card type storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7224243B2 (en) 2019-06-10 2023-02-17 株式会社ディスコ Flange mechanism

Also Published As

Publication number Publication date
JP2009230214A (en) 2009-10-08

Similar Documents

Publication Publication Date Title
JP4896837B2 (en) Portable electronic device and method for controlling portable electronic device
US9183400B2 (en) IC card and IC card control method
JP5225054B2 (en) IC card
KR100746036B1 (en) Apparatus and method for controlling flash memory
JP6833364B2 (en) IC card and IC card processing device
KR101783526B1 (en) Ic card, electronic device and portable electronic device
JP4896842B2 (en) Portable electronic device
JP5214291B2 (en) IC card and IC card control method
US20100235393A1 (en) Portable electronic device and access control method in portable electronic device
US20090083273A1 (en) Portable electronic apparatus and control method for portable electronic apparatus
KR100399603B1 (en) Smart card and method for writing/erasing and operating an os program the same
JP2006293706A (en) Multi-application ic card with application updating function
JP6769150B2 (en) Electronic information storage media, information processing methods, and information processing programs
JP5932588B2 (en) IC card, portable electronic device, and IC card processing device
JP5971687B2 (en) IC card, portable electronic device, and IC card command processing method
JP2014059806A (en) Ic card, portable electronic device, and ic card processor
JP5957347B2 (en) IC card and portable electronic device
JP2010218147A (en) Mobile electronic apparatus and memory control method therein
JP5242091B2 (en) Portable electronic device, IC card, and portable electronic device control method
JP6984328B2 (en) Electronic information storage medium, IC card, external device, data writing method and data writing program
JP5038918B2 (en) Portable electronic device and method for controlling portable electronic device
JP2019128905A (en) Electronic information storage medium, ic card, method for processing information with electronic information storage medium, and os
JP2008243096A (en) Portable electronic equipment and control method of portable electronic equipment
JP2016177850A (en) Ic card, portable electronic device and ic card processor
JP2016076153A (en) Portable electronic device and method

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100909

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20100909

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20120614

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120710

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120910

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20130205

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130227

R151 Written notification of patent or utility model registration

Ref document number: 5214291

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20160308

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees