JP5214291B2 - IC card and IC card control method - Google Patents
IC card and IC card control method Download PDFInfo
- 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
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カードでは、あるチャネルで、書き込み、書き換え、削除、データ消去などのファイルのデータあるいはファイルの状態を変更させる処理を実施した場合、同一ファイルにアクセスしている別のチャネルでは、これまで行ってきた処理と整合が取れなくなる場合があるという問題がある。
この発明の一形態は、上記のような問題点を解決するものであり、複数のチャネルからの処理要求に対する処理において整合性を保つことができる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
First, the configuration of the IC
As shown in FIG. 1, the IC
上記端末装置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
The
上記ディスプレイ12は、上記端末装置11の制御により種々の情報を表示する表示装置である。上記キーボード13は、当該ICカード処理装置1の操作員が操作する操作部として機能し、操作員により種々の操作指示やデータなどが入力される。上記テンキー14は、使用者IDあるいはパスワードなど数字などの情報を入力する為の入力部として機能する。
The
上記カードリーダライタ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 /
次に、上記ICカード2のハードウエア構成例について説明する。
上記ICカード2は、上記ICカード処理装置1などの上位機器から電力などの供給を受けた際、活性化される(動作可能な状態になる)ようになっている。例えば、上記ICカード2が接触型の通信によりICカード処理装置1と接続される場合、つまり、ICカード2が接触型のICカードで構成される場合、上記ICカード2は、通信インターフェースとしてのコンタクト部を介してICカード処理装置1からの動作電源及び動作クロックの供給を受けて活性化される。
Next, a hardware configuration example of the
The
また、上記ICカード2が非接触型の通信方式によりICカード処理装置1と接続される場合、つまり、上記ICカード2が非接触式のICカードで構成される場合、上記ICカード2は、通信インターフェースとしてのアンテナ及び変復調回路などを介してICカード処理装置1からの電波を受信し、その電波から図示しない電源部により動作電源及び動作クロックを生成して活性化するようになっている。
Further, when the
図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
上記制御部21は、当該ICカード2全体の制御を司るものである。上記制御部21は、上記ROM23あるいは上記不揮発性メモリ25に記憶されている制御プログラムや制御データに基づいて動作することにより、種々の機能を実現する。たとえば、上記制御部21は、オペレーティングシステムのプログラムを実行することにより、当該ICカード2の基本的な動作制御を行う。また、上記制御部21は、アプリケーションプログラムを実行することにより、当該ICカード2の運用形態に応じた種々の動作制御を行う。
The
上記通信インターフェース22は、上記ICカード処理装置1のカードリーダライタ15との通信を行うためのインターフェースである。当該ICカード2が接触型のICカードとして実現される場合、上記通信インターフェース22は、上記ICカード処理装置1のカードリーダライタ15と物理的かつ電気的に接触して信号の送受信を行うための通信制御部とコンタクト部とにより構成される。また、当該ICカード2が非接触型のICカードとして実現される場合、通信インターフェース22は、上記ICカード処理装置1のカードリーダライタ15との無線通信を行うための変復調回路などの通信制御部とアンテナとにより構成される。
The
上記ROM23は、予め制御用のプログラムや制御データなどが記憶されている不揮発性のメモリである。上記ROM23は、製造段階で制御プログラムや制御データなどが記憶された状態でICカード2内に組み込まれるものである。つまり、上記ROM23に記憶されている制御プログラムや制御データは、予め当該ICカード2の仕様に応じて組み込まれる。
上記RAM24は、ワーキングメモリとして機能する揮発性のメモリである。また、上記RAM24は、制御部21が処理中のデータなどを一時保管するバッファとしても機能する。例えば、上記RAM24は、上記通信インターフェース22を介してICカード処理装置1から受信したデータを一時保管するようになっている。また、上記RAM24上には、種々の動作状態などを管理するための管理テーブルが適宜構成されるようになっている。たとえば、後述する論理チャネルは、RAM24上に構成されるチャネル管理テーブル24aによりカレントファイルなどが管理されるようになっている。
The
The
上記不揮発性メモリ25は、例えば、EEPROM(Electrically Erasable Programmable Read-Only Memory)あるいはフラッシュROMなどのデータの書き込み及び書換えが可能な不揮発性のメモリにより構成される。上記不揮発性メモリ25には、当該ICカード2の運用用途に応じて制御プログラムや種々のデータが書込まれる。また、上記不揮発性メモリ25上には、電源供給がなくなった後もデータを保持しておくことが必要な管理テーブルも設けられる。たとえば、上記不揮発性メモリ25には、プログラムファイルあるいはデータファイルなどが定義され、それらのファイルに制御プログラムや種々のデータが書き込まれる。上記不揮発性メモリ25に格納されるファイルは、ファイル定義情報によって定義され、ファイル定義情報により定義された記憶領域にファイル本体としてのデータが格納されるようになっている。
The
次に、上記のような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
The
また、論理チャネルは、各コマンドで指定されるものである。たとえば、図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
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
FIG. 5 is a flowchart for explaining a first operation example for various commands received from the IC
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
上記受信コマンドで指定されたファイルを当該論理チャネルのカレントファイルに設定すると、上記制御部21は、当該受信コマンドの論理チャネルにおけるカレントファイルとして選択したファイルへのアクセスに優先権を有する論理チャネルが設定済みであるか否かを判断する(ステップS14)。これは、当該ファイルのファイル制御情報においてアクセスチャネル番号が設定されているか否かを判断される。
When the file specified by the reception command is set as the current file of the logical channel, the
この判断により選択したファイルへのアクセスに優先権を有する論理チャネルが設定されていないと判断した場合(ステップ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
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
また、上記受信コマンドがファイルへのアクセスを要求するコマンド(たとえば、データ読み出し、データ書込み、データ消去、ファイル削除などを要求するコマンド)である場合(ステップ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
受信コマンドの論理チャネルと当該論理チャネルのカレントファイルのアクセスチャネル番号とが一致すると判断した場合、つまり、当該論理チャネルがカレントファイルにアクセス優先権を有すると判断した場合(ステップ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
また、受信コマンドの論理チャネルと当該論理チャネルのカレントファイルのアクセスチャネル番号とが一致しないと判断した場合、つまり、当該論理チャネルがカレントファイルにアクセス優先権を有していないと判断した場合(ステップ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
上記判断により受信コマンドが実行可能なものであると判断された場合(ステップ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
また、上記受信コマンドが論理チャネルの閉塞を要求するコマンドである場合(ステップ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
なお、ファイルの選択を要求するコマンド、ファイルへのアクセスを要求するコマンド、および、論理チャネルの閉塞を要求するコマンド以外のコマンドについては、論理チャネルごとのファイルへのアクセス制御を考慮すべきものでないと考えられるため、各コマンドの処理内容に応じた処理が実行される(ステップ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
FIG. 6 is a diagram showing an example of command groups C1 to C11 given to the
まず、論理チャネル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
この状態において論理チャネル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
さらに、論理チャネル1を指定した読み出し要求コマンドC3を受信すると、上記制御部21は、上記ステップS21〜S26の処理として、ファイルAの読み出し処理を行う。これは、論理チャネル1のカレントファイル(ファイルA)には論理チャネルにアクセス優先権があるためである。従って、上記制御部21は、ファイルAのデータを読み出して、読み出したデータを当該コマンドC3のレスポンスデータとして送信する。
Further, when the read request command C3 specifying the
また、論理チャネル2を指定した読み出し要求コマンドC4を受信した場合も、上記制御部21は、ファイルAの読み出し処理を行う。これは、論理チャネル2のカレントファイル(ファイルA)には論理チャネル1にアクセス優先権があるが、読み出しコマンドはアクセス優先権がなくとも実行可能なコマンドであるためである。従って、上記制御部21は、当該コマンドC4の実行を許容し、ファイルAのデータを読み出して、読み出したデータを当該コマンドC4のレスポンスデータとして送信する処理を行う。
In addition, when the read request command C4 specifying the
次に、論理チャネル2を指定したデータの書込み要求コマンドC5を受信した場合、上記制御部21は、上記ステップ21〜S26の処理として、当該コマンドC5の実行を不可とする。これは、論理チャネル2のカレントファイル(ファイルA)には論理チャネル「1」にアクセス優先権があり、かつ、データの書込み要求コマンドはアクセス優先権がなければ実行不可なコマンドであるためである。従って、上記制御部21は、当該コマンドC5に応じた処理を実行不可として、当該コマンドC5が実行不可であった旨を当該コマンドC5のレスポンスとして送信にする。
Next, when the data write request command C5 specifying the
さらに、論理チャネル1を指定したデータの書込み要求コマンドC6を受信した場合、上記制御部21は、当該コマンドC6を実行する。これは、論理チャネル1のカレントファイル(ファイルA)には論理チャネル「1」にアクセス優先権があるためである。すなわち、上記制御部21は、当該コマンドC6で指定されている処理内容に従って、ファイルAのデータを書換え、その処理結果を当該コマンドC6のレスポンスとして送信する処理を行う。
Further, when the data write request command C6 specifying the
次に、論理チャネル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
この状態において、論理チャネル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
次に、論理チャネル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
従って、上記コマンド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
次に、論理チャネル2の閉塞を要求するコマンドC11を受信した場合、上記制御部21は、上記ステップ31〜S34の処理として、論理チャネル2を閉塞させ、論理チャネル2におけるカレントファイルの設定をクリアするとともに、論理チャネル2にアクセス優先権を与えていたファイルAのアクセスチャネル番号をクリアする。これにより、上記ファイルAには、どの論理チャネルにもアクセス優先権が付与されていない状態となる。
Next, when the command C11 requesting blocking of the
上記のように、第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
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
これに対して、上記判定により当該ファイル選択要求コマンドの論理チャネルと選択したファイルのアクセスチャネル番号とが一致しないと判定された場合(ステップ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
次に、上述した第2の動作例を適用したICカード2における具体例な動作例について説明する。
図9は、上記第2の動作例に従って動作するICカード2が図6に示す一連のコマンドに対して実行する動作を説明するための図である。なお、図6に示すコマンドC2以外の各コマンドに対する動作は、上述した図8に示す第1の動作例の動作を同様であるため、詳細な説明を省略するものとする。
Next, a specific operation example in the
FIG. 9 is a diagram for explaining the operation that the
すなわち、論理チャネル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
上記のような第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
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
上記判断により閉塞する論理チャネルにアクセス優先権が与えられているファイルが別の論理チャネルで選択されていると判断した場合、上記制御部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
また、上記判断により閉塞する論理チャネルに与えられているアクセス優先権が移動できないと判断した場合(たとえば、閉塞する論理シャネルにアクセス優先権が与えられているファイルが別の論理チャネルで選択されていない場合)、上記制御部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
次に、上述した第3の動作例を適用したICカード2における具体例な動作例について説明する。
図11は、上記第3の動作例に従って動作するICカード2が図6に示す一連のコマンドに対して実行する動作を説明するための図である。なお、図6に示すコマンドC7以外の各コマンドに対する動作は、上述した図8に示す第1の動作例の動作を同様であるため、詳細な説明を省略するものとする。
Next, a specific operation example in the
FIG. 11 is a diagram for explaining an operation executed by the
すなわち、ファイル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
上記のような第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
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
上記判断により当該受信コマンドの論理チャネルで上記アクセス優先権が取得可能であると判断した場合(ステップ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
次に、上述した第4の動作例を適用したICカード2における具体例な動作例について説明する。
図13は、上記第4の動作例に従って動作するICカード2が図6に示す一連のコマンドに対して実行する動作を説明するための図である。なお、図6に示すコマンドC8以外の各コマンドに対する動作は、上述した図8に示す第1の動作例の動作を同様であるため、詳細な説明を省略するものとする。
Next, a specific operation example in the
FIG. 13 is a diagram for explaining an operation that the
すなわち、上記コマンドC7に応じて論理チャネル1を閉塞する際に、論理チャネル1にアクセス優先権が与えられていたファイルAのアクセスチャネル番号がクリアされている状態であるものとする。この状態において、論理チャネル2を指定したデータの書込み要求コマンドC8を受信した場合、上記制御部21は、上記ステップ21〜S26の処理として、当該コマンドC8の実行を不可とする。これは、論理チャネル2のカレントファイル(ファイルA)のアクセスチャネル番号が「2」(論理チャネル2)に設定されていないためである。
That is, when the
さらに、第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
上記のような第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
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
上記判断により当該受信コマンドがアクセス対象とするファイルに対して別の論理チャネルでデータが変化する可能性がある処理が実行されていると判断した場合(ステップ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
なお、上記のような処理を実現するため、アクセス優先権が設定されているファイル(あるいはアクセスチャネル番号が設定されていたファイル)については、少なくともデータが変更される可能性があるコマンドを実行した場合、その処理内容を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
次に、上述した第5の動作例を適用したICカード2における具体例な動作例について説明する。
図15は、上記第5の動作例に従って動作するICカード2が図6に示す一連のコマンドに対して実行する動作を説明するための図である。なお、図6に示すコマンドC8以外の各コマンドに対する動作は、上述した図8に示す第1の動作例の動作を同様であるため、詳細な説明を省略するものとする。
Next, a specific operation example in the
FIG. 15 is a diagram for explaining an operation executed by the
すなわち、上記コマンド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
さらに、第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
上記のような第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.
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)
複数のチャネルで外部装置との通信を行う通信手段と、
ファイルの定義情報と前記定義情報で定義されるファイルのデータとを記憶する記憶手段と、
前記ファイルへのアクセスに優先権を有するチャネルを示す情報を前記ファイルの定義情報に設定する設定手段と、
前記通信手段により受信した前記ファイルへのアクセスを要求するコマンドのチャネルが当該ファイルへのアクセスに優先権を有するチャネルである場合、前記コマンドで要求される前記ファイルへの処理を実行する第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カードの制御方法。 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.
複数のチャネルで外部装置との通信を行う通信手段と、ファイルの定義情報と前記定義情報で定義されるファイルのデータとを記憶する記憶手段と、前記ファイルへのアクセスに優先権を有するチャネルを示す情報を前記ファイルの定義情報に設定する設定手段と、前記通信手段により受信した前記ファイルへのアクセスを要求するコマンドのチャネルが当該ファイルへのアクセスに優先権を有するチャネルである場合、前記コマンドで要求される前記ファイルへの処理を実行する第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:
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)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP7224243B2 (en) | 2019-06-10 | 2023-02-17 | 株式会社ディスコ | Flange mechanism |
Families Citing this family (1)
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)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP3691871B2 (en) * | 1995-03-20 | 2005-09-07 | 富士通株式会社 | Card type storage medium |
-
2008
- 2008-03-19 JP JP2008071712A patent/JP5214291B2/en not_active Expired - Fee Related
Cited By (1)
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 |