JP2006092568A - Ic card and file management method for ic card - Google Patents

Ic card and file management method for ic card Download PDF

Info

Publication number
JP2006092568A
JP2006092568A JP2005313276A JP2005313276A JP2006092568A JP 2006092568 A JP2006092568 A JP 2006092568A JP 2005313276 A JP2005313276 A JP 2005313276A JP 2005313276 A JP2005313276 A JP 2005313276A JP 2006092568 A JP2006092568 A JP 2006092568A
Authority
JP
Japan
Prior art keywords
file
key
concept
data
card
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.)
Abandoned
Application number
JP2005313276A
Other languages
Japanese (ja)
Inventor
Yasuo Iijima
康雄 飯島
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 JP2005313276A priority Critical patent/JP2006092568A/en
Publication of JP2006092568A publication Critical patent/JP2006092568A/en
Abandoned legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide an IC card and a file management method for IC card excellent in security, in which the effect of a transport key can be exhibited only when a subordinate person changes a transport key after he/she received the key from a superordinate person. <P>SOLUTION: The file management method for dividing a data memory in the IC card to a plurality of files and managing the plurality of divided files with key collation as a condition of access, respectively, comprises determining whether the key is changed or not, and determining that the key collation does not satisfy the condition of access in a case that no change of the key is determined, and the key collation satisfies the condition of access in a case that a change of the key is determined. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

本発明は、たとえば、不揮発性メモリ、および、これらを制御するCPUなどの制御素子を有するICチップを内蔵したICカード、および、このICカードにおいてメモリ内に分割設定される複数のファイルを管理するICカードにおけるファイル管理方法に関する。   The present invention manages, for example, a non-volatile memory and an IC card including an IC chip having a control element such as a CPU for controlling them, and a plurality of files set and divided in the memory in this IC card. The present invention relates to a file management method in an IC card.

最近、携帯可能なデータ記憶媒体として、不揮発性のデータメモリ、および、これらを制御するCPU(セントラル・プロセッシング・ユニット)などの制御素子を有するICチップを内蔵したICカードが注目されている。   Recently, as portable data storage media, attention has been focused on an IC card incorporating an IC chip having a nonvolatile data memory and a control element such as a CPU (Central Processing Unit) for controlling the nonvolatile data memory.

この種のICカードは、内蔵するデータメモリを複数のファイルに分割し、かつ、個々のファイルには、利用アプリケーションが運用時に必要なデータなどが格納されるようになっており、外部装置からアプリケーション識別名などを入力することにより、選択的に対応ファイルのみが使用可能な状態を実現するようになっている。このため、複数のアプリケーションデータをファイル分けし、1枚のICカードに格納することにより、多目的利用が可能なようになっている。
これらのアプリケーションファイルには、取引データなどのデータ格納のための複数のデータファイルと、キーデータ格納のためのキーファイルが所属できるようになっている。
This type of IC card divides the built-in data memory into a plurality of files, and each file stores data necessary for the operation of the application to be used. By entering an identification name or the like, a state where only the corresponding file can be selectively used is realized. For this reason, a plurality of application data is divided into files and stored in one IC card, thereby enabling multipurpose use.
A plurality of data files for storing data such as transaction data and a key file for storing key data can belong to these application files.

また、最近のICカードでは、各ファイルごとにアクセス条件と称する情報が付加されるようになっており、この情報により指示されているカード内のキーが照合されていることを条件に、コマンドアクセスの可否判定を行なうようになっている。   In recent IC cards, information called access conditions is added to each file, and command access is performed on the condition that the key in the card indicated by this information is collated. Whether or not is possible is determined.

ところで、このようなICカードが製造元からカード利用者にわたる過程において、カードの発行処理/カード内へのシステム基本情報格納など、種々の工程が想定される。このとき、それぞれ工程に関与している当事者も異なる場合が想定される。   By the way, in the process where such an IC card extends from the manufacturer to the card user, various processes such as card issuance processing / system basic information storage in the card are assumed. At this time, it is assumed that the parties involved in each process are also different.

たとえば、前者がカード発行者(上位者)であり、後者がアプリケーション提供者(下位者)である。カード発行者がアプリケーション提供者にカードアクセスの権限を移行する場合、一般的には「トランスポートキー」と称する仮キーをICカードに設定し、アプリケーション提供者がこれを照合することにより、以降,アプリケーション提供者がICカードに対してのアクセスを行なえるようになる。   For example, the former is a card issuer (superior) and the latter is an application provider (subordinate). When the card issuer transfers the card access authority to the application provider, a temporary key generally referred to as a “transport key” is set in the IC card, and the application provider collates the temporary key. The application provider can access the IC card.

このとき、トランスポートキーはカード発行者も既知としているので、アプリケーション提供者が自身のみにしか当該キーを知らないようにするために、一般的には、このトランスポートキーを照合することにより、これを書き換えることを行なう。   At this time, since the card issuer also knows the transport key, in order to make the application provider know only the key only to itself, in general, by verifying this transport key, This is rewritten.

なお、カード所有者により入力されたIPINが、カード製造工程で書込まれたIPINと一致した場合、PINを書込み、IPINを消去する技術は公知である(たとえば、特許文献1参照)。
すなわち、この公知技術は、キー照合が一致すると次のキー(下位者のキー)を書込んだ後に照合一致したキー(上位者のキー)を削除するものである。
特開昭62−44869号公報
In addition, when the IPIN input by the cardholder matches the IPIN written in the card manufacturing process, a technique for writing the PIN and erasing the IPIN is known (see, for example, Patent Document 1).
That is, in this known technique, when the key collation matches, the next key (lower-order key) is written, and then the matched key (higher-order key) is deleted.
JP-A-62-44869

しかし、上記した従来技術の問題点として、ICカード内のデータが改竄された場合などの問題解決に影響するものである。たとえば、ICカード内のアプリケーション利用の有効期限は、一般的にアプリケーション提供者のキーを照合することにより変更されることを考えると、仮に、このデータが改竄された場合には、アプリケーション提供者の責任が問われることになる。   However, as a problem of the above-described prior art, it affects the solution of problems such as when the data in the IC card is falsified. For example, considering that the expiration date for using an application in an IC card is generally changed by checking the key of the application provider, if this data is tampered with, Responsibility will be questioned.

しかしながら、このアプリケーション提供者が前述したトランスポートキーを変更せずして利用していた場合には、カード発行者はアプリケーション提供者と同等の処理をなし得ることになる。すなわち、アプリケーション提供者の不注意に起因するものであるにもかかわらず、カード発行者も同時に疑いがかけられることになる。   However, if the application provider uses the transport key without changing the above-described transport key, the card issuer can perform the same processing as the application provider. In other words, the card issuer is also suspected at the same time even though it is caused by the carelessness of the application provider.

したがって、トランスポートキーを適用する本来の意図にある、「ICカードに対する管理権限の委譲」に反する結果となってしまう。
ただし、トランスポートキーの書換えを義務づけ、かつ、これをICカード内で一義的にチェックすることは、ICカードの利便性のみを要求するアプリケーションには不向きである。
Therefore, the result is contrary to the “delegation of management authority to the IC card” which is the original intention of applying the transport key.
However, obliging to rewrite the transport key and checking it uniquely in the IC card is not suitable for an application that requires only the convenience of the IC card.

また、従来の公知技術では、単にキー照合が一致すると次のキーを書込んだ後に照合一致したキーを削除するものであるから、トランスポートキーを上位者から下位者に渡した後、下位者が当該キーを変更しない限り、その効力が発揮されないようにすることはできない。   Further, in the conventional known technique, when the key collation is matched, the next key is written and then the matched key is deleted. Therefore, after the transport key is passed from the superior to the subordinate, Unless it changes the key, it cannot be disabled.

そこで、本発明は、トランスポートキーを上位者から下位者に渡した後、下位者が当該キーを変更しない限り、その効力が発揮されないようにすることができ、セキュリティ性に優れたICカードおよびICカードにおけるファイル管理方法を提供することを目的とする。   Therefore, the present invention can prevent the effect from being exerted unless the lower party changes the key after passing the transport key from the upper party to the lower party. It is an object to provide a file management method in an IC card.

