JPH09265433A - File managing method - Google Patents

File managing method

Info

Publication number
JPH09265433A
JPH09265433A JP8076200A JP7620096A JPH09265433A JP H09265433 A JPH09265433 A JP H09265433A JP 8076200 A JP8076200 A JP 8076200A JP 7620096 A JP7620096 A JP 7620096A JP H09265433 A JPH09265433 A JP H09265433A
Authority
JP
Japan
Prior art keywords
key
condition
changed
data
access
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.)
Pending
Application number
JP8076200A
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 JP8076200A priority Critical patent/JPH09265433A/en
Priority to EP97105146A priority patent/EP0798674B1/en
Priority to ES97105146T priority patent/ES2174140T3/en
Priority to SG1997000985A priority patent/SG54485A1/en
Priority to DE69710798T priority patent/DE69710798T2/en
Priority to PT97105146T priority patent/PT798674E/en
Priority to TW086103926A priority patent/TW358190B/en
Priority to US08/825,387 priority patent/US5929428A/en
Priority to CN97110316.XA priority patent/CN1129851C/en
Publication of JPH09265433A publication Critical patent/JPH09265433A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To provide a file management method capable of suppressing the display of the effect of a transport key until a slave person chanegs the key transferred from a master person to the slave person and having excellent security. SOLUTION: In this method, a file managment is executed by dividing the data memory of an IC card into plural files and managing the divided files by means of key collation as an access condition. In this case, whether the key is changed or not is judged, and at the time of judging no change of the key, the execution of key collation is turned to a state not satisfied as an access condition. At the time of judging the change of the key, key collation is turned to a state satisfied as an access condition.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【発明の属する技術分野】本発明は、たとえば、不揮発
性メモリ、および、これらを制御するCPUなどの制御
素子を有するICチップを内蔵したICカードにおい
て、上記メモリ内に分割設定される複数のファイルを管
理するファイル管理方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to, for example, a nonvolatile memory and an IC card having an IC chip having a control element such as a CPU for controlling these, and a plurality of files divided and set in the memory. File management method for managing files.

【0002】[0002]

【従来の技術】最近、携帯可能なデータ記憶媒体とし
て、不揮発性のデータメモリ、および、これらを制御す
るCPU(セントラル・プロセッシング・ユニット)な
どの制御素子を有するICチップを内蔵したICカード
が注目されている。
2. Description of the Related Art Recently, as a portable data storage medium, an IC card having a non-volatile data memory and an IC chip having a control element such as a CPU (Central Processing Unit) for controlling them has been noticed. Has been done.

【0003】この種のICカードは、内蔵するデータメ
モリを複数のファイルに分割し、かつ、個々のファイル
には、利用アプリケーションが運用時に必要なデータな
どが格納されるようになっており、外部装置からアプリ
ケーション識別名などを入力することにより、選択的に
対応ファイルのみが使用可能な状態を実現するようにな
っている。このため、複数のアプリケーションデータを
ファイル分けし、1枚のICカードに格納することによ
り、多目的利用が可能なようになっている。
In this type of IC card, the built-in data memory is divided into a plurality of files, and each file stores the data necessary for the application to be used during operation. By inputting an application identification name or the like from the device, a state in which only corresponding files can be selectively used is realized. Therefore, by dividing a plurality of application data into files and storing them in one IC card, multi-purpose use is possible.

【0004】これらのアプリケーションファイルには、
取引データなどのデータ格納のための複数のデータファ
イルと、キーデータ格納のためのキーファイルが所属で
きるようになっている。
These application files include
A plurality of data files for storing data such as transaction data and a key file for storing key data can be assigned.

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

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

【0007】たとえば、前者がカード発行者(上位者)
であり、後者がアプリケーション提供者(下位者)であ
る。カード発行者がアプリケーション提供者にカードア
クセスの権限を移行する場合、一般的には「トランスポ
ートキー」と称する仮キーをICカードに設定し、アプ
リケーション提供者がこれを照合することにより、以
降,アプリケーション提供者がICカードに対してのア
クセスを行なえるようになる。
For example, the former is the card issuer (upper person)
And the latter is the application provider (subordinate). When the card issuer transfers the card access authority to the application provider, a temporary key generally called 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.

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

【0009】[0009]

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

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

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

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

【0013】[0013]

【課題を解決するための手段】本発明のファイル管理方
法は、メモリを複数のファイルに分割し、この分割した
複数のファイルを、キーの照合をアクセスの条件として
それぞれ管理するファイル管理方法において、キーが変
更されたか否かを判断し、この判断によりキーが変更さ
れていないと判断すると、このとき前記キーの照合を行
なった場合、アクセスの条件として満たされない状態と
し、キーが変更されたと判断すると、このとき前記キー
の照合を行なった場合、アクセスの条件として満たされ
た状態とすることを特徴とする。
A file management method according to the present invention is a file management method in which a memory is divided into a plurality of files, and the plurality of divided files are respectively managed under key access conditions as access conditions. If it is determined that the key has not been changed, and if it is determined that the key has not been changed, it is determined that the key has been changed when the key is collated at this time and the condition for access is not satisfied. Then, at this time, when the key is collated, the condition is satisfied as an access condition.