本発明のICカードは、複数の記憶領域にキーデータおよびデータを記憶するための記憶手段と、初期キーデータを前記記憶手段に記憶された前記キーデータと比較することによって初期キーデータが変更されているかどうかを判定するための判定手段と、この判定手段により前記キーデータが変更されていないと判定されたときに前記複数の記憶領域においてデータが処理されるのを阻止するための阻止手段と、前記判定手段により前記キーデータが変更されていると判定されたときに特定のコマンドに応じて前記複数の記憶領域のデータを処理するための処理手段とを具備し、前記処理手段は、特定のコマンドに応じて前記複数の記憶領域のそれぞれにおいて前記キーデータのファイルを作成するためのファイル作成手段を含み、このファイル作成手段によるファイル作成は前記キーデータが変更される前に前記阻止手段によって阻止されることを特徴とする。   In the IC card of the present invention, the initial key data is changed by comparing storage means for storing key data and data in a plurality of storage areas and the initial key data with the key data stored in the storage means. Determination means for determining whether or not the key data is not changed by the determination means, and blocking means for preventing the data from being processed in the plurality of storage areas. And a processing means for processing the data in the plurality of storage areas in response to a specific command when the determination means determines that the key data has been changed. File creation means for creating a file of the key data in each of the plurality of storage areas in response to a command of File creation by yl creation means characterized in that it is blocked by the blocking means before the key data is changed.

また、本発明のICカードにおけるファイル管理方法は、少なくともメモリを有するICカードにおいて、前記メモリ内の複数のファイルへのアクセスを管理するファイル管理方法であって、前記メモリを使用するシステムの上位概念により前記ファイルの下位にあらかじめ設定されている第1キーを前記メモリを使用するシステムの下位概念により設定されている新しいキーと照合することによって前記ファイルへのアクセスを許可し、前記上位概念は、前記第1キーを前記第1キーの中に設定されたキー変更アクセス条件を参照して前記下位概念だけに知られている第2キーに変更し、かつ、前記第1キーが前記第2キーに変更されると前記上位概念が前記ファイルの下位におけるキーの作成を拒絶することを特徴とする。   The file management method in the IC card of the present invention is a file management method for managing access to a plurality of files in the memory in an IC card having at least a memory, and is a superordinate concept of a system using the memory Allows access to the file by collating a first key preset at the bottom of the file with a new key set by a subordinate concept of the system using the memory, wherein the superordinate concept is The first key is changed to a second key known only to the subordinate concept with reference to a key change access condition set in the first key, and the first key is changed to the second key. If it is changed to, the superordinate concept rejects the creation of a key below the file.

また、本発明のICカードにおけるファイル管理方法は、少なくともメモリを有するICカードにおいて、前記メモリ内の上位概念ファイルおよび下位概念ファイルを含む木構造ファイルへのアクセスを管理するファイル管理方法であって、上位概念管理プログラムによって管理される前記上位概念ファイルにアクセス条件を設定し、前記上位概念管理プログラムから下位概念管理プログラムへ提供されるファイルにアクセス条件を設定し、前記上位概念管理プログラムから前記下位概念管理プログラムへ移送される移送キーを前記下位概念ファイルのアクセス条件を参照して前記下位概念ファイルに設定し、前記上位概念ファイルの前記アクセス条件が満たされたときに前記下位概念ファイルに前記移送キーを設定し、前記下位概念ファイルのアクセス条件を参照するとともに、このアクセス条件が満たされたときに前記下位概念ファイルの下位にファイルを設定することを特徴とする。   The file management method in the IC card of the present invention is a file management method for managing access to a tree structure file including a higher-level concept file and a lower-level concept file in the memory in an IC card having at least a memory, An access condition is set for the upper concept file managed by the upper concept management program, an access condition is set for a file provided from the upper concept management program to the lower concept management program, and the lower concept is transferred from the higher concept management program. A transfer key to be transferred to the management program is set in the lower concept file with reference to the access condition of the lower concept file, and the transfer key is added to the lower concept file when the access condition of the upper concept file is satisfied. Set the subordinate concept file With reference to the access condition, and sets the file to the lower of the subgeneric file when the access condition is met.

さらに、本発明のICカードは、少なくともメモリを有し、このメモリ内に上位概念ファイルおよび下位概念ファイルを有する木構造ファイルを含むICカードにおいて、アクセス条件が設定されているとともに上位概念管理プログラムによって使用される上位概念ファイルと、アクセス条件が設定されているとともに前記上位概念管理プログラムによって提供されかつ下位概念管理プログラムによって使用される下位概念ファイルと、前記上位概念ファイルの前記アクセス条件が満たされたときに前記上位概念ファイルの前記アクセス条件を参照するとともに、前記下位概念ファイルに前記上位概念管理プログラムから前記下位概念管理プログラムへ移送される移送キーを設定するための第1手段と、前記下位概念ファイルの前記アクセス条件が満たされたときに前記下位概念ファイルの前記アクセス条件を参照するとともに、前記下位概念ファイルの下位にファイルを設定するための第2手段とを具備している。   Further, the IC card of the present invention has at least a memory, and in the IC card including the tree structure file having the upper concept file and the lower concept file in the memory, the access condition is set and the upper concept management program The superordinate concept file to be used, the access condition is set, the subordinate concept file provided by the superordinate concept management program and used by the subordinate concept management program, and the access condition of the superordinate concept file is satisfied A first means for sometimes referring to the access condition of the higher level concept file and setting a transfer key to be transferred from the higher level concept management program to the lower level concept management program in the lower level concept file; Access the file With reference to the access condition of the subgeneric file when matter is satisfied, and a second means for setting the file to the lower of the lower concept file.

本発明によれば、トランスポートキーを上位者から下位者に渡した後、下位者が当該キーを変更しない限り、その効力が発揮されないようにすることができ、セキュリティ性に優れたICカードおよびICカードにおけるファイル管理方法を提供できる。   According to the present invention, after the transport key is transferred from the superior to the inferior, it is possible to prevent the effect from being exhibited unless the inferior changes the key. A file management method in an IC card can be provided.

以下、本発明の実施の形態について図面を参照して説明する。
図1は、本実施の形態に係る携帯可能電子装置としてのICカードが適用される、たとえば、金融システムあるいはショッピングシステムなどの端末装置として用いられるカード取扱装置の構成例を示すものである。すなわち、この装置は、ICカード1をカードリーダ・ライタ2を介してCPUなどからなる制御部3と接続可能とするとともに、制御部3にキーボード4、CRTディスプレイ装置5、プリンタ6、および、フロッピー(登録商標)ディスク装置7を接続して構成される。
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
FIG. 1 shows a configuration example of a card handling device used as a terminal device such as a financial system or a shopping system, to which an IC card as a portable electronic device according to the present embodiment is applied. That is, this apparatus enables the IC card 1 to be connected to a control unit 3 comprising a CPU or the like via a card reader / writer 2, and the control unit 3 includes a keyboard 4, a CRT display device 5, a printer 6, and a floppy disk. A (registered trademark) disk device 7 is connected.

図2は、ICカード1の構成例を示すものであり、制御部としての制御素子(たとえば、CPU)11、記憶内容が消去可能な不揮発性のデータメモリ12、ワーキングメモリ13、プログラムメモリ14、および、カードリーダ・ライタ2との電気的接触を得るためのコンタクト部15によって構成されている。これらのうち、破線内の部分(制御素子11、データメモリ12、ワーキングメモリ13、プログラムメモリ14)は1つ(あるいは複数)のICチップで構成されてICカード本体内に埋設されている。   FIG. 2 shows a configuration example of the IC card 1, and includes a control element (for example, CPU) 11 as a control unit, a non-volatile data memory 12 in which stored contents can be erased, a working memory 13, a program memory 14, The contact portion 15 is used to obtain electrical contact with the card reader / writer 2. Among these, the part (the control element 11, the data memory 12, the working memory 13, and the program memory 14) within the broken line is composed of one (or a plurality) of IC chips and is embedded in the IC card body.

データメモリ12は、各種データの記憶に使用され、たとえば、EEPROMなどで構成されている。ワーキングメモリ13は、制御素子11が処理を行なう際の処理データを一時的に保持するためのメモリであり、たとえば、RAMなどで構成される。プログラムメモリ14は、たとえば、マスクROMで構成されており、制御素子11のプログラムなどを記憶するものである。   The data memory 12 is used for storing various data, and is composed of, for example, an EEPROM. The working memory 13 is a memory for temporarily storing processing data when the control element 11 performs processing, and is configured by a RAM or the like, for example. The program memory 14 is constituted by a mask ROM, for example, and stores a program of the control element 11 and the like.

データメモリ12は、たとえば、図3に示すように、制御領域120、ディレクトリ121、空き領域122、および、エリア群123に分割されている。エリア群123は、複数のデータエリアおよびキーエリアを有することができ、かつ、データファイル(DF)と呼ばれる概念でグループ化することができる。なお、後述するマスタファイル(MF)は、データファイルの1つの形態として一括管理される。   For example, as shown in FIG. 3, the data memory 12 is divided into a control area 120, a directory 121, a free area 122, and an area group 123. The area group 123 can have a plurality of data areas and key areas, and can be grouped by a concept called a data file (DF). Note that a master file (MF), which will be described later, is collectively managed as one form of data file.

データファイルは、対応するアプリケーションにて使用されるデータエリア、および、キーエリアを一括して管理するためのファイルである。
データエリアは、たとえば、取引データなどのように、必要に応じて読み書きするためのデータを格納するエリアである。
キーエリアは、たとえば、暗証番号などの格納に利用されているエリアであり、書込み/書換え/照合の対象になり、読出しはできないようになっている。
The data file is a file for collectively managing data areas and key areas used in the corresponding application.
The data area is an area for storing data for reading and writing as necessary, such as transaction data.
The key area is, for example, an area used for storing a personal identification number, and is a target of writing / rewriting / collation, and cannot be read out.

なお、これらのエリアは、図3に示すように、エリア群123として一括して割当てられている。また、これらのファイルあるいはエリアは、データメモリ12内のディレクトリ121を用いることにより、それぞれの物理的位置などを制御素子11が認識するようになっている。   These areas are collectively assigned as an area group 123 as shown in FIG. These files or areas use the directory 121 in the data memory 12 so that the control element 11 recognizes their physical positions and the like.

さらに、図3の制御領域120には、エリア群123の先頭アドレス情報、および、空き領域122の先頭アドレス情報が格納されている。
図3のディレクトリ121は、図4に示すように、各データファイルおよびエリアに対応する各種定義情報が格納される。
Further, the control area 120 in FIG. 3 stores the top address information of the area group 123 and the top address information of the empty area 122.
As shown in FIG. 4, the directory 121 in FIG. 3 stores various definition information corresponding to each data file and area.

図4(a)は、データファイルの名称を定義する情報である。この定義情報は、ディレクトリ121内でデータファイル名定義情報を識別するためのデータPTN、本データファイルに割当てられたファイル通し番号DFSN、本データファイルの親ファイルの通し番号PFSN、本データファイルに付与されたファイル名DFnameおよびその長さを示すデータNL、および、これらのデータの正当性をチェックするためのデータBCCから構成される。   FIG. 4A shows information defining the name of the data file. The definition information is given to the data PTN for identifying the data file name definition information in the directory 121, the file serial number DFSN assigned to the data file, the serial number PFSN of the parent file of the data file, and the data file. The file name DFname and data NL indicating its length, and data BCC for checking the validity of these data are configured.

図4(b)は、データファイルの管理情報を定義する情報である。この定義情報は、ディレクトリ121内でデータファイル名定義情報を識別するためのデータPTN、本データファイルに割当てられたファイル通し番号DFSN、本データファイルの親ファイルの通し番号PFSN、データファイルサイズDFS、本データファイルの付加情報が格納されるデータエリアを識別するためのAAID、当該付加情報を出力するか否かなどを規定するTYPE、キーの種別を禁止するUCF、データファイルのアクセス条件を示すDFAC、本データファイルの状態を保持するためのDFST、本データファイルの配下に位置するデータファイルおよびエリアにより使用されているバイト数US、および、これらのデータの正当性をチェックするためのデータBCCから構成される。
また、特にAAIDは、後述するデータファイル選択コマンドにてデータファイルが選択された際に、必要に応じてそれに示されるデータエリアの内容を出力する。
FIG. 4B is information defining management information of the data file. This definition information includes data PTN for identifying data file name definition information in the directory 121, a file serial number DFSN assigned to this data file, a serial number PFSN of the parent file of this data file, a data file size DFS, this data AAID for identifying the data area in which the additional information of the file is stored, TYPE for specifying whether or not to output the additional information, UCF for prohibiting the key type, DFAC indicating the access condition of the data file, this It consists of DFST for holding the status of the data file, the data file located under the data file and the number of bytes US used by the area, and the data BCC for checking the validity of these data. The
In particular, the AAID outputs the contents of the data area shown in the AAID when necessary when a data file is selected by a data file selection command to be described later.

図4(c)は、各種取引データなどを格納するエリアを定義する情報である。この定義情報は、ディレクトリ121内でエリア定義情報を識別するためのデータPTN、本エリアが属するデータファイルの通し番号DFSN、エリアに対してアクセスする際の識別番号AID、エリアの先頭アドレスを示すATOP、エリアサイズを示すASIZ、エリアのアクセス条件を示すAAC、エリアの状態を保持するAST、および、これらのデータの正当性をチェックするためのデータBCCから構成される。   FIG. 4C is information defining an area for storing various transaction data. This definition information includes data PTN for identifying the area definition information in the directory 121, a serial number DFSN of the data file to which the area belongs, an identification number AID for accessing the area, ATOP indicating the start address of the area, It consists of ASIZ indicating the area size, AAC indicating the access conditions of the area, AST holding the area status, and data BCC for checking the validity of these data.

図4(d)は、各種キーデータを格納するエリアを定義する情報である。この定義情報は、ディレクトリ121内でキーエリア定義情報を識別するためのデータPTN、本エリアが属するデータファイルの通し番号DFSN、エリアに対してアクセスする際の識別番号KID、エリアの先頭アドレスを示すKTOP、エリアサイズを示すKSIZ、キーの種別を示すCF、キーのアクセス条件を示すKAC、キーの状態を保持するKST、および、これらのデータの正当性をチェックするためのデータBCCから構成される。   FIG. 4D shows information that defines areas for storing various key data. This definition information includes data PTN for identifying key area definition information in the directory 121, serial number DFSN of the data file to which this area belongs, identification number KID for accessing the area, and KTOP indicating the start address of the area. , KSIZ indicating area size, CF indicating key type, KAC indicating key access condition, KST holding key status, and data BCC for checking the validity of these data.

これらに使用されている識別情報PTNは、たとえば、1バイトで構成されており、データファイルの名称を定義するもの(図4(a))に対しては‘00’が、データファイルの管理情報を定義するもの(図4(b))に対しては‘01’が、データエリアを定義するもの(図中(c))に対しては‘02’が、また、キーエリアを定義するもの(図4(d))に対しては‘03’が、それぞれ使用される。   The identification information PTN used for these is composed of, for example, 1 byte, and for the data file name definition (FIG. 4A), “00” is data file management information. "01" for those that define the data (Fig. 4 (b)), "02" for those that define the data area ((c) in the figure), and those that define the key area “03” is used for (FIG. 4D).

図5は、ファイルの構造例を示している。この図において、DFnnはデータファイルを、Dnnはデータエリアを、Knnはキーエリアを、それぞれ示している。
図示するように、ICカード1内のメモリ12において、マスタファイル(MF)の配下には、データファイルDF1,DF2が、また、キーエリアK00,K01、データエリアD00,D01が、それぞれ設定されている。
FIG. 5 shows an example of a file structure. In this figure, DFnn indicates a data file, Dnn indicates a data area, and Knn indicates a key area.
As shown in the figure, in the memory 12 in the IC card 1, data files DF1 and DF2 and key areas K00 and K01 and data areas D00 and D01 are set under the master file (MF). Yes.

また、データファイルDF1の配下には、データファイルDF1−1,DF1−2が、また、キーエリアK11,K12、データエリアD11,D12が、それぞれ設定されている。   Further, data files DF1-1 and DF1-2, key areas K11 and K12, and data areas D11 and D12 are set under the data file DF1, respectively.

また、データファイルDF1−1の配下には、キーエリアK111,K112、データエリアD111/D112が、また、データファイルDF1−2の配下には、キーエリアK121,K122、データエリアD121,D122が、それぞれ設定されている。   Further, under the data file DF1-1, there are key areas K111 and K112 and data areas D111 / D112, and under the data file DF1-2, there are key areas K121 and K122 and data areas D121 and D122. Each is set.