【0014】また、本発明のファイル管理方法は、メモ
リを複数のファイルに分割し、この分割した複数のファ
イルを、キーの照合をアクセスの条件としてそれぞれ管
理するファイル管理方法において、キーが変更されたか
否かを判断し、この判断によりキーが変更されていない
と判断すると、このとき前記キーの照合を行なった場
合、キーの変更以外のアクセスの条件として満たされな
い状態とし、キーが変更されたと判断すると、このとき
前記キーの照合を行なった場合、アクセスの条件として
満たされた状態とすることを特徴とする。
In the file management method of the present invention, the key is changed in the file management method in which the memory is divided into a plurality of files and each of the divided plurality of files is managed with the key verification as an access condition. If it is determined that the key has not been changed by this determination, when the key is collated at this time, it is determined that the condition is not satisfied as an access condition other than the key change, and the key is changed. If it is determined, when the key is collated at this time, the condition for access is satisfied.

【0015】また、本発明のファイル管理方法は、メモ
リを複数のファイルに分割し、この分割した複数のファ
イルを、キーの照合をアクセスの条件としてそれぞれ管
理するファイル管理方法において、キーが変更されたか
否かを判断し、この判断によりキーが変更されていない
と判断すると、このとき前記キーの照合を行なった場
合、アクセスの条件として満たされない状態とし、キー
が変更されたと判断すると、このとき前記キーの照合を
行なった場合、アクセスの条件として満たされた状態と
するか、または、キーが変更されたか否かにかかわら
ず、前記キーの照合を行なった場合、アクセスの条件と
して満たされた状態とするかのいずれかを選択できるこ
とを特徴とする。
Further, in the file management method of the present invention, the memory is divided into a plurality of files, and the plurality of divided files are respectively managed in a key matching condition as an access condition. If it is determined that the key has not been changed by this determination, if the key is collated at this time, the condition for access is not satisfied, and if it is determined that the key has been changed, then When the key is checked, the condition for access is satisfied, or when the key is checked regardless of whether the key is changed, the condition for access is satisfied. It is characterized in that either of the states can be selected.

【0016】また、本発明のファイル管理方法は、メモ
リを複数のファイルに分割し、この分割した複数のファ
イルを、キーの照合をアクセスの条件としてそれぞれ管
理するファイル管理方法において、キーが変更されたか
否かを判断し、この判断によりキーが変更されていない
と判断すると、このとき前記キーの照合を行なった場
合、キーの変更以外のアクセスの条件として満たされな
い状態とし、キーが変更されたと判断すると、このとき
前記キーの照合を行なった場合、アクセスの条件として
満たされた状態とするか、または、キーが変更されたか
否かにかかわらず、前記キーの照合を行なった場合、ア
クセスの条件として満たされた状態とするかのいずれか
を選択できることを特徴とする。
In the file management method of the present invention, the key is changed in the file management method in which the memory is divided into a plurality of files, and the plurality of divided files are respectively managed under the access conditions of collating keys. If it is determined that the key has not been changed by this determination, when the key is collated at this time, it is determined that the condition is not satisfied as an access condition other than the key change, and the key is changed. If it is judged, at this time, if the key is verified, the condition is satisfied as an access condition, or if the key is verified regardless of whether the key is changed or not, the access is confirmed. It is characterized in that it is possible to select either one of the conditions to be satisfied.

【0017】また、本発明のファイル管理方法は、メモ
リを複数のファイルに分割し、この分割した複数のファ
イルを、キーの照合をアクセスの条件としてそれぞれ管
理するファイル管理方法において、キーが変更されたか
否かを判断し、この判断によりキーが変更されていない
と判断すると、このとき前記キーの照合を行なった場
合、アクセスの条件として満たされない状態とし、キー
が変更されたと判断すると、このとき前記キーの照合を
行なった場合、アクセスの条件として満たされた状態と
するか、または、キーが変更されたか否かにかかわら
ず、前記キーの照合を行なった場合、アクセスの条件と
して満たされた状態とするかのいずれかを選択するもの
で、この選択を指示するための属性情報を前記キーに設
定することを特徴とする。
In the file management method of the present invention, the key is changed in the file management method in which the memory is divided into a plurality of files, and the plurality of divided files are respectively managed by the key matching as an access condition. If it is determined that the key has not been changed by this determination, if the key is collated at this time, the condition for access is not satisfied, and if it is determined that the key has been changed, then When the key is checked, the condition for access is satisfied, or when the key is checked regardless of whether the key is changed, the condition for access is satisfied. One of the states is selected, and attribute information for instructing this selection is set in the key. .