一方、データファイルDF2の配下には、データファイルDF2−1,DF2−2が、また、キーエリアK21,K22、データエリアD21,D22が、それぞれ設定されている。   On the other hand, data files DF2-1 and DF2-2, key areas K21 and K22, and data areas D21 and D22 are set under the data file DF2.

また、データファイルDF2−1の配下には、キーエリアK211,K212、データエリアD211,D212が、また、データファイルDF2−2の配下には、キーエリアK221,K222、データエリアD221,D222が、それぞれ設定されている。   Further, under the data file DF2-1, key areas K211 and K212, data areas D211 and D212, and under the data file DF2-2, key areas K221 and K222, and data areas D221 and D222, Each is set.

これらの各種定義情報は、一括して図6に示すように、ディレクトリ121に格納される。図示するように、各定義情報には、DFSN(ファイル通し番号)が、ファイル創成時に自動的に付与される。このDFSN、および、データファイル定義情報に格納される親ファイルのシーケンス番号により、各ファイルの関連状態を制御素子11が認識する。   These various types of definition information are collectively stored in the directory 121 as shown in FIG. As shown in the figure, DFSN (file serial number) is automatically given to each definition information at the time of file creation. Based on the DFSN and the sequence number of the parent file stored in the data file definition information, the control element 11 recognizes the related state of each file.