【0018】また、本発明のファイル管理方法は、メモ
リを複数のファイルに分割し、この分割した複数のファ
イルを、キーの照合をアクセスの条件としてそれぞれ管
理するファイル管理方法において、キーが変更されたか
否かを判断し、この判断によりキーが変更されていない
と判断すると、このとき前記キーの照合を行なった場
合、キーの変更以外のアクセスの条件として満たされな
い状態とし、キーが変更されたと判断すると、このとき
前記キーの照合を行なった場合、アクセスの条件として
満たされた状態とするか、または、キーが変更されたか
否かにかかわらず、前記キーの照合を行なった場合、ア
クセスの条件として満たされた状態とするかのいずれか
を選択するもので、この選択を指示するための属性情報
を前記キーに設定することを特徴とする。
Further, in the file management method of the present invention, the memory is divided into a plurality of files, and the plurality of divided files are respectively managed by the key matching as an access condition. If it is determined that the key has not been changed by this determination, when the key is collated at this time, it is determined that the condition is not satisfied as an access condition other than the key change, and the key is changed. If it is judged, at this time, if the key is verified, the condition is satisfied as an access condition, or if the key is verified regardless of whether the key is changed or not, the access is confirmed. Select one of the conditions to be satisfied, and set the attribute information for instructing this selection in the key. It is characterized in.

【0019】さらに、本発明のファイル管理方法は、少
なくともメモリを備え、このメモリは複数のファイルに
分割され、この分割された複数のファイルごとにデータ
が格納されるICカードにおいて、前記複数のファイル
を、キーの照合をアクセスの条件としてそれぞれ管理す
るファイル管理方法であって、キーが変更されたか否か
を判断し、この判断によりキーが変更されていないと判
断すると、このとき前記キーの照合を行なった場合、ア
クセスの条件として満たされない状態とし、キーが変更
されたと判断すると、このとき前記キーの照合を行なっ
た場合、アクセスの条件として満たされた状態とするこ
とを特徴とする。
Further, the file management method of the present invention comprises at least a memory, the memory is divided into a plurality of files, and data is stored for each of the plurality of divided files. Is a file management method for managing key verification as an access condition. It is determined whether or not the key has been changed, and if this judgment determines that the key has not been changed, then the key verification is performed at this time. If the key is changed when it is determined that the access condition is not satisfied and the key is changed at this time, the condition is satisfied when the key is collated at this time.

【0020】本発明によれば、キーが変更されたか否か
を判断し、変更されていないと判断すると、キーの照合
を行なった場合、アクセスの条件として満たされない状
態とし、変更されたと判断すると、キーの照合を行なっ
た場合、アクセスの条件として満たされた状態とするこ
とにより、トランスポートキーを上位者から下位者に渡
した後、下位者が当該キーを変更しない限り、その効力
が発揮されないようにすることができ、しかも、この方
法を適用するか否かをファイル登録時に選択的に設定可
能となる。
According to the present invention, it is determined whether or not the key has been changed, and when it is determined that the key has not been changed, when the key is collated, it is determined that the condition is not satisfied as an access condition and it is determined that the key has been changed. , When the key is verified, the condition is satisfied as an access condition, so that the effect is exhibited unless the lower person changes the key after passing the transport key from the upper person to the lower person. Whether or not this method is applied can be selectively set at the time of file registration.

【0021】[0021]

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

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

【0023】データメモリ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 holding processing data when the control element 11 performs processing, and is composed of, for example, a RAM. The program memory 14 is composed of, for example, a mask ROM, and stores the program of the control element 11 and the like.

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

【0025】データファイルは、対応するアプリケーシ
ョンにて使用されるデータエリア、および、キーエリア
を一括して管理するためのファイルである。データエリ
アは、たとえば、取引データなどのように、必要に応じ
て読み書きするためのデータを格納するエリアである。
The data file is a file for collectively managing a data area and a key area used by a corresponding application. The data area is an area for storing data for reading and writing as necessary, such as transaction data.

【0026】キーエリアは、たとえば、暗証番号などの
格納に利用されているエリアであり、書込み/書換え/
照合の対象になり、読出しはできないようになってい
る。なお、これらのエリアは、図3に示すように、エリ
ア群123として一括して割当てられている。また、こ
れらのファイルあるいはエリアは、データメモリ12内
のディレクトリ121を用いることにより、それぞれの
物理的位置などを制御素子11が認識するようになって
いる。
The key area is an area used for storing a personal identification number, for example, and is used for writing / rewriting / writing.
It is a target of collation and cannot be read. Note that these areas are collectively assigned as an area group 123, as shown in FIG. The control element 11 recognizes the physical position of each of these files or areas by using the directory 121 in the data memory 12.

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

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

【0029】図4(b)は、データファイルの管理情報
を定義する情報である。この定義情報は、ディレクトリ
121内でデータファイル名定義情報を識別するための
データPTN、本データファイルに割当てられたファイ
ル通し番号DFSN、本データファイルの親ファイルの
通し番号PFSN、データファイルサイズDFS、本デ
ータファイルの付加情報が格納されるデータエリアを識
別するためのAAID、当該付加情報を出力するか否か
などを規定するTYPE、キーの種別を禁止するUC
F、データファイルのアクセス条件を示すDFAC、本
データファイルの状態を保持するためのDFST、本デ
ータファイルの配下に位置するデータファイルおよびエ
リアにより使用されているバイト数US、および、これ
らのデータの正当性をチェックするためのデータBCC
から構成される。
FIG. 4B shows information defining management information of the data file. The definition information includes data PTN for identifying data file name definition information in the directory 121, a file serial number DFSN assigned to the data file, a serial number PFSN of a parent file of the data file, a data file size DFS, and a data file. 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, and UC for inhibiting the type of key
F, DFAC indicating the access condition of the data file, DFST for holding the state of the data file, the number of bytes US used by the data file and area located under the data file, and the Data BCC for checking validity
Consists of

【0030】また、特にAAIDは、後述するデータフ
ァイル選択コマンドにてデータファイルが選択された際
に、必要に応じてそれに示されるデータエリアの内容を
出力する。
Further, particularly when the data file is selected by the data file selection command described later, the AAID outputs the contents of the data area indicated therein as necessary.

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

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

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

【0034】図5は、ファイルの構造例を示している。
この図において、DFnnはデータファイルを、Dnn
はデータエリアを、Knnはキーエリアを、それぞれ示
している。
FIG. 5 shows an example of the file structure.
In this figure, DFnn represents a data file, Dnn
Indicates a data area, and Knn indicates a key area.

【0035】図示するように、ICカード1内のメモリ
12において、マスタファイル(MF)の配下には、デ
ータファイルDF1,DF2が、また、キーエリアK0
0,K01、データエリアD00,D01が、それぞれ
設定されている。
As shown in the figure, in the memory 12 in the IC card 1, under the master file (MF), the data files DF1 and DF2 and the key area K0.
0, K01 and data areas D00, D01 are respectively set.

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

【0037】また、データファイルDF1−1の配下に
は、キーエリアK111,K112、データエリアD1
11/D112が、また、データファイルDF1−2の
配下には、キーエリアK121,K122、データエリ
アD121,D122が、それぞれ設定されている。
Under the data file DF1-1, there are key areas K111 and K112 and a data area D1.
11 / D112, and key areas K121 and K122 and data areas D121 and D122 are set under the data files DF1-2, respectively.

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

【0039】また、データファイルDF2−1の配下に
は、キーエリアK211,K212、データエリアD2
11,D212が、また、データファイルDF2−2の
配下には、キーエリアK221,K222、データエリ
アD221,D222が、それぞれ設定されている。
Under the data file DF2-1, there are key areas K211, K212 and a data area D2.
11 and D212, and key areas K221 and K222 and data areas D221 and D222 are set under the data file DF2-2.

【0040】これらの各種定義情報は、一括して図6に
示すように、ディレクトリ121に格納される。図示す
るように、各定義情報には、DFSN(ファイル通し番
号)が、ファイル創成時に自動的に付与される。このD
FSN、および、データファイル定義情報に格納される
親ファイルのシーケンス番号により、各ファイルの関連
状態を制御素子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 assigned to each definition information when a file is created. This D
The control element 11 recognizes the related state of each file based on the FSN and the sequence number of the parent file stored in the data file definition information.

【0041】たとえば、データファイル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 a file sequence number '03' at the time of creation, and at the same time recognizes that this data file is created under the control of DF1, and gives DFSN ('01') of the data file DF1 as PFSN. I do.

【0042】図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, first, it recognizes a usable state, that is, a data file in a current state (hereinafter, referred to as a current DF) (ST1). In particular, immediately after the electrical activation of the IC card 1, the current DF becomes a master file (MF).

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

【0044】もし確立されていなければ、アクセス条件
不一致を意味するレスポンス電文を出力し、コマンド待
ち状態に戻る(ST3)。また、もし確立されていれ
ば、次に、コマンド内に設定されているデータファイル
のファイル名(DF−ID)を抽出し、カレントDFが
有するFSNと同一の値を親FSNとして有しており、
さらに、抽出したファイル名と同一のファイル名を有し
ているデータファイル定義情報が存在するか否かを確認
する(ST4)。
If not 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 same value as the FSN of the current DF is included as the parent FSN. ,
Further, it is confirmed whether or not there is data file definition information having the same file name as the extracted file name (ST4).

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

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

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

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

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

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

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

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

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