たとえば、データファイルDF1−1の定義情報(通し番号#13)は、DFSNが‘03’、また、PFSNが‘01’となっている。すなわち、本データファイルは、ファイルシーケンス番号‘03’が創成時に付与され、同時に本データファイルがDF1の配下に創成されることを認識し、データファイルDF1のDFSN(‘01’)をPFSNとして付与する。   For example, in the definition information (serial number # 13) of the data file DF1-1, DFSN is “03” and PFSN is “01”. That is, this data file is given file sequence number '03' at the time of creation, and at the same time, recognizes that this data file is created under DF1, and assigns DFSN ('01') of data file DF1 as PFSN. To do.

図7は、データファイル(DF)創成のための動作を説明するフローチヤートを示しており、以下それについて説明する。ICカード1が、外部から入力されるデータファイル創成コマンドを受信すると、まず、使用可能状態、すなわち、カレント状態となっているデータファイル(以後、カレントDFと称す)を認識する(ST1)。特に、ICカード1への電気的活性化の直後は、カレントDFはマスタファイル(MF)となる。   FIG. 7 shows a flow chart for explaining the operation for creating a data file (DF), which will be described below. When the IC card 1 receives a data file creation command input from the outside, it first recognizes a usable data file, that is, a data file in a current state (hereinafter referred to as a current DF) (ST1). In particular, immediately after the electrical activation to the IC card 1, the current DF becomes a master file (MF).

カレントDFを認識すると、次に、カレントDF定義情報中のアクセス条件情報のうち、ファイル創成に関する情報を参照する。この条件と、後述するRAM上の照合状態保持領域Aのみを比較し、アクセス条件が要求しているキーの照合状態が確立されているか否かを判断する(ST2)。   When the current DF is recognized, next, information on file creation is referred to in the access condition information in the current DF definition information. This condition is compared only with the collation state holding area A on the RAM, which will be described later, and it is determined whether or not the collation state of the key requested by the access condition is established (ST2).

もし確立されていなければ、アクセス条件不一致を意味するレスポンス電文を出力し、コマンド待ち状態に戻る(ST3)。また、もし確立されていれば、次に、コマンド内に設定されているデータファイルのファイル名(DF−ID)を抽出し、カレントDFが有するFSNと同一の値を親FSNとして有しており、さらに、抽出したファイル名と同一のファイル名を有しているデータファイル定義情報が存在するか否かを確認する(ST4)。   If it has not been established, a response message indicating that the access conditions do not match is output, and the process returns to the command waiting state (ST3). If it is established, the file name (DF-ID) of the data file set in the command is extracted, and the parent FSN has the same value as the FSN of the current DF. Further, it is confirmed whether or not there is data file definition information having the same file name as the extracted file name (ST4).

もし存在するとしたら、ID重複異常を意味するレスポンス電文を出力し、コマンド待ち状態に戻る(ST5)。また、もし存在しないとしたら、コマンドにて与えられたデータファイル創成のためのデータにより、図4(a)〜(c)に示すデータファイル定義情報を生成し(ST6)、これを所定領域に書込む(ST7)。   If it exists, a response message indicating an ID duplication abnormality is output, and the process returns to the command wait state (ST5). If the data file does not exist, the data file definition information shown in FIGS. 4A to 4C is generated from the data file creation data given by the command (ST6), and this is set in a predetermined area. Write (ST7).

この書込みにおいて、書込みが正常に終了しなかった場合(ST8)、データ書込み異常を意味するレスポンス電文を出力し、コマンド待ち状態に戻る(ST9)。また、書込みが正常に終了した場合(ST8)、正常終了を意味するレスポンス電文を出力し、コマンド待ち状態に戻る(ST10)。   In this writing, when the writing is not normally completed (ST8), a response message indicating a data writing abnormality is output, and the process returns to the command waiting state (ST9). If the writing is normally completed (ST8), a response message indicating normal termination is output, and the process returns to the command waiting state (ST10).

図8は、キーエレメンタリファイル(EF)創成のための動作を説明するフローチヤートを示しており、以下それについて説明する。ICカード1が、外部から入力されるキーEF創成コマンドを受信すると、まず、カレントDFを認識する(ST11)。   FIG. 8 shows a flowchart explaining the operation for creating a key elementary file (EF), which will be described below. When the IC card 1 receives a key EF creation command input from the outside, first, the current DF is recognized (ST11).

カレントDFを認識すると、次に、カレントDF定義情報中のアクセス条件情報のうち、ファイル創成に関する情報を参照する。この条件と、後述するRAM上の照合状態保持領域Aのみを比較し、アクセス条件が要求しているキーの照合状態が確立されているか否かを判断する(ST12)。   When the current DF is recognized, next, information on file creation is referred to in the access condition information in the current DF definition information. This condition is compared only with the collation state holding area A on the RAM, which will be described later, and it is determined whether or not the collation state of the key requested by the access condition is established (ST12).

もし確立されていなければ、アクセス条件不一致を意味するレスポンス電文を出力し、コマンド待ち状態に戻る(ST13)。また、もし確立されていれば、次に、コマンド電文にて指示されているエレメンタリファイル名(EF−ID)を参照し、アクセス対象となっているカレントDF内に、当該エレメンタリファイル名が存在するか否かをチェックする(ST14)。もし存在する場合には、ID重複異常を示すレスポンス電文を出力し、コマンド待ち状態に戻る(ST15)。   If it has not been established, a response message indicating that the access conditions do not match is output, and the process returns to the command waiting state (ST13). If it is established, next, the elementary file name (EF-ID) specified in the command message is referred to, and the corresponding elementary file name is stored in the current DF to be accessed. It is checked whether or not it exists (ST14). If it exists, a response message indicating an ID duplication abnormality is output, and the process returns to the command wait state (ST15).

もし存在しなければ、次に、コマンド電文にて指定されているキーEFのサイズデータを参照し、アクセス対象となっているカレントDF内の空き領域サイズと比較する(ST16)。この比較においては、指定されたキーEFのサイズに当該キーEFを創成した際に使用するディレクトリ情報のサイズを加算したものに対して、前記空き領域サイズがそれ以上であるか否かをチェックする。もし前者が後者よりも大きい場合には、指定サイズ異常を示すレスポンス電文を出力し、コマンド待ち状態に戻る(ST17)。   If it does not exist, next, the size data of the key EF specified in the command message is referred to and compared with the free area size in the current DF to be accessed (ST16). In this comparison, it is checked whether or not the free area size is larger than the size of the specified key EF plus the size of the directory information used when the key EF is created. . If the former is larger than the latter, a response message indicating a specified size error is output and the process returns to the command wait state (ST17).

もしそうでなければ、次に、コマンド電文にて指定されたキーのタイプと、サイズの正当性をチェックする(ST18)。このとき、キーのタイプが「認証関連キー」となっていればサイズが例えば10バイト、また、キーのタイプが「照合キー」となっていればサイズは例えば3〜18バイトであるとき、サイズが正当であると判断する。もし正当でないと判断された場合には、指定サイズ整合異常を示すレスポンス電文を出力し、コマンド待ち状態に戻る(ST19)。   If not, next, the type of key specified by the command message and the validity of the size are checked (ST18). At this time, if the key type is “authentication related key”, the size is, for example, 10 bytes, and if the key type is “collation key”, the size is, for example, 3 to 18 bytes. Is determined to be valid. If it is determined that it is not valid, a response message indicating a specified size matching error is output and the process returns to the command wait state (ST19).

ここで、サイズが正当であったと判断された場合には、受信したコマンドに基づき、ディレクトリに格納すべきキーEF定義情報を生成し(ST20)、これを所定領域に書込む(ST21)。このとき、ステータス情報の第8ビット目は、コマンド電文にて指定されたキータイプ情報のうちの第1ビット目に依存して、その値が決定される。すなわち、後者のビット値と同様の値を前者のビットに設定する。   If it is determined that the size is valid, key EF definition information to be stored in the directory is generated based on the received command (ST20), and this is written in a predetermined area (ST21). At this time, the value of the eighth bit of the status information is determined depending on the first bit of the key type information specified in the command message. That is, a value similar to the latter bit value is set in the former bit.

このステータス情報の第8ビット目は、キーデータの変更がなされたか否かを示すビットであり、当該ビットが「1」の場合、変更行為がなされていないことを示し、また、「0」であればその行為がなされたことを示している。   The eighth bit of the status information is a bit indicating whether or not the key data has been changed. When the bit is “1”, it indicates that no change has been made, and “0”. If there is, it indicates that the action was done.

したがって、上記キータイプ情報の第1ビット目が「1」の場合には、キー変更を行なわない限りステータス情報の第8ビット目が「0」とはならず、また、「0」の場合には、キー変更を行なうか否かに関わらず、ステータス情報の第8ビット目が「0」となっている(つまり、書換え行為が暗黙的に行なわれたことと等価になる)。   Therefore, when the first bit of the key type information is “1”, the eighth bit of the status information is not “0” unless the key is changed, and when the first bit is “0”. Regardless of whether or not the key is changed, the eighth bit of the status information is “0” (that is, it is equivalent to an implicit rewrite action).

上記キーEF定義情報の書込みにおいて、書込みが正常に終了しなかった場合(ST22)、データ書込み異常を意味するレスポンス電文を出力し、コマンド待ち状態に戻る(ST23)。また、書込みが正常に終了した場合(ST22)、正常終了を意味するレスポンス電文を出力し、コマンド待ち状態に戻る(ST24)。   When writing the key EF definition information does not end normally (ST22), a response message indicating a data write error is output and the process returns to the command wait state (ST23). If the writing has been completed normally (ST22), a response message indicating normal termination is output and the process returns to the command waiting state (ST24).

図9は、キーデータ設定のための動作を説明するフローチヤートを示しており、以下それについて説明する。ICカード1が、外部から入力されるキーデータ設定コマンドを受信すると、まず、カレントDFを認識する(ST31)。   FIG. 9 shows a flow chart for explaining the operation for key data setting, which will be described below. When the IC card 1 receives a key data setting command input from the outside, first, the current DF is recognized (ST31).

カレントDFを認識すると、次に、コマンド電文にて指示されているエレメンタリファイル名(EF−ID)を参照し、アクセス対象となっているカレントDF内に、当該エレメンタリファイル名が存在するか否かをチェックする(ST32)。もし存在しない場合には、該当キーID無しを意味するレスポンス電文を出力し、コマンド待ち状態に戻る(ST33)。   When the current DF is recognized, next, the elementary file name (EF-ID) specified in the command message is referred to, and whether the elementary file name exists in the current DF to be accessed. It is checked whether or not (ST32). If it does not exist, a response message signifying that there is no corresponding key ID is output, and the process returns to the command waiting state (ST33).

もし存在すれば、次に当該キーEF定義情報中のアクセス条件情報のうち、キーデータ設定に関する情報を参照する。この条件と、後述するRAM上の照合状態保持領域Aのみを比較し、アクセス条件が要求しているキーの照合状態が確立されているか否かを判断する(ST34)。   If it exists, next, information on key data setting is referred to among the access condition information in the key EF definition information. This condition is compared only with the collation state holding area A on the RAM, which will be described later, and it is determined whether or not the collation state of the key requested by the access condition is established (ST34).

もし確立されていなければ、アクセス条件不一致を意味するレスポンス電文を出力し、コマンド待ち状態に戻る(ST35)。また、もし確立されていれば、次に、対応するキーEF領域内にキーデータが存在するか否かを確認する(ST36)。もし存在すれば、既存キーデータ有りを意味するレスポンスデータを出力し、コマンド待ち状態に戻る(ST37)。   If it has not been established, a response message indicating that the access conditions do not match is output, and the process returns to the command wait state (ST35). If it is established, next, it is confirmed whether or not key data exists in the corresponding key EF area (ST36). If it exists, response data indicating the presence of existing key data is output, and the process returns to the command wait state (ST37).

もし存在しなければ、コマンド電文にて指定されたキーのタイプと、入力キーデータのサイズの正当性をチェックする(ST38)。このとき、キーのタイプが「認証関連キー」となっていればサイズが例えば8バイト、また、キーのタイプが「照合キー」となっていればサイズは例えば1〜16バイトであるとき、サイズが正当であると判断する。もし正当でないと判断された場合には、入力キーデータサイズ異常を示すレスポンス電文を出力し、コマンド待ち状態に戻る(ST39)。   If it does not exist, the validity of the key type specified in the command message and the size of the input key data is checked (ST38). At this time, if the key type is “authentication related key”, the size is, for example, 8 bytes, and if the key type is “verification key”, the size is, for example, 1 to 16 bytes. Is determined to be valid. If it is determined not to be valid, a response message indicating an abnormal input key data size is output, and the process returns to the command wait state (ST39).

ここで、サイズが正当であったと判断された場合には、次に、当該キーEF定義情報中にて定義されているサイズと、入力されたキーデータのサイズとの比較を行なう(ST40)。後者のサイズに例えば「2」を加えたものが、前者のサイズよりも大きい場合には、領域サイズ不足を意味するレスポンス電文を出力し、コマンド待ち状態に戻る(ST41)。   If it is determined that the size is valid, the size defined in the key EF definition information is compared with the size of the input key data (ST40). If the latter size plus “2”, for example, is larger than the former size, a response message indicating insufficient area size is output, and the process returns to the command waiting state (ST41).

そうでなければ、受信したコマンドにて入力されたキーデータに、1バイトの長さの情報および1バイトのBCCを付加して、これを当該キーEF領域に格納し(ST42)、処理結果をレスポンス電文にて出力し、コマンド待ち状態に戻る(ST43)。   Otherwise, 1-byte length information and 1-byte BCC are added to the key data input by the received command, and this is stored in the key EF area (ST42). The response message is output to return to the command wait state (ST43).

図10は、キーデータ変更のための動作を説明するフローチヤートを示しており、以下それについて説明する。ICカード1が、外部から入力されるキーデータ変更コマンドを受信すると、まず、カレントDFを認識する(ST51)。   FIG. 10 shows a flow chart for explaining the operation for changing the key data, which will be described below. When the IC card 1 receives a key data change command input from the outside, first, the current DF is recognized (ST51).

カレントDFを認識すると、次に、コマンド電文にて指示されているエレメンタリファイル名(EF−ID)を参照し、アクセス対象となっているカレントDF内に、当該エレメンタリファイル名が存在するか否かをチェックする(ST52)。もし存在しない場合には、該当キーID無しを意味するレスポンス電文を出力し、コマンド待ち状態に戻る(ST53)。   When the current DF is recognized, next, the elementary file name (EF-ID) specified in the command message is referred to, and whether the elementary file name exists in the current DF to be accessed. It is checked whether or not (ST52). If it does not exist, a response message signifying that there is no corresponding key ID is output, and the process returns to the command waiting state (ST53).

もし存在すれば、次に当該キーEF定義情報中のアクセス条件情報のうち、キーデータ変更に関する情報を参照する。この条件と、後述するRAM上の照合状態保持領域AおよびBを比較し、アクセス条件が要求しているキーの照合状態が確立されているか否かを判断する(ST54)。   If it exists, next, information on the key data change is referred to in the access condition information in the key EF definition information. This condition is compared with collation state holding areas A and B on the RAM, which will be described later, and it is determined whether or not the collation state of the key requested by the access condition is established (ST54).

もし確立されていなければ、アクセス条件不一致を意味するレスポンス電文を出力し、コマンド待ち状態に戻る(ST55)。また、もし確立されていれば、次に、対応するキーEF領域内にキーデータが存在するか否かを確認する(ST56)。もし存在しなければ、既存キーデータ無しを意味するレスポンスデータを出力し、コマンド待ち状態に戻る(ST57)。   If it has not been established, a response message indicating that the access conditions do not match is output, and the process returns to the command wait state (ST55). If it is established, next, it is confirmed whether or not key data exists in the corresponding key EF area (ST56). If not, response data indicating no existing key data is output, and the process returns to the command wait state (ST57).

もし存在すれば、コマンド電文にて指定されたキーのタイプと、入力キーデータのサイズの正当性をチェックする(ST58)。このとき、キーのタイプが「認証関連キー」となっていればサイズが例えば8バイト、また、キーのタイプが「照合キー」となっていればサイズは例えば1〜16バイトであるとき、サイズが正当であると判断する。もし正当でないと判断された場合には、入力キーデータサイズ異常を示すレスポンス電文を出力し、コマンド待ち状態に戻る(ST59)。   If it exists, the validity of the key type specified in the command message and the size of the input key data is checked (ST58). At this time, if the key type is “authentication related key”, the size is, for example, 8 bytes, and if the key type is “verification key”, the size is, for example, 1 to 16 bytes. Is determined to be valid. If it is determined not to be valid, a response message indicating an abnormal input key data size is output, and the process returns to the command wait state (ST59).

ここで、サイズが正当であったと判断された場合には、次に、当該キーEF定義情報中にて定義されているサイズと、入力されたキーデータのサイズとの比較を行なう(ST60)。後者のサイズに例えば「2」を加えたものが、前者のサイズよりも大きい場合には、領域サイズ不足を意味するレスポンス電文を出力し、コマンド待ち状態に戻る(ST61)。   If it is determined that the size is valid, the size defined in the key EF definition information is compared with the size of the input key data (ST60). If the latter size plus “2”, for example, is larger than the former size, a response message indicating insufficient area size is output and the process returns to the command waiting state (ST61).

そうでなければ、受信したコマンドにて入力されたキーデータに、1バイトの長さの情報および1バイトのBCCを付加して、これを当該キーEF領域に格納し(ST62)、その処理結果をレスポンス電文にて出力し、コマンド待ち状態に戻る(ST63)。また、このとき、キーEF定義情報にあるステータス情報の第8ビット目を「0」とする。   Otherwise, 1-byte length information and 1-byte BCC are added to the key data input by the received command, and this is stored in the key EF area (ST62). Is output as a response message, and the process returns to the command wait state (ST63). At this time, the eighth bit of the status information in the key EF definition information is set to “0”.

図11は、キー照合のための動作を説明するフローチヤートを示しており、以下それについて説明する。ICカード1が、外部から入力されるキー照合コマンドを受信すると、まず、カレントDFを認識する(ST71)。   FIG. 11 shows a flow chart for explaining the operation for key collation, which will be described below. When the IC card 1 receives a key collation command input from the outside, it first recognizes the current DF (ST71).

カレントDFを認識すると、次に、ディレクトリ121を検索することにより、カレントDF内に指定されたファイル名(ID)を有するキーEF定義情報が存在するか否かを確認する(ST72)。もし存在しない場合には、該当キーID無しを示すレスポンス電文を出力し、コマンド待ち状態に戻る(ST73)。   If the current DF is recognized, next, the directory 121 is searched to confirm whether or not the key EF definition information having the specified file name (ID) exists in the current DF (ST72). If it does not exist, a response message indicating no corresponding key ID is output, and the process returns to the command waiting state (ST73).

もし存在していた場合には、当該キーがロック状態になっているか否かを確認する(ST74)。このとき、ロック状態であると判断した場合には、キーロックを示すレスポンス電文を出力し、コマンド待ち状態に戻る(ST75)。   If it exists, it is confirmed whether or not the key is locked (ST74). At this time, if it is determined that it is in the locked state, a response message indicating key lock is output, and the process returns to the command waiting state (ST75).

もしそうでなければ、コマンド電文内のキーデータと、当該キーEF内に格納されているキーデータとを照合する(ST76)。このとき、両者が一致している場合には(ST77)、当該キーEF定義情報中の照合ビット指定情報を参照し、所定のRAM領域の当該情報にて指定されているビット位置を「1」にする(ST78)。次に、当該キーEF定義情報中のキー固有の照合不一致カウンタをクリアし(ST79)、正常終了を示すレスポンス電文を出力して、コマンド待ち状態に戻る(ST80)。   If not, the key data in the command message is collated with the key data stored in the key EF (ST76). At this time, if they match (ST77), the collation bit designation information in the key EF definition information is referred to and the bit position designated by the information in the predetermined RAM area is “1”. (ST78). Next, the key-specific verification mismatch counter in the key EF definition information is cleared (ST79), a response message indicating normal termination is output, and the process returns to the command wait state (ST80).

なお、所定のRAM領域は、照合状態保持領域AおよびBに分割されている。どちらの領域の対応ビットを「1」にするかは、当該キーEF定義情報中のキーのステータス情報の第8ビット目の値に依存する。このビットは、当該キーEF定義情報により定義づけられているキーに対し、変更処理が行なわれたか否かを示すものであり、後述するように、「0」となっていれば変更されたキーであり、「1」となっていれば変更処理が行なわれていないキーであることを示す。さらに、これが「0」となっていた場合には、前記照合状態保持領域Aの、また、「1」となっていれば、前記照合状態保持領域Bの、対応ビットを設定することになる。   The predetermined RAM area is divided into collation state holding areas A and B. Which area the corresponding bit is set to “1” depends on the value of the eighth bit of the status information of the key in the key EF definition information. This bit indicates whether or not a change process has been performed on the key defined by the key EF definition information. As will be described later, the changed key is set to “0”. If it is “1”, it indicates that the key has not been changed. Further, when this is “0”, the corresponding bit of the collation state holding area A is set, and when it is “1”, the corresponding bit of the collation state holding area B is set.

また、キー照合処理において、不一致であると判断した場合には(ST77)、まず、当該キーEF定義情報中の照合ビット指定情報、および、ステータス情報を参照し、上記と同様の手順にしたがって、照合状態保持領域AまたはBのいずれかの領域の所定ビットを「0」にする(ST81)。   If it is determined that there is a mismatch in the key verification process (ST77), first, the verification bit designation information and the status information in the key EF definition information are referred to, and the same procedure as described above is performed. Predetermined bits in either the verification state holding area A or B are set to “0” (ST81).

次に、キー固有の照合不一致カウンタを1つだけインクリメントする(ST82)。このとき、キーEF定義情報中のカウント最大値に達していない場合には(ST83)、照合不一致を示すレスポンス電文を出力し、コマンド待ち状態に戻る(ST84)。また、最大値に達していたならば、キーロック済みを示すレスポンス電文を出力し、コマンド待ち状態に戻る(ST85)。   Next, the key-specific verification mismatch counter is incremented by one (ST82). At this time, if the count maximum value in the key EF definition information has not been reached (ST83), a response message indicating a mismatch of collation is output, and the process returns to the command wait state (ST84). If the maximum value has been reached, a response message indicating that the key has been locked is output, and the process returns to the command wait state (ST85).

図12は、データEFへのアクセスのための動作を説明するフローチヤートを示しており、以下それについて説明する。ICカード1が、外部から入力されるデータEFアクセスコマンドを受信すると、まず、カレントDFを認識する(ST91)。   FIG. 12 shows a flow chart for explaining the operation for accessing the data EF, which will be described below. When the IC card 1 receives an externally input data EF access command, it first recognizes the current DF (ST91).

カレントDFを認識すると、次に、コマンド電文にて指示されているエレメンタリファイル名(EF−ID)を参照し、アクセス対象となっているカレントDF内に、当該エレメンタリファイル名が存在するか否かをチェックする(ST92)。もし存在しない場合には、該当キーID無しを意味するレスポンス電文を出力し、コマンド待ち状態に戻る(ST93)。   When the current DF is recognized, next, the elementary file name (EF-ID) specified in the command message is referred to, and whether the elementary file name exists in the current DF to be accessed. It is checked whether or not (ST92). If it does not exist, a response message indicating that there is no corresponding key ID is output, and the process returns to the command wait state (ST93).

もし存在すれば、次に当該データEF定義情報中のアクセス条件情報のうち、アクセスのタイプ(データ読出し/書込み/変更)に対応するアクセス条件情報を参照する。この条件と、後述するRAM上の照合状態保持領域Aを比較し、アクセス条件が要求しているキーの照合状態が確立されているか否かを判断する(ST94)。   If it exists, the access condition information corresponding to the access type (data read / write / change) is referred to among the access condition information in the data EF definition information. This condition is compared with a collation state holding area A on the RAM, which will be described later, and it is determined whether or not the collation state of the key requested by the access condition is established (ST94).

もし確立されていなければ、アクセス条件不一致を意味するレスポンス電文を出力し、コマンド待ち状態に戻る(ST95)。もし確立されていれば、次に、対応するデータEF領域内に対してアクセスを行ない(ST96)、その処理結果をレスポンス電文として出力し、コマンド待ち状態に戻る(ST97)。   If it has not been established, a response message indicating that the access conditions do not match is output, and the process returns to the command wait state (ST95). If it has been established, the corresponding data EF area is accessed (ST96), the processing result is output as a response message, and the command wait state is returned (ST97).

これによれば、たとえば、アプリケーション提供者キー(トランスポートキー)を設定するアクセス条件として、その上位者である発行者のキーが必要であり、また、アプリケーション提供者トランスポートキーの変更は、当該キーの照合により可能となるように設定しておき、他のアクセスコマンドを実行する際には、アプリケーション提供者のキー照合が必要なように設定されているとする。   According to this, for example, as an access condition for setting an application provider key (transport key), a key of an issuer that is a superior is required, and the change of the application provider transport key is It is assumed that the setting is made so that the key can be verified, and that the key verification of the application provider is required when executing another access command.

この場合、変更前のアプリケーション提供者トランスポートキーの照合結果は、照合状態保持領域Bに格納される。したがって、他のアクセスがアプリケーション提供者キーの照合が必要となっていても、これらのアクセスに使用される照合状態保持領域Aには照合結果が反映されず、よって、当該キーの効果が発揮されていないことが実現できる。   In this case, the collation result of the application provider transport key before the change is stored in the collation state holding area B. Therefore, even if another access requires the verification of the application provider key, the verification result is not reflected in the verification status holding area A used for these accesses, and thus the effect of the key is exhibited. Can be realized.

また、当該キー変更の場合に限っては、照合状態保持領域AおよびBを参照するため、変更前においても確立された照合状態が参照でき、したがって、キー変更行為が許可される。
また、キー変更後のキーの照合により、照合状態保持領域Aに照合状態が反映されるため、以降の他のアクセスに関して効果が発揮されたことになる。
Further, only in the case of the key change, since the comparison state holding areas A and B are referred to, the verification state established before the change can be referred to, so that the key change action is permitted.
In addition, since the collation state is reflected in the collation state holding area A by the collation of the key after the key change, the effect is exhibited with respect to the subsequent other accesses.

また、本実施の形態のように、キーEF創成時に入力されるキーのタイプ情報により、この時点で変更がなされたことを疑似的に行なわせるか否かを設定できるため、アプリケーション提供者個々の要求により、上位者であるカード発行者が種々のタイプを選択的に設定することが可能となる。   Further, as in the present embodiment, since it is possible to set whether or not the change is made at this time by the type information of the key input when the key EF is created, it is possible to set each application provider individually. Upon request, a card issuer as a superior can selectively set various types.

なお、前記実施の形態では、キーのタイプ情報から、あらかじめキーの変更がなされたか否かを示すステータス情報を設定するタイミングとして、キーEF創成コマンド処理中になっているが、たとえば、キーを設置するコマンド処理中に行なってもよい。   In the above embodiment, the key EF creation command processing is performed as the timing for setting the status information indicating whether or not the key has been changed in advance from the key type information. It may be performed during command processing.

また、前記実施の形態では、ファイル管理を行なう電子機器としてICカードを例示したが、これに限定されることなく、ファイル管理を必要とするメモリを備えた電子機器であれば適用可能である。   In the above-described embodiment, an IC card is exemplified as an electronic device that performs file management. However, the present invention is not limited to this, and any electronic device including a memory that requires file management is applicable.

本発明の実施の形態に係るICカードが適用されるカード取扱装置の構成例を示すブロック図。The block diagram which shows the structural example of the card handling apparatus with which the IC card which concerns on embodiment of this invention is applied. ICカードの構成例を示すブロック図。The block diagram which shows the structural example of an IC card. データメモリの構成例を示すメモリマップ図。The memory map figure which shows the structural example of a data memory. 各種定義情報のフォーマット例を示す図。The figure which shows the format example of various definition information. データメモリ内に設定されるファイルの構造例を示す図。The figure which shows the structural example of the file set in a data memory. データメモリ内に設定されるディレクトリの構成例を示す図。The figure which shows the structural example of the directory set in a data memory. データファイル創成のための動作を説明するフローチャート。The flowchart explaining the operation | movement for data file creation. キーエレメンタリファイル創成のための動作を説明するフローチャート。The flowchart explaining the operation | movement for key elementary file creation. キーデータ設定のための動作を説明するフローチャート。The flowchart explaining the operation | movement for key data setting. キーデータ変更のための動作を説明するフローチャート。The flowchart explaining the operation | movement for key data change. キー照合のための動作を説明するフローチャート。The flowchart explaining the operation | movement for key collation. データエレメンタリファイルへのアクセスのための動作を説明するフローチャート。The flowchart explaining the operation | movement for access to a data elementary file.

符号の説明Explanation of symbols

1……ICカード、2……カードリーダ・ライタ、3……制御部、4……キーボード、5……CRTディスプレイ装置、11……制御素子、12……データメモリ、13……ワーキングメモリ、14……プログラムメモリ、15……コンタクト部、120……制御領域、121……ディレクトリ、123……エリア群。   DESCRIPTION OF SYMBOLS 1 ... IC card, 2 ... Card reader / writer, 3 ... Control part, 4 ... Keyboard, 5 ... CRT display device, 11 ... Control element, 12 ... Data memory, 13 ... Working memory, 14 ... Program memory, 15 ... Contact part, 120 ... Control area, 121 ... Directory, 123 ... Area group.

Claims (5)

複数の記憶領域にキーデータおよびデータを記憶するための記憶手段と、
初期キーデータを前記記憶手段に記憶された前記キーデータと比較することによって初期キーデータが変更されているかどうかを判定するための判定手段と、
この判定手段により前記キーデータが変更されていないと判定されたときに前記複数の記憶領域においてデータが処理されるのを阻止するための阻止手段と、
前記判定手段により前記キーデータが変更されていると判定されたときに特定のコマンドに応じて前記複数の記憶領域のデータを処理するための処理手段とを具備し、
前記処理手段は、特定のコマンドに応じて前記複数の記憶領域のそれぞれにおいて前記キーデータのファイルを作成するためのファイル作成手段を含み、このファイル作成手段によるファイル作成は前記キーデータが変更される前に前記阻止手段によって阻止されることを特徴とするICカード。
Storage means for storing key data and data in a plurality of storage areas;
Determining means for determining whether the initial key data has been changed by comparing the initial key data with the key data stored in the storage means;
Blocking means for preventing data from being processed in the plurality of storage areas when it is determined by the determining means that the key data has not been changed;
Processing means for processing the data in the plurality of storage areas in response to a specific command when the determination means determines that the key data has been changed,
The processing means includes a file creation means for creating a file of the key data in each of the plurality of storage areas in response to a specific command, and the file creation by the file creation means changes the key data. An IC card previously blocked by the blocking means.
少なくともメモリを有するICカードにおいて、
前記メモリ内の複数のファイルへのアクセスを管理するファイル管理方法であって、
前記メモリを使用するシステムの上位概念により前記ファイルの下位にあらかじめ設定されている第1キーを前記メモリを使用するシステムの下位概念により設定されている新しいキーと照合することによって前記ファイルへのアクセスを許可し、
前記上位概念は、前記第1キーを前記第1キーの中に設定されたキー変更アクセス条件を参照して前記下位概念だけに知られている第2キーに変更し、かつ、前記第1キーが前記第2キーに変更されると前記上位概念が前記ファイルの下位におけるキーの作成を拒絶することを特徴とするICカードにおけるファイル管理方法。
In an IC card having at least a memory,
A file management method for managing access to a plurality of files in the memory,
Access to the file by collating a first key preset at a lower level of the file by a superordinate concept of the system using the memory with a new key set by a subordinate concept of the system using the memory Allow
The upper concept changes the first key to a second key known only to the lower concept with reference to a key change access condition set in the first key, and the first key A file management method in an IC card, wherein when the key is changed to the second key, the superordinate concept rejects creation of a key in the lower part of the file.
少なくともメモリを有するICカードにおいて、
前記メモリ内の上位概念ファイルおよび下位概念ファイルを含む木構造ファイルへのアクセスを管理するファイル管理方法であって、
上位概念管理プログラムによって管理される前記上位概念ファイルにアクセス条件を設定し、
前記上位概念管理プログラムから下位概念管理プログラムへ提供されるファイルにアクセス条件を設定し、
前記上位概念管理プログラムから前記下位概念管理プログラムへ移送される移送キーを前記下位概念ファイルのアクセス条件を参照して前記下位概念ファイルに設定し、
前記上位概念ファイルの前記アクセス条件が満たされたときに前記下位概念ファイルに前記移送キーを設定し、
前記下位概念ファイルのアクセス条件を参照するとともに、このアクセス条件が満たされたときに前記下位概念ファイルの下位にファイルを設定することを特徴とするICカードにおけるファイル管理方法。
In an IC card having at least a memory,
A file management method for managing access to a tree structure file including a higher-level concept file and a lower-level concept file in the memory,
Set access conditions for the upper concept file managed by the upper concept management program,
Set an access condition for a file provided from the upper concept management program to the lower concept management program,
A transfer key to be transferred from the higher-level concept management program to the lower-level concept management program is set in the lower-level concept file with reference to access conditions of the lower-level concept file;
When the access condition of the upper concept file is satisfied, the transport key is set in the lower concept file,
A file management method for an IC card, wherein the access condition of the lower-level concept file is referred to and a file is set under the lower-level concept file when the access condition is satisfied.
少なくともメモリを有し、このメモリ内に上位概念ファイルおよび下位概念ファイルを有する木構造ファイルを含むICカードにおいて、
アクセス条件が設定されているとともに上位概念管理プログラムによって使用される上位概念ファイルと、
アクセス条件が設定されているとともに前記上位概念管理プログラムによって提供されかつ下位概念管理プログラムによって使用される下位概念ファイルと、
前記上位概念ファイルの前記アクセス条件が満たされたときに前記上位概念ファイルの前記アクセス条件を参照するとともに、前記下位概念ファイルに前記上位概念管理プログラムから前記下位概念管理プログラムへ移送される移送キーを設定するための第1手段と、
前記下位概念ファイルの前記アクセス条件が満たされたときに前記下位概念ファイルの前記アクセス条件を参照するとともに、前記下位概念ファイルの下位にファイルを設定するための第2手段と、
を具備したことを特徴とするICカード。
In an IC card having at least a memory and including a tree structure file having a higher concept file and a lower concept file in the memory,
A superordinate concept file with access conditions set and used by the superordinate concept management program;
A subordinate concept file for which access conditions are set and which is provided by the superordinate concept management program and used by the subordinate concept management program;
When the access condition of the upper concept file is satisfied, the access condition of the upper concept file is referred to, and a transfer key transferred from the upper concept management program to the lower concept management program is transferred to the lower concept file. A first means for setting;
A second means for referring to the access condition of the lower-level concept file when the access condition of the lower-level concept file is satisfied, and for setting a file below the lower-level concept file;
An IC card comprising:
上位概念ファイルおよび下位概念ファイルを有する木構造ファイルを作成するとともに、制御手段によって前記ファイルのそれぞれへのアクセスを管理する情報処理のための制御プログラムを記憶するための記憶媒体であって、
前記制御プログラムは、
アクセス条件が上位概念管理プログラムによって設定されている前記上位概念ファイルを作成し、
前記下位概念ファイルが前記上位概念管理プログラムによって提供され、かつ、下位概念管理プログラムによって使用されるようにアクセス条件が設定されている前記下位概念ファイルを作成し、
前記上位概念ファイルの前記アクセス条件が満たされたときに前記上位概念ファイルの前記アクセス条件を参照するとともに、前記下位概念ファイルに前記上位概念管理プログラムから前記下位概念管理プログラムへ移送される移送キーを設定し、
前記下位概念ファイルの前記アクセス条件が満たされたときに前記下位概念ファイルの前記アクセス条件を参照するとともに、前記下位概念ファイルの下位にファイルを設定することを含むことを特徴とする記憶媒体。
A storage medium for creating a tree structure file having a higher-order concept file and a lower-order concept file, and storing a control program for information processing for managing access to each of the files by a control means,
The control program is
Create the upper concept file in which the access conditions are set by the upper concept management program,
Creating the lower-level concept file in which the lower-level concept file is provided by the higher-level concept management program and the access conditions are set so that it is used by the lower-level concept management program;
When the access condition of the upper concept file is satisfied, the access condition of the upper concept file is referred to, and a transfer key transferred from the upper concept management program to the lower concept management program is transferred to the lower concept file. Set,
A storage medium comprising: referring to the access condition of the lower level concept file when the access condition of the lower level concept file is satisfied, and setting a file below the lower level concept file.
JP2005313276A 2005-10-27 2005-10-27 Ic card and file management method for ic card Abandoned JP2006092568A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005313276A JP2006092568A (en) 2005-10-27 2005-10-27 Ic card and file management method for ic card

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005313276A JP2006092568A (en) 2005-10-27 2005-10-27 Ic card and file management method for ic card

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP8076200A Division JPH09265433A (en) 1996-03-29 1996-03-29 File managing method

Publications (1)

Publication Number Publication Date
JP2006092568A true JP2006092568A (en) 2006-04-06

Family

ID=36233412

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005313276A Abandoned JP2006092568A (en) 2005-10-27 2005-10-27 Ic card and file management method for ic card

Country Status (1)

Country Link
JP (1) JP2006092568A (en)

Similar Documents

Publication Publication Date Title
EP0963580B1 (en) Multi-application ic card system
US5293029A (en) System for mutually certifying an IC card and an IC card terminal
EP0798674B1 (en) File managing method requiring a change in key data and ic card device using the method
US7469339B2 (en) Secure multiple application card system and process
JP3662946B2 (en) File management system and portable electronic device
US5608902A (en) File management system for memory card
JPH021090A (en) Ic card and method for writing its operation program
JPH06282471A (en) File control system
US5828053A (en) Portable storage medium and portable storage medium issuing system
JPH10105472A (en) Method for managing access of memory
EP0949594B1 (en) Access management method and apparatus, and portable electronic device used therefor
JP2006092568A (en) Ic card and file management method for ic card
JP2001523029A (en) Secure management of memory
JPH09265433A (en) File managing method
JP2018136835A (en) IC card and IC card issuing system, IC card issuing method
JPH09114741A (en) Portable information recording medium
JPH09293023A (en) Controlling method for access to memory
AU723007B2 (en) Method of dynamically interpreting data by a chip card
JPH06309531A (en) Checking method for instruction format given to ic card
JPH01194093A (en) Portable electronic device
JP2002352205A (en) Portable electronic equipment and access management method
EA002994B1 (en) Method for indivisibly modifying a plurality of sites in a microcircuit card non volatile memory, in particular a contactless card
CA2625235C (en) System and method for maintaining in the field an activation secure module
JP2017204021A (en) Ic card, ic card issuance system, and ic card issuance method
KR20050046376A (en) Integrated cash ic card, issuing and using method thereof

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20070907

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070925

A762 Written abandonment of application

Free format text: JAPANESE INTERMEDIATE CODE: A762

Effective date: 20071126