【0054】したがって、上記キータイプ情報の第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 does not become "0" unless the key is changed, and "0". In this case, the 8th bit of the status information is "0" regardless of whether or not the key is changed (that is, it is equivalent to the implicit rewriting action).

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

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

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

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

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

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

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

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

【0063】図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).

【0064】カレントDFを認識すると、次に、コマン
ド電文にて指示されているエレメンタリファイル名(E
F−ID)を参照し、アクセス対象となっているカレン
トDF内に、当該エレメンタリファイル名が存在するか
否かをチェックする(ST52)。もし存在しない場合
には、該当キーID無しを意味するレスポンス電文を出
力し、コマンド待ち状態に戻る(ST53)。
When the current DF is recognized, next, the elementary file name (E
(F-ID), and it is checked whether or not the relevant elementary file name exists in the current DF to be accessed (ST52). 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 waiting state (ST53).

【0065】もし存在すれば、次に当該キーEF定義情
報中のアクセス条件情報のうち、キーデータ変更に関す
る情報を参照する。この条件と、後述するRAM上の照
合状態保持領域AおよびBを比較し、アクセス条件が要
求しているキーの照合状態が確立されているか否かを判
断する(ST54)。
If it exists, then the access condition information in the key EF definition information is referred to, which is information about the key data change. 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 required by the access condition has been established (ST54).

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

【0067】もし存在すれば、コマンド電文にて指定さ
れたキーのタイプと、入力キーデータのサイズの正当性
をチェックする(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, when the key type is “authentication related key”, the size is, for example, 8 bytes. When the key type is “verification key”, the size is, for example, 1 to 16 bytes. Is determined to be valid. If it is determined that the input key data size is not valid, a response message indicating an abnormal input key data size is output, and the process returns to the command waiting state (ST59).

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

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

【0070】図11は、キー照合のための動作を説明す
るフローチヤートを示しており、以下それについて説明
する。ICカード1が、外部から入力されるキー照合コ
マンドを受信すると、まず、カレントDFを認識する
(ST71)。
FIG. 11 shows a flow chart for explaining the operation for key verification, 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).

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

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

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

【0074】なお、所定の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 has the corresponding bit 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 described later, if the bit is “0”, the changed key is changed. 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.

【0075】また、キー照合処理において、不一致であ
ると判断した場合には(ST77)、まず、当該キーE
F定義情報中の照合ビット指定情報、および、ステータ
ス情報を参照し、上記と同様の手順にしたがって、照合
状態保持領域AまたはBのいずれかの領域の所定ビット
を「0」にする(ST81)。
If it is determined in the key matching process that they do not match (ST77), first, the key E
By referring to the collation bit designation information in the F definition information and the status information, the predetermined bit in either of the collation state holding areas A or B is set to "0" according to the same procedure as described above (ST81). .

【0076】次に、キー固有の照合不一致カウンタを1
つだけインクリメントする(ST82)。このとき、キ
ーEF定義情報中のカウント最大値に達していない場合
には(ST83)、照合不一致を示すレスポンス電文を
出力し、コマンド待ち状態に戻る(ST84)。また、
最大値に達していたならば、キーロック済みを示すレス
ポンス電文を出力し、コマンド待ち状態に戻る(ST8
5)。
Next, the collation mismatch counter unique to the key is set to 1
Only increment by one (ST82). At this time, if the count maximum value in the key EF definition information has not been reached (ST83), a response telegram indicating a collation mismatch is output, and the process returns to the command waiting state (ST84). Also,
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 waiting state (ST8).
5).

【0077】図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 a data EF access command input from the outside, first,
The current DF is recognized (ST91).

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

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

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

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

【0082】この場合、変更前のアプリケーション提供
者トランスポートキーの照合結果は、照合状態保持領域
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 needs to collate the application provider key, the collation result is not reflected in the collation state holding area A used for these accesses, and thus the effect of the key is exerted. Not what can be achieved.

【0083】また、当該キー変更の場合に限っては、照
合状態保持領域AおよびBを参照するため、変更前にお
いても確立された照合状態が参照でき、したがって、キ
ー変更行為が許可される。
Further, only in the case of the key change, since the collation state holding areas A and B are referred to, the collation state established before the change can be referred to, and accordingly, the key changing action is permitted.

【0084】また、キー変更後のキーの照合により、照
合状態保持領域Aに照合状態が反映されるため、以降の
他のアクセスに関して効果が発揮されたことになる。ま
た、本実施の形態のように、キーEF創成時に入力され
るキーのタイプ情報により、この時点で変更がなされた
ことを疑似的に行なわせるか否かを設定できるため、ア
プリケーション提供者個々の要求により、上位者である
カード発行者が種々のタイプを選択的に設定することが
可能となる。
Further, 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 exerted for other subsequent accesses. Further, as in the present embodiment, it is possible to set whether or not to make a pseudo change at this point by the type information of the key that is input when the key EF is created. The request allows the higher-ranking card issuer to selectively set various types.

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

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

【0087】[0087]

【発明の効果】以上詳述したように本発明によれば、ト
ランスポートキーを上位者から下位者に渡した後、下位
者が当該キーを変更しない限り、その効力が発揮されな
いようにすることができ、セキュリティ性に優れたファ
イル管理方法を提供できる。
As described above in detail, according to the present invention, after the transport key is passed from the superior to the inferior, the effect is not exerted unless the inferior changes the key. It is possible to provide a file management method with excellent security.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明の実施の形態に係るICカードが適用さ
れるカード取扱装置の構成例を示すブロック図。
FIG. 1 is a block diagram showing a configuration example of a card handling device to which an IC card according to an embodiment of the present invention is applied.

【図2】ICカードの構成例を示すブロック図。FIG. 2 is a block diagram showing a configuration example of an IC card.

【図3】データメモリの構成例を示すメモリマップ図。FIG. 3 is a memory map diagram showing a configuration example of a data memory.

【図4】各種定義情報のフォーマット例を示す図。FIG. 4 is a diagram showing a format example of various definition information.

【図5】データメモリ内に設定されるファイルの構造例
を示す図。
FIG. 5 is a diagram showing a structural example of a file set in a data memory.

【図6】データメモリ内に設定されるディレクトリの構
成例を示す図。
FIG. 6 is a diagram showing a configuration example of a directory set in a data memory.

【図7】データファイル創成のための動作を説明するフ
ローチャート。
FIG. 7 is a flowchart illustrating an operation for creating a data file.

【図8】キーエレメンタリファイル創成のための動作を
説明するフローチャート。
FIG. 8 is a flowchart illustrating an operation for creating a key elementary file.

【図9】キーデータ設定のための動作を説明するフロー
チャート。
FIG. 9 is a flowchart illustrating an operation for setting key data.

【図10】キーデータ変更のための動作を説明するフロ
ーチャート。
FIG. 10 is a flowchart illustrating an operation for changing key data.

【図11】キー照合のための動作を説明するフローチャ
ート。
FIG. 11 is a flowchart illustrating an operation for key verification.

【図12】データエレメンタリファイルへのアクセスの
ための動作を説明するフローチャート。
FIG. 12 is a flowchart illustrating an operation for accessing a data elementary file.

【符号の説明】[Explanation of symbols]

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

Claims (7)

【特許請求の範囲】[Claims] 【請求項1】 メモリを複数のファイルに分割し、この
分割した複数のファイルを、キーの照合をアクセスの条
件としてそれぞれ管理するファイル管理方法において、 キーが変更されたか否かを判断し、この判断によりキー
が変更されていないと判断すると、このとき前記キーの
照合を行なった場合、アクセスの条件として満たされな
い状態とし、キーが変更されたと判断すると、このとき
前記キーの照合を行なった場合、アクセスの条件として
満たされた状態とすることを特徴とするファイル管理方
法。
1. In a file management method in which a memory is divided into a plurality of files, and the divided plurality of files are respectively managed by matching a key as a condition of access, it is determined whether or not a key is changed. If it is determined that the key has not been changed, if the key is collated at this time, the condition for access is not satisfied, and if it is determined that the key has been changed, the key is collated at this time. , A file management method characterized in that the access condition is satisfied.
【請求項2】 メモリを複数のファイルに分割し、この
分割した複数のファイルを、キーの照合をアクセスの条
件としてそれぞれ管理するファイル管理方法において、 キーが変更されたか否かを判断し、この判断によりキー
が変更されていないと判断すると、このとき前記キーの
照合を行なった場合、キーの変更以外のアクセスの条件
として満たされない状態とし、キーが変更されたと判断
すると、このとき前記キーの照合を行なった場合、アク
セスの条件として満たされた状態とすることを特徴とす
るファイル管理方法。
2. A file management method in which a memory is divided into a plurality of files, and the plurality of divided files are respectively managed by using a key collation as an access condition, and it is determined whether or not the key has been changed. If it is determined that the key has not been changed, if the key is collated at this time, the condition is not satisfied as an access condition other than the key change, and if it is determined that the key has been changed, the key of the key is changed at this time. A file management method characterized in that, when a collation is performed, the condition for access is satisfied.
【請求項3】 メモリを複数のファイルに分割し、この
分割した複数のファイルを、キーの照合をアクセスの条
件としてそれぞれ管理するファイル管理方法において、 キーが変更されたか否かを判断し、この判断によりキー
が変更されていないと判断すると、このとき前記キーの
照合を行なった場合、アクセスの条件として満たされな
い状態とし、キーが変更されたと判断すると、このとき
前記キーの照合を行なった場合、アクセスの条件として
満たされた状態とするか、または、キーが変更されたか
否かにかかわらず、前記キーの照合を行なった場合、ア
クセスの条件として満たされた状態とするかのいずれか
を選択できることを特徴とするファイル管理方法。
3. A file management method in which a memory is divided into a plurality of files, and the plurality of divided files are respectively managed with key collation as an access condition, it is determined whether or not a key has been changed. If it is determined that the key has not been changed, if the key is collated at this time, the condition for access is not satisfied, and if it is determined that the key has been changed, the key is collated at this time. , The condition is satisfied as an access condition, or the key is verified regardless of whether the key is changed, the condition is satisfied as an access condition. A file management method characterized by being selectable.
【請求項4】 メモリを複数のファイルに分割し、この
分割した複数のファイルを、キーの照合をアクセスの条
件としてそれぞれ管理するファイル管理方法において、 キーが変更されたか否かを判断し、この判断によりキー
が変更されていないと判断すると、このとき前記キーの
照合を行なった場合、キーの変更以外のアクセスの条件
として満たされない状態とし、キーが変更されたと判断
すると、このとき前記キーの照合を行なった場合、アク
セスの条件として満たされた状態とするか、または、キ
ーが変更されたか否かにかかわらず、前記キーの照合を
行なった場合、アクセスの条件として満たされた状態と
するかのいずれかを選択できることを特徴とするファイ
ル管理方法。
4. A file management method in which a memory is divided into a plurality of files, and the plurality of divided files are respectively managed by using key collation as an access condition, and it is determined whether or not the key has been changed. If it is determined that the key has not been changed, if the key is collated at this time, the condition is not satisfied as an access condition other than the key change, and if it is determined that the key has been changed, the key of the key is changed at this time. When the collation is performed, the condition is satisfied as the access condition, or when the key is collated regardless of whether the key is changed, the condition is satisfied as the access condition. A file management method characterized by being able to select either
【請求項5】 メモリを複数のファイルに分割し、この
分割した複数のファイルを、キーの照合をアクセスの条
件としてそれぞれ管理するファイル管理方法において、 キーが変更されたか否かを判断し、この判断によりキー
が変更されていないと判断すると、このとき前記キーの
照合を行なった場合、アクセスの条件として満たされな
い状態とし、キーが変更されたと判断すると、このとき
前記キーの照合を行なった場合、アクセスの条件として
満たされた状態とするか、または、キーが変更されたか
否かにかかわらず、前記キーの照合を行なった場合、ア
クセスの条件として満たされた状態とするかのいずれか
を選択するもので、この選択を指示するための属性情報
を前記キーに設定することを特徴とするファイル管理方
法。
5. A file management method in which a memory is divided into a plurality of files, and the plurality of divided files are respectively managed with a key collation as an access condition, it is determined whether or not the key has been changed. If it is determined that the key has not been changed, if the key is collated at this time, the condition for access is not satisfied, and if it is determined that the key has been changed, the key is collated at this time. , The condition is satisfied as an access condition, or the key is verified regardless of whether the key is changed, the condition is satisfied as an access condition. A file management method for selecting, and setting attribute information for instructing the selection in the key.
【請求項6】 メモリを複数のファイルに分割し、この
分割した複数のファイルを、キーの照合をアクセスの条
件としてそれぞれ管理するファイル管理方法において、 キーが変更されたか否かを判断し、この判断によりキー
が変更されていないと判断すると、このとき前記キーの
照合を行なった場合、キーの変更以外のアクセスの条件
として満たされない状態とし、キーが変更されたと判断
すると、このとき前記キーの照合を行なった場合、アク
セスの条件として満たされた状態とするか、または、キ
ーが変更されたか否かにかかわらず、前記キーの照合を
行なった場合、アクセスの条件として満たされた状態と
するかのいずれかを選択するもので、この選択を指示す
るための属性情報を前記キーに設定することを特徴とす
るファイル管理方法。
6. A file management method in which a memory is divided into a plurality of files, and the plurality of divided files are respectively managed by using a key collation as an access condition, and it is determined whether or not the key has been changed. If it is determined that the key has not been changed, if the key is collated at this time, the condition is not satisfied as an access condition other than the key change, and if it is determined that the key has been changed, the key of the key is changed at this time. When the collation is performed, the condition is satisfied as the access condition, or when the key is collated regardless of whether the key is changed, the condition is satisfied as the access condition. A file management method characterized in that any one of the above is selected, and attribute information for instructing this selection is set in the key. .
【請求項7】 少なくともメモリを備え、このメモリは
複数のファイルに分割され、この分割された複数のファ
イルごとにデータが格納されるICカードにおいて、 前記複数のファイルを、キーの照合をアクセスの条件と
してそれぞれ管理するファイル管理方法であって、 キーが変更されたか否かを判断し、この判断によりキー
が変更されていないと判断すると、このとき前記キーの
照合を行なった場合、アクセスの条件として満たされな
い状態とし、キーが変更されたと判断すると、このとき
前記キーの照合を行なった場合、アクセスの条件として
満たされた状態とすることを特徴とするICカードのフ
ァイル管理方法。
7. An IC card comprising at least a memory, wherein the memory is divided into a plurality of files, and data is stored for each of the plurality of divided files. It is a file management method to manage each as a condition, and it is judged whether the key has been changed, and if it is judged that the key has not been changed by this judgment, if the key is collated at this time, the access condition The method for managing a file of an IC card is characterized in that, when it is determined that the key has been changed and the key is verified at this time, the condition is satisfied as an access condition.
JP8076200A 1996-03-29 1996-03-29 File managing method Pending JPH09265433A (en)

Priority Applications (9)

Application Number Priority Date Filing Date Title
JP8076200A JPH09265433A (en) 1996-03-29 1996-03-29 File managing method
EP97105146A EP0798674B1 (en) 1996-03-29 1997-03-26 File managing method requiring a change in key data and ic card device using the method
ES97105146T ES2174140T3 (en) 1996-03-29 1997-03-26 METHOD OF MANAGING FILES, WHICH NEED A CHANGE OF THE KEY DATA AND INTEGRATED CIRCUIT CARD THAT USES THIS METHOD.
SG1997000985A SG54485A1 (en) 1996-03-29 1997-03-26 File managing method requiring a change in key data and ic card device using the method
DE69710798T DE69710798T2 (en) 1996-03-29 1997-03-26 File management method and chip card using this method require key data change
PT97105146T PT798674E (en) 1996-03-29 1997-03-26 METHOD OF FILTER MANAGEMENT THAT REQUIRES THE CHANGE OF KEY DATA AND IC CARD DEVICE FOR USING THE METHOD
TW086103926A TW358190B (en) 1996-03-29 1997-03-27 Files management system
US08/825,387 US5929428A (en) 1996-03-29 1997-03-28 File managing method requiring a change in key data and IC card device using the method
CN97110316.XA CN1129851C (en) 1996-03-29 1997-03-31 File management method

Applications Claiming Priority (1)

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

Related Child Applications (1)

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

Publications (1)

Publication Number Publication Date
JPH09265433A true JPH09265433A (en) 1997-10-07

Family

ID=13598524

Family Applications (1)

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

Country Status (1)

Country Link
JP (1) JPH09265433A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005122228A (en) * 2003-10-14 2005-05-12 Sony Broadband Solution Corp Information storage medium
JP2007072921A (en) * 2005-09-09 2007-03-22 Konica Minolta Business Technologies Inc File management device and file management method

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005122228A (en) * 2003-10-14 2005-05-12 Sony Broadband Solution Corp Information storage medium
JP4638135B2 (en) * 2003-10-14 2011-02-23 ソニー株式会社 Information storage medium
JP2007072921A (en) * 2005-09-09 2007-03-22 Konica Minolta Business Technologies Inc File management device and file management method
JP4529848B2 (en) * 2005-09-09 2010-08-25 コニカミノルタビジネステクノロジーズ株式会社 File management apparatus and file management method

Similar Documents

Publication Publication Date Title
US5608902A (en) File management system for memory card
US5293029A (en) System for mutually certifying an IC card and an IC card terminal
US5225664A (en) Mutual authentication system
EP0798674B1 (en) File managing method requiring a change in key data and ic card device using the method
JP2623332B2 (en) IC card and its operation program writing method
JP3662946B2 (en) File management system and portable electronic device
JP2002512715A (en) Secure multi-application card system and process
US7367047B2 (en) Portable information recording medium
US5365045A (en) Portable electric device
JPH06282471A (en) File control system
US5828053A (en) Portable storage medium and portable storage medium issuing system
US6805296B2 (en) Processing method and system of data management for IC card
JPH10105472A (en) Method for managing access of memory
JPH09265433A (en) File managing method
EP0949594B1 (en) Access management method and apparatus, and portable electronic device used therefor
JPH09293023A (en) Controlling method for access to memory
US5862402A (en) System for rapidly issuing IC cards by proving an association between stored issue data and discrimination data then issuing IC cards pursuant to the issue data
JPH09114741A (en) Portable information recording medium
JP2006092568A (en) Ic card and file management method for ic card
AU723007B2 (en) Method of dynamically interpreting data by a chip card
JPH06309531A (en) Checking method for instruction format given to ic card
JP2004030532A (en) Ic card and ic card program
JP2002352205A (en) Portable electronic equipment and access management method
JP2004185242A (en) Ic card communication system switching method and ic card
EA002994B1 (en) Method for indivisibly modifying a plurality of sites in a microcircuit card non volatile memory, in particular a contactless card

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20041104

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050111

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050311

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20050913