JP5689050B2 - Portable recording medium, portable recording medium control method, and portable recording medium control program - Google Patents
Portable recording medium, portable recording medium control method, and portable recording medium control program Download PDFInfo
- Publication number
- JP5689050B2 JP5689050B2 JP2011256295A JP2011256295A JP5689050B2 JP 5689050 B2 JP5689050 B2 JP 5689050B2 JP 2011256295 A JP2011256295 A JP 2011256295A JP 2011256295 A JP2011256295 A JP 2011256295A JP 5689050 B2 JP5689050 B2 JP 5689050B2
- Authority
- JP
- Japan
- Prior art keywords
- flag
- recording medium
- portable recording
- predetermined command
- memory
- 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.)
- Active
Links
Images
Description
本発明は、可搬記録媒体、可搬記録媒体の制御方法、及び可搬記録媒体の制御プログラムに関する。 The present invention relates to a portable recording medium, a portable recording medium control method, and a portable recording medium control program.
近年普及しているICカード等の可搬記録媒体に関しては、可搬記録媒体に格納されたデータの読み書きするためのコマンドが、国際標準規格及び業界標準規格で規定されている(例えば非特許文献1、非特許文献2及び非特許文献3)。
With respect to portable recording media such as IC cards that have become widespread in recent years, commands for reading and writing data stored in portable recording media are defined in international standards and industry standards (for example, non-patent documents). 1, Non-Patent
しかしながら、従来、可搬記録媒体において、国際標準規格及び業界標準規格の記述だけでは、実装時にメーカ間によって解釈が分かれる実装依存の仕様がある。このため、異なるメーカ間の製品を混在させて運用するシステムにおいて、一方のメーカの製品の挙動が、他方のメーカの製品が期待した挙動とならない事象が発生する可能性がある。 However, conventionally, in portable recording media, there are implementation-dependent specifications in which interpretation differs among manufacturers at the time of implementation only by descriptions of international standards and industry standards. For this reason, in a system in which products of different manufacturers are mixed and operated, an event may occur in which the behavior of one manufacturer's product does not become the behavior expected by the other manufacturer's product.
例えば、Update Recordなど書込みコマンドでは、不揮発性メモリにレコード構造のファイルを書き込んでいき、レコード構造のファイルを格納する領域(以下、ブロックという。)の空きが無くなった場合のリーダライタへの応答動作について2通りの実装方法がある。ある実装では、レコード構造のファイルの書込みが正常に終了したので、正常終了と判断して、ステータスワード(以下SWという。)として9000hをカードリーダライタに応答する。もう一方の実装では、書込みは正常終了したが、ブロックの空きが無くなったことの警告を発するため、SWとして6381hをリーダライタに応答する。なおここでSW中の末尾のhは、当該数値が16進数であることを意味する。 For example, in a write command such as Update Record, a record structure file is written to the nonvolatile memory, and a response operation to the reader / writer when the area for storing the record structure file (hereinafter referred to as a block) runs out. There are two mounting methods for. In one implementation, since writing of the record structure file has been completed normally, it is determined as normal termination, and 9000h is returned to the card reader / writer as a status word (hereinafter referred to as SW). In the other implementation, the writing is normally completed, but a warning that the block is no longer empty is issued, so 6381h is returned to the reader / writer as SW. Here, h at the end of SW means that the numerical value is a hexadecimal number.
また例えば、PUT DATAコマンド実行時の挙動も実装により異なる。PUT DATAコマンドとは、Tag/Length/Valueの3つのフィールドからなる構造をもつ形式のデータオブジェクトを更新するためのコマンドである。可搬記録媒体がPUT DATAコマンドを受信した場合、一度書き込まれたデータオブジェクトを更新するか否かで、実装方法が2通りある。ある実装では、一度書き込まれたデータオブジェクトを更新することを許容し、SWとして9000hをリーダライタに応答する。もう一方の実装では、一度書き込まれたデータオブジェクトを更新することを許容せず、SWを6985hとして応答する。 Also, for example, the behavior when executing the PUT DATA command varies depending on the implementation. The PUT DATA command is a command for updating a data object having a structure having three fields of Tag / Length / Value. When the portable recording medium receives the PUT DATA command, there are two mounting methods depending on whether or not the data object once written is updated. In some implementations, once written data objects are allowed to be updated and 9000h is returned to the reader / writer as SW. The other implementation does not allow the data object that has been written once to be updated, and responds with SW as 6985h.
このため、同一規格に準拠する機能でありながら、コマンド体系や挙動が互いに異なる可搬記録媒体を混在させて運用する場合、リーダライタ等の可搬記録媒体の上位装置は、当該可搬記録媒体の各挙動に合わせて複数の処理機能を実装しなければならず、システム構築の点でコスト高になる。 For this reason, in the case of operating a mixture of portable recording media having different command systems and behaviors while having functions conforming to the same standard, the host device of the portable recording medium such as a reader / writer A plurality of processing functions must be implemented according to each behavior of the system, which increases the cost in terms of system construction.
したがって、上記のような問題点に鑑みてなされた本発明の目的は、所定のコマンドに対する可搬記録媒体の挙動を同一にし、リーダライタ等の上位装置が可搬記録媒体の挙動に合わせて複数の処理機能を実装する必要が無く、互換性の高い可搬記録媒体、可搬記録媒体の制御方法、及び可搬記録媒体の制御プログラムを提供することにある。 Accordingly, an object of the present invention made in view of the above problems is to make the behavior of a portable recording medium the same with respect to a predetermined command, and a plurality of host devices such as reader / writers can be adapted to the behavior of the portable recording medium. It is an object to provide a highly compatible portable recording medium, a portable recording medium control method, and a portable recording medium control program.
上記課題を解決するために本発明に係る可搬記録媒体は、
所定のコマンドに対応する応答を指定するフラグをデータ構造に含む該所定のコマンドをリーダライタから受信する通信インタフェースと、
前記フラグを格納するメモリと、
前記メモリに格納された前記フラグを解釈し、前記リーダライタに前記所定のコマンドに対応する応答をする演算装置と、
を有することを特徴とする。
また本発明に係る可搬記録媒体の制御方法は、
所定のコマンド及び該所定のコマンドに対応する応答を指定するフラグをリーダライタから受信する通信インタフェースと、
前記フラグを格納するメモリと、
前記メモリに格納された前記フラグを解釈し、前記リーダライタに前記所定のコマンドに対応する応答をする演算装置と、
を有し、
前記メモリは、前記所定のコマンドを実行した結果に関する複数の情報を格納し、
前記フラグは、前記所定のコマンドを実行した結果に関する前記複数の情報に各々対応する複数の応答の優先順位を指定し、
前記演算装置は、前記フラグにより指定された前記優先順位に基づき、前記リーダライタに前記所定のコマンドを実行した結果に関する情報に対応する応答をすることを特徴とする。
In order to solve the above problems, a portable recording medium according to the present invention provides:
A communication interface for receiving said predetermined command from the reader-writer includes a flag for designating a response corresponding to a Jo Tokoro commands in the data structure,
A memory for storing the flag;
An arithmetic unit that interprets the flag stored in the memory and responds to the reader / writer in response to the predetermined command;
It is characterized by having.
The control method of the portable recording medium according to the present invention includes:
A communication interface for receiving from the reader / writer a flag designating a predetermined command and a response corresponding to the predetermined command;
A memory for storing the flag;
An arithmetic unit that interprets the flag stored in the memory and responds to the reader / writer in response to the predetermined command;
Have
The memory stores a plurality of pieces of information related to a result of executing the predetermined command,
The flag specifies the priority order of a plurality of responses respectively corresponding to the plurality of information related to a result of executing the predetermined command;
The arithmetic device makes a response corresponding to information related to a result of executing the predetermined command to the reader / writer based on the priority specified by the flag.
また本発明に係る可搬記録媒体の制御方法は、
所定のコマンドに対応する応答を指定するフラグをデータ構造に含む該所定のコマンドをリーダライタから受信するステップと、
前記フラグをメモリに格納するステップと、
前記メモリに格納された前記フラグを解釈し、前記所定のコマンドに対する応答をするステップと、
を含むことを特徴とする。
また本発明に係る可搬記録媒体の制御方法は、
所定のコマンド及び該所定のコマンドへの応答を指定するフラグをリーダライタから受信するステップと、
前記フラグをメモリに格納するステップと、
前記メモリに格納された前記フラグを解釈し、前記所定のコマンドに対する応答をするステップと、
を含み、
前記メモリに格納するステップは、前記所定のコマンドを実行した結果に関する複数の情報を前記メモリに格納し、
前記フラグは、前記所定のコマンドを実行した結果に関する前記複数の情報に各々対応する複数の応答の優先順位を指定し、
前記応答をするステップは、前記フラグにより指定された前記優先順位に基づき、前記リーダライタに前記所定のコマンドを実行した結果に関する情報に対応する応答をすることを特徴とする。
The control method of the portable recording medium according to the present invention includes:
Receiving said predetermined command from the reader-writer includes a flag for designating a response corresponding to a Jo Tokoro commands in the data structure,
Storing the flag in a memory;
Interpreting the flag stored in the memory and responding to the predetermined command;
It is characterized by including.
The control method of the portable recording medium according to the present invention includes:
Receiving a flag designating a predetermined command and a response to the predetermined command from the reader / writer;
Storing the flag in a memory;
Interpreting the flag stored in the memory and responding to the predetermined command;
Including
The step of storing in the memory stores a plurality of pieces of information related to a result of executing the predetermined command in the memory,
The flag specifies the priority order of a plurality of responses respectively corresponding to the plurality of information related to a result of executing the predetermined command;
The step of making a response is characterized by making a response corresponding to information related to a result of executing the predetermined command to the reader / writer based on the priority order designated by the flag.
また本発明に係る可搬記録媒体の制御プログラムは、
可搬記録媒体として動作するコンピュータに、
所定のコマンドに対応する応答を指定するフラグをデータ構造に含む該所定のコマンドをリーダライタから受信するステップと、
前記フラグをメモリに格納するステップと、
前記メモリに格納された前記フラグを解釈し、前記所定のコマンドに対する応答をするステップと、
を実行させることを特徴とする。
また本発明に係る可搬記録媒体の制御プログラムは、
可搬記録媒体として動作するコンピュータに、
所定のコマンド及び該所定のコマンドへの応答を指定するフラグをリーダライタから受信するステップと、
前記フラグをメモリに格納するステップと、
前記メモリに格納された前記フラグを解釈し、前記所定のコマンドに対する応答をするステップと、
を実行させ、
前記メモリに格納するステップは、前記所定のコマンドを実行した結果に関する複数の情報を前記メモリに格納し、
前記フラグは、前記所定のコマンドを実行した結果に関する前記複数の情報に各々対応する複数の応答の優先順位を指定し、
前記応答をするステップは、前記フラグにより指定された前記優先順位に基づき、前記リーダライタに前記所定のコマンドを実行した結果に関する情報に対応する応答をすることを特徴とする。
A control program for a portable recording medium according to the present invention includes:
To a computer that operates as a portable recording medium,
Receiving said predetermined command from the reader-writer includes a flag for designating a response corresponding to a Jo Tokoro commands in the data structure,
Storing the flag in a memory;
Interpreting the flag stored in the memory and responding to the predetermined command;
Is executed.
A control program for a portable recording medium according to the present invention includes:
To a computer that operates as a portable recording medium,
Receiving a flag designating a predetermined command and a response to the predetermined command from the reader / writer;
Storing the flag in a memory;
Interpreting the flag stored in the memory and responding to the predetermined command;
And execute
The step of storing in the memory stores a plurality of pieces of information related to a result of executing the predetermined command in the memory,
The flag specifies the priority order of a plurality of responses respectively corresponding to the plurality of information related to a result of executing the predetermined command;
The step of making a response is characterized by making a response corresponding to information related to a result of executing the predetermined command to the reader / writer based on the priority order designated by the flag.
本発明における可搬記録媒体、可搬記録媒体の制御方法、及び可搬記録媒体の制御プログラムによれば、所定のコマンドに対する可搬記録媒体の挙動を同一にし、リーダライタ等の上位装置が可搬記録媒体の挙動に合わせて複数の処理機能を実装する必要が無く、高い互換性を確保することができる。 According to the portable recording medium, the portable recording medium control method, and the portable recording medium control program of the present invention, the behavior of the portable recording medium with respect to a predetermined command is made the same, and a host device such as a reader / writer is possible. It is not necessary to implement a plurality of processing functions in accordance with the behavior of the portable recording medium, and high compatibility can be ensured.
以下、本発明の実施の形態について説明する。 Embodiments of the present invention will be described below.
(実施の形態1)
図1は本発明の実施の形態1に係る可搬記録媒体1のブロック図である。本発明の実施の形態に係る可搬記録媒体1は、非接触通信インタフェース11と、接触通信インタフェース12と、CPU13と、RAM14と、ROM15と、不揮発性メモリ16と、電源回路(図示せず)とを備える。可搬記録媒体1は好ましくはICカードであるがこれに限られない。可搬記録媒体1は、好ましくは非接触通信インタフェース11と、接触通信インタフェース12との両方を備えるが、どちらか一方のみを備える構成でもよい。
(Embodiment 1)
FIG. 1 is a block diagram of a
非接触通信インタフェース11は、無線によりリーダライタとの通信を行う通信インタフェースである。非接触通信インタフェース11は、リーダライタから所定のコマンド及び該所定のコマンドに対応する応答を指定するフラグを受信する。本実施の形態においては所定のコマンドはCREATEコマンド及び書込みコマンドである。CREATEコマンドとは、可搬記録媒体1上でファイルを生成するためのコマンドである。書込みコマンドとは、不揮発性メモリ16に、レコード構造のファイル等を書き込むためのコマンドであり、例えばUpdate Record等であるがこれに限られない。
The non-contact communication interface 11 is a communication interface that communicates with a reader / writer wirelessly. The non-contact communication interface 11 receives a flag designating a predetermined command and a response corresponding to the predetermined command from the reader / writer. In the present embodiment, the predetermined commands are a CREATE command and a write command. The CREATE command is a command for generating a file on the
接触通信インタフェース12は、リーダライタと電気的接点を介して通信を行う通信インタフェースである。接触通信インタフェース12は、カードリーダライタから所定のコマンド及び該所定のコマンドに対応する応答を指定するフラグを受信する。
The
CPU13は、非接触通信インタフェース11又は接触通信インタフェース12が受信した所定のコマンドに対応する応答を指定するフラグを、後述する不揮発性メモリ16に格納する。また、CPU13は、非接触通信インタフェース11又は接触通信インタフェース12が受信した所定のコマンドを解釈し、該コマンドに対応するプログラムを実行する。そしてCPU13は、不揮発性メモリ16に格納されたフラグを解釈し、該所定のコマンドに対応する応答、すなわち所定のSWをリーダライタに応答する。また、CPU13は演算結果をメモリに格納する機能を有する。なおここではCPU13は、中央演算処理装置(Central Processor Unit)として説明するがこれに限られず、如何なる演算装置であってもよい。
The
RAM14は、ランダムアクセスメモリであり、CPU13が実行する各種プログラムを格納したり、演算結果を一時的に保持したりする機能を有する。
The
ROM15は、CPU13が可搬記録媒体1の制御をするためのOS(オペレーティングシステム)を格納する。
The
不揮発性メモリ16は、非接触通信インタフェース11又は接触通信インタフェース12が受信したフラグを、CPU13の処理に基づき格納するメモリである。また、CPU13が所定のコマンドに対して処理を行うためのプログラム及び、データファイルが格納される。
The
図2は、本発明の実施の形態1に係る可搬記録媒体1のハードウェア24並びにROM15及び不揮発性メモリ16に備えられるプログラム及びデータの格納領域を示す概念図である。図2に示すように、ROM15には、OSが格納されるOS格納領域21が備えられる。該OS格納領域21に格納されたOSは、リーダライタから送信されるコマンドの処理機能、ファイル管理機能、カードアプリケーション及びライブラリの管理機能、アプリケーションのダウンロード機能、暗号処理機能等の、可搬記録媒体1において必要な各種基本的なソフトウェアを備える。一方、不揮発性メモリ16には、プログラム格納領域22及びデータファイル格納領域23が備えられ、各種プログラム及びデータファイルが格納される。コマンドインタフェースの下層には、ICチップ、暗号コプロセッサ25を備えるハードウェア24が備えられる。
FIG. 2 is a conceptual diagram showing program and data storage areas provided in the
図3は、可搬記録媒体1が、リーダライタから受信するコマンドのひとつであるCREATEコマンドのデータ構造を示す図である。図3に示すように、CREATEコマンドは、CLAと、INSと、P1と、P2と、Lcと、Tagと、Lenと、データ部とを備える。
FIG. 3 is a diagram illustrating a data structure of a CREATE command that is one of commands received by the
CLAとは、セキュアメッセージングの有無等を示すクラスバイトであり、例えば9Xhである。データ長は1バイトである。INSとは、可搬記録媒体1の機能を指示するための1バイトの情報であり、値がE0hである場合は、CREATEコマンドを示し、可搬記録媒体1内に格納するファイルの情報を生成する。
CLA is a class byte indicating the presence / absence of secure messaging, for example, 9Xh. The data length is 1 byte. INS is 1-byte information for instructing the function of the
P1は、1バイトの第一パラメータであり、ファイル記述バイトを示す。P1の値を基に、ファイル形式やファイル構造を決定する。P2は、1バイトの第二パラメータであるが、CREATEコマンドでは使用せず、固定値00hである。Lcは、後続のTag、Len及びデータ部の長さを示す。Lenは1バイト又は3バイトである。Tagは、FCPテンプレートを示す。なおFCPとは、ファイル制御パラメータ(File Control Parameter)であり、論理的属性、構造的属性、及びセキュリティ属性などのファイル制御用パラメータの集合である。Tagは1バイトであり、例えば“62”である。Lenは、BER(Basic Encoding Rules)−TLV(Tag・Length・Value)形式で記述される。Lenは1バイト又は3バイトである。データ部は、FCP情報に相当する部分であり、データ長は可変である。 P1 is a 1-byte first parameter indicating a file description byte. The file format and file structure are determined based on the value of P1. P2 is a 1-byte second parameter, but is not used in the CREATE command and has a fixed value of 00h. Lc indicates the length of the subsequent Tag, Len, and data portion. Len is 1 byte or 3 bytes. Tag indicates an FCP template. The FCP is a file control parameter (File Control Parameter), and is a set of file control parameters such as a logical attribute, a structural attribute, and a security attribute. Tag is 1 byte, for example, “62”. Len is described in BER (Basic Encoding Rules) -TLV (Tag, Length, Value) format. Len is 1 byte or 3 bytes. The data part is a part corresponding to the FCP information, and the data length is variable.
図4は、CREATEコマンドのデータ構造のうち、P1の内容を詳細に示すテーブルである。P1は、1バイト(8ビット)から構成され、図4に示すように右側のビットから左側のビットまで順番に、b1〜b8として定義されている。可搬記録媒体1のCPU13は、P1を解釈して、生成するファイル構造を決定する。
FIG. 4 is a table showing the details of P1 in the data structure of the CREATE command. P1 is composed of 1 byte (8 bits) and is defined as b1 to b8 in order from the right bit to the left bit as shown in FIG. The
図5は、可搬記録媒体1のCPU13が、P1を解釈して、生成するファイルの種類(形式)であるファイル構造を決定する処理フローを示す。CPU13は、当該処理フローにより決定したファイル構造のファイルを可搬記録媒体1の不揮発性メモリ16上に格納する。以下、当該フローを詳細に説明する。
FIG. 5 shows a processing flow in which the
まず可搬記録媒体1は、非接触通信インタフェース11又は接触通信インタフェース12を介して、リーダライタからコマンドを受信する(ステップS1)。続いて可搬記録媒体1のCPU13は、受信したコマンドの各部の内容を解釈し、INSの値がE0であるか否かを判定する(ステップS2)。INSの値がE0hでなければステップS3に進む。INSの値がE0hであればステップS4に進む。
First, the
INSの値がE0hでない場合、CPU13は、当該コマンドはCREATEコマンドでないと判定し、他の機能を実行する(ステップS3)。
If the value of INS is not E0h, the
一方INSの値がE0hである場合、CPU13は、当該コマンドはCREATEコマンドであると判定し、コマンドからP1を読み出す(ステップS4)。
On the other hand, if the value of INS is E0h, the
続いてCPU13は、読み出したP1のうち、b8の値が0bか否かを判定する(ステップS5)。b8の値が0bでない場合ステップS6に進む。b8の値が0bであればステップS7に進む。
Subsequently, the
b8の値が0bでない場合、CPU13は、生成するファイル構造は、独自ファイルであると判断し、当該独自ファイルを生成する(ステップS6)。その後、処理が終了する。
When the value of b8 is not 0b, the
一方、b8の値が0bである場合、CPU13は、生成するファイル構造を、他のビットb1〜b6に基づいて決定する。この場合CPU13は、b6、b5、及びb4の値が何であるかを判定する(ステップS7)。ここでは、b6、b5、及びb4のビットを3つ並べた3桁の2進数をb6b5b4と表記する。
On the other hand, when the value of b8 is 0b, the
b6b5b4の値が000bである場合、CPU13は、生成するファイル構造がWEFであると判断する(ステップS8)。なおここで000bにおける末尾のbは、2進数を意味する。
When the value of b6b5b4 is 000b, the
他方、b6b5b4の値が001bである場合、CPU13は、生成するファイル構造がIEFであると判断する(ステップS9)。またb6b5b4の値が010bである場合、CPU13は、生成するファイル構造がデータオブジェクトWEF(Simple−TLV)であると判断する(ステップS10)。またb6b5b4の値が011bである場合、CPU13は、生成するファイル構造がデータオブジェクトWEF(BER−TLV)であると判断する(ステップS11)。またb6b5b4の値が111bである場合、CPU13は、生成するファイル構造がDFであると判断する(ステップS12)。b6b5b4の値がこれら以外の場合、P1の値が異常であるとして、CPU13はエラーと判断し(ステップS13)、SWとしてエラーをリーダライタに応答する(ステップS14)。すなわちCPU13は、規定されていないファイル形式、ファイル構造を示す値を読み出した場合は、P1に係るエラーと判断する。
On the other hand, if the value of b6b5b4 is 001b, the
b6b5b4の値が000b、001b、010b、又は011bの場合は、続いてステップS14に進む。該ステップにおいてCPU13は、b3b2b1の値が何であるかを判定する(ステップS15)。
When the value of b6b5b4 is 000b, 001b, 010b, or 011b, the process proceeds to step S14. In this step, the
b3b2b1の値が000bである場合、CPU13は、ファイル構造の詳細として、透過構造であると判断し、当該透過構造ファイルを生成する(ステップS16)。また、b3b2b1の値が001bである場合、CPU13は、ファイル構造の詳細として、固定長順編成(BER−TLV)であると判断し、当該固定長順編成ファイルを生成する(ステップS17)。また、b3b2b1の値が011bである場合、CPU13は、ファイル構造の詳細として、固定長順編成(Simple−TLV)であると判断し、当該固定長順編成ファイルを生成する(ステップS18)。また、b3b2b1の値が100bである場合、CPU13は、ファイル構造の詳細として、可変長順編成(BER)であると判断し、当該可変長順編成ファイルを生成する(ステップS19)。また、b3b2b1の値が101bである場合、CPU13は、ファイル構造の詳細として、可変長順編成(Simple−TLV)であると判断し、当該可変長順編成ファイルを生成する(ステップS20)。また、b3b2b1の値が110bである場合、CPU13は、ファイル構造の詳細として、固定長循環順編成(BER−TLV)であると判断し、当該固定長循環順編成ファイルを生成する(ステップS21)。また、b3b2b1の値が111bである場合、CPU13は、ファイル構造の詳細として、固定長循環順編成(Simple−TLV)であると判断し、当該固定長循環順編成ファイルを生成する(ステップS22)。b3b2b1の値がこれら以外の場合、P1の値が異常であるとして、CPU13はエラーと判断し(ステップS23)、当該エラーを示すSWを、リーダライタに応答する(ステップS24)。
If the value of b3b2b1 is 000b, the
なお、ファイル構造がデータオブジェクトWEF(Simple−TLV)である場合には、ファイル構造の詳細として、透過構造、固定長順編成(Simple−TLV)、可変長順編成(Simple−TLV)、又は固定長循環順編成(Simple−TLV)の4パターンのみをとる。また、ファイル構造がデータオブジェクトWEF(BER−TLV)である場合には、ファイル構造の詳細として、透過構造、固定長順編成(BER)、可変長順編成(BER−TLV)、又は固定長循環順編成(BER−TLV)の4パターンのみをとる。 When the file structure is the data object WEF (Simple-TLV), the details of the file structure include a transparent structure, fixed-length sequential organization (Simple-TLV), variable-length sequential organization (Simple-TLV), or fixed. Only 4 patterns of long circulation sequential organization (Simple-TLV) are taken. When the file structure is a data object WEF (BER-TLV), the details of the file structure include a transparent structure, fixed-length sequential organization (BER), variable-length sequential organization (BER-TLV), or fixed-length circulation. Only 4 patterns of sequential organization (BER-TLV) are taken.
図6は、可搬記録媒体1が、リーダライタから受信するCREATEコマンドのデータ構造のうち、データ部の内容を詳細に示す図である。図6に示すように、データ部は、EFIDと、セキュリティ属性と、セキュアメッセージング属性と、レコード構造又はデータオブジェクト構造と、フラグとを備える。EFIDには、ファイルIDが格納され、データ長は2バイトである。セキュリティ属性には、セキュリティの属性を示すデータを設定する情報が格納され、データ長は12バイトである。セキュアメッセージング属性には、セキュアメッセージングの属性を示すデータを設定する情報が格納され、データ長は1バイトである。形式指定情報には、レコード構造又はデータオブジェクト構造の形式を指定する情報が格納され、データ長は4バイトである。フラグには、書込みによりブロックの空きが無くなった場合、警告をするか否かを示すデータが格納され、データ長は1バイトである。
FIG. 6 is a diagram showing in detail the contents of the data portion of the data structure of the CREATE command received by the
ここでフラグとは、可搬記録媒体1が、リーダライタから受信したコマンドに対し、カードリーダライタに応答するSWを指定するデータである。フラグの値は、カードリーダライタ及びその上位装置に係るアプリケーションにより一意に定められる。図6におけるフラグは、書込みコマンドを受信した場合でかつ書込みによりブロックの空きが無くなった場合に警告するか否かを示すフラグである。フラグが00bの場合、可搬記録媒体1は、SWを9000hとして応答する。すなわちフラグが00bの場合には、可搬記録媒体1は、リーダライタに警告しない。一方、フラグが01bの場合、可搬記録媒体1は、SWと6381hとして応答する。すなわちフラグが01bの場合には可搬記録媒体1はリーダライタに警告する。
Here, the flag is data that designates an SW that responds to the card reader / writer in response to a command received by the
図7は、CPU13が、CREATEコマンドにおけるフラグを不揮発性メモリ16に格納する際の動作を示すフローチャートである。以下詳細に当該フローチャートを説明する。
FIG. 7 is a flowchart showing the operation when the
まず可搬記録媒体1のCPU13は、CREATEコマンドにおけるデータ部のうち、“形式指定情報”の値を読み出す(ステップS101)。続いて可搬記録媒体1のCPU13は、CREATEコマンドにおけるデータ部のうち、フラグの値を読み出す(ステップS102)。
First, the
続いてCPU13は、読み出したフラグの値が何であるかを判定する(ステップS103)。CPU13は、当該フラグの値に基づき、書込みの際にブロックの空きが無くなった場合、リーダライタに警告するか否かを決定する。
Subsequently, the
フラグが00bであった場合、CPU13は、SWとして9000hをカードリーダライタに応答するフラグを不揮発性メモリ16に書き込むものと判断する(ステップS104)。続いて、CPU13は、ステップS101で読み出したレコード構造に基づき、所定のレコード構造のファイルを不揮発性メモリ16の所定のエリアに書き込む(ステップS105)。続いてCPU13は、ステップS102で読み出したフラグを、不揮発性メモリ16に書込み(ステップS106)、処理が終了する。
When the flag is 00b, the
フラグが01bであった場合、CPU13は、SWとして6381hをリーダライタに応答するフラグを不揮発性メモリ16に書き込むものと判断する(ステップS107)。続いてCPU13は、ステップS101で読み出したレコード構造に基づき、所定のレコード構造のファイルを不揮発性メモリ16の所定のエリアに書き込む(ステップS108)。続いてCPU13は、ステップS102で読み出したフラグを、不揮発性メモリ16に書込み(ステップS109)、処理が終了する。
When the flag is 01b, the
フラグが00b、01bのいずれでもない場合、CPU13はエラーと判断する(ステップS110)。そしてCPU13は、CREATEコマンドのエラーを示すSWをリーダライタに応答し(ステップS111)、処理が終了する。
If the flag is neither 00b nor 01b, the
図8は、このようにして可搬記録媒体1のCPU13によりフラグ及びプログラムが格納された不揮発性メモリ16の概念図を示す。
FIG. 8 is a conceptual diagram of the
不揮発性メモリ16の先頭のメモリアドレス00000001には、メモリ管理情報が格納される。当該領域をメモリ管理情報格納領域という。メモリ管理情報は、ブロックの空き状況に係る情報を含む。ブロックの空き状況に係る情報は、各ブロックに割り当てられたレコード番号及び空き状況に係るステータスにより構成される。レコード番号は一意にレコードを識別する番号である。空き状況に係るステータスは、“未書込”又は“書込済”である。“未書込”とは、当該ブロックにレコード構造のファイルが格納されていないことを意味する。“書込済”とは、当該ブロックにレコード構造のファイルが格納されていることを意味する。レコード構造のファイルが格納されていないブロックを空きブロックという。
Memory management information is stored at the
図8のメモリアドレス00000002には、可搬記録媒体1が受信したCREATEコマンドに基づくレコード構造のファイルが格納される。
8 stores a file having a record structure based on the CREATE command received by the
メモリアドレス00000003〜メモリアドレス1000FFFCには、該レコード構造のファイルを格納できるアドレス空間が備えられる。該アドレス空間が、ブロックに対応する。
The
メモリアドレス1000FFFD〜メモリアドレス1000FFFEには、プログラム格納領域22が備えられる。CPU13は、システム動作時に、予め書込み時のブロックの空き状況に応じて所定のSWをリーダライタに応答するプログラムを格納している。なお、不揮発性メモリ16の代わりにROM15にプログラム格納領域22を設け、当該ROM15に設けられたプログラム格納領域22に、書込み後のブロックの空き状況に応じて所定のSWをリーダライタに応答するプログラムを格納してもよい。
A memory area 1000FFFD to a memory address 1000FFFE are provided with a
メモリアドレス1000FFFFには、プログラム格納領域22に格納されたプログラムに関するフラグ設定エリアが備えられている。CPU13は、当該フラグ設定エリアに、CREATEコマンドから読み出したフラグを格納する。
The memory address 1000FFFF is provided with a flag setting area related to the program stored in the
図9Aは、メモリ管理情報の一例を示す。図9Aに示すメモリ管理情報では、レコード番号001〜003に係るブロックのステータスがいずれも書込済であり、レコード番号004に係るブロックのステータスは未書込である。
FIG. 9A shows an example of memory management information. In the memory management information shown in FIG. 9A, the statuses of the blocks related to the
次に、本発明の実施の形態1に係る可搬記録媒体1について、図10に示すフローチャートによりその動作を説明する。なお、図7の動作フローにより、可搬記録媒体1の不揮発性メモリ16には所定のフラグが格納されているものとする。
Next, the operation of the
はじめに、可搬記録媒体1は、非接触通信インタフェース11又は接触通信インタフェース12を介して、リーダライタから書込みコマンドを受信する(ステップS120)。
First, the
続いて、可搬記録媒体1のCPU13は、不揮発性メモリ16から、書込みコマンド用のプログラム及びフラグ設定エリアに格納されたフラグを取得する(ステップS121)。当該フラグを解釈し、CPU13は、不揮発性メモリ16の空きブロックが無くなった場合の処理方法を確定する。
Subsequently, the
続いてCPU13は、不揮発性メモリ16に格納されたメモリ管理情報を取得する(ステップS122)。そしてCPU13は、メモリ管理情報に基づき、不揮発性メモリ16に空きブロックがあるか否かを判定する(ステップS123)。不揮発性メモリ16に空きブロックが無い場合、ステップS124に進む。不揮発性メモリ16に空きブロックがある場合、ステップS125に進む。
Subsequently, the
不揮発性メモリ16に空きブロックが無い場合、書込みができないため、CPU13は、非接触通信インタフェース11又は接触通信インタフェース12を介して、エラーをリーダライタに応答する(ステップS124)。そして処理が終了する。
If there is no empty block in the
一方、不揮発性メモリ16に空きブロックがある場合、CPU13は、書込みコマンド用のプログラムを用いて、所望のレコード構造のファイルを不揮発性メモリ16に書き込む(ステップS125)。続いて、CPU13は、不揮発性メモリ16に格納されているメモリ管理情報を更新する(ステップS126)。具体的にはCPU13は、所望のレコード構造のファイルを書き込んだレコード番号に係るステータスを、“未書込”から“書込済”に変更する。例えばメモリ管理情報格納領域に、図9Aに示すメモリ管理情報が格納されている場合、レコード番号004が空きブロックであるため、CPU13は、当該ブロックに所望のレコード構造のファイルを書き込む。そして書き込んだ後に、CPU13は、レコード番号004のステータスを、“書込済”に変更し、メモリ管理情報を更新する。図9Bは、更新後のメモリ管理情報を示す。
On the other hand, when there is an empty block in the
続いてCPU13は、不揮発性メモリ16に空きブロックがあるか否かを判定する(ステップS127)。不揮発性メモリ16に空きブロックがある場合、ステップS128に進む。不揮発性メモリ16に空きブロックが無い場合、ステップS129に進む。例えば図9Bに示す更新後のメモリ管理情報に基づき本ステップS127における判定をした場合、不揮発性メモリ16に空きブロックが無いため、ステップS129に進む。
Subsequently, the
不揮発性メモリ16に空きブロックがある場合、CPU13は、非接触通信インタフェース11又は接触通信インタフェース12を介して、リーダライタに正常終了として応答、すなわちSWとして9000hを応答し(ステップS128)、処理が終了する。
When there is an empty block in the
一方、不揮発性メモリ16に空きブロックが無い場合、CPU13は、ステップS111において取得したフラグが、SWとして9000hをリーダライタに応答するフラグであるか否かを判定する(ステップS129)。
On the other hand, when there is no empty block in the
判定の結果、取得したフラグがSWとして9000hをカードリーダライタに応答するフラグの場合、CPU13は、非接触通信インタフェース11又は接触通信インタフェース12を介して、リーダライタに正常終了として応答、すなわちSWとして9000hをリーダライタに応答する(ステップS130)。一方、SWとして9000hをリーダライタに応答するフラグでない場合、すなわちSWとして6381hをリーダライタに応答するフラグである場合、CPU13は、非接触通信インタフェース11又は接触通信インタフェース12を介して、リーダライタに警告終了として応答、すなわちSWとして6381hを応答し(ステップS131)、処理が終了する。
As a result of the determination, if the acquired flag is a flag for responding 9000h to the card reader / writer as SW, the
このように本発明によれば、リーダライタ及びその上位機種に係るアプリケーションにより一意に定められるフラグによって所定のコマンドである書込みコマンドに対する可搬記録媒体1の挙動を同一にしているため、リーダライタ等の上位装置が可搬記録媒体1の挙動に合わせて複数の処理機能を実装する必要が無く、高い互換性を確保することができる。
As described above, according to the present invention, the behavior of the
(実施の形態2)
以下に、本発明の実施の形態2について説明をする。実施の形態2に係る可搬記録媒体1の構成は実施の形態1と同一であるが、実施の形態2に係る可搬記録媒体1は、非接触通信インタフェース11又は接触通信インタフェース12を介して、所定のコマンドとして受信するコマンドがCREATEコマンド及びPUT DATAコマンドである点が相違する。
(Embodiment 2)
The second embodiment of the present invention will be described below. The configuration of the
図11は、CPU13が、CREATEコマンドにおけるフラグを不揮発性メモリ16に格納する際の動作を示すフローチャートである。以下詳細に当該フローチャートを説明する。実施の形態1と同一の動作については同一の符号を付し、説明は省略する。
FIG. 11 is a flowchart showing an operation when the
ステップS102の後に、CPU13は、読み出したフラグの値が何であるかを判定する(ステップS203)。CPU13は、当該フラグの値に基づき、PUT DATAコマンドがリーダライタから送信された場合に、不揮発性メモリ16に一度書き込まれたデータオブジェクトを更新することを許容するか否かを確定する。
After step S102, the
CREATEコマンドにおけるフラグが00bであった場合、CPU13は、SWとして9000hをリーダライタに応答するフラグを不揮発性メモリ16に書き込むものと判断する(ステップS204)。続いて、CPU13は、ステップS101で読み出したデータオブジェクト構造に基づき、所定のデータオブジェクト構造のファイルを不揮発性メモリ16の所定のエリアに書き込む(ステップS205)。続いてCPU13は、ステップS102で読み出したフラグを、不揮発性メモリ16に書込み(ステップS206)、処理が終了する。
When the flag in the CREATE command is 00b, the
フラグが01bであった場合、CPU13は、SWとして6985hをリーダライタに応答するフラグを不揮発性メモリ16に書き込むものと判断する(ステップS207)。続いてCPU13は、ステップS101で読み出したレコード構造に基づき、所定のデータオブジェクト構造のファイルを不揮発性メモリ16の所定のエリアに書き込む(ステップS208)。続いてCPU13は、ステップS102で読み出したフラグを、不揮発性メモリ16に書込み(ステップS209)、処理が終了する。
When the flag is 01b, the
フラグが00b、01bのいずれでもない場合、CPU13はエラーと判断する(ステップS210)。そしてCPU13は、CREATEコマンドのエラーを示すSWをリーダライタに応答し(ステップS211)、処理が終了する。
If the flag is neither 00b nor 01b, the
次に、本発明の実施の形態2に係る可搬記録媒体1について、図12に示すフローチャートによりその動作を説明する。なお、図11の動作フローにより、可搬記録媒体1の不揮発性メモリ16には所定のフラグが格納されているものとする。
Next, the operation of the
はじめに、可搬記録媒体1は、非接触通信インタフェース11又は接触通信インタフェース12を介して、リーダライタから所定のコマンドとして、PUT DATAコマンドを受信する(ステップS220)。
First, the
続いて、可搬記録媒体1のCPU13は、不揮発性メモリ16から、PUT DATAコマンド用のプログラム及びフラグ設定エリアに格納されたフラグを取得する(ステップS221)。当該フラグを解釈し、CPU13は、PUT DATAコマンドがリーダライタから送信された場合に、不揮発性メモリ16に一度書き込まれたデータオブジェクトを更新することを許容するか否かを確定する。
Subsequently, the
続いて、CPU13は、ステップS221において取得したフラグが、PUT DATAコマンド実行時のSWとして9000hをリーダライタに応答するフラグであるか否かを判定する(ステップS222)。
Subsequently, the
判定の結果、取得したフラグが、PUT DATA実行時におけるデータオブジェクト更新時のSWとして9000hをカードリーダライタに応答するフラグの場合、CPU13は、データオブジェクトを更新する(ステップS223)。そしてCPU13は、非接触通信インタフェース11又は接触通信インタフェース12を介して、リーダライタに正常終了として応答、すなわちSWとして9000hをリーダライタに応答する(ステップS224)。
As a result of the determination, when the acquired flag is a flag for responding 9000h to the card reader / writer as the SW at the time of updating the data object at the time of executing the PUT DATA, the
一方、PUT DATA実行時におけるデータオブジェクト更新時のSWとして9000hをリーダライタに応答するフラグでない場合、すなわちSWとして6985hをカードリーダライタに応答するフラグである場合、CPU13は、非接触通信インタフェース11又は接触通信インタフェース12を介して、リーダライタに異常終了として応答、すなわちSWとして6985hをリーダライタに応答し(ステップS225)、処理が終了する。
On the other hand, when 9000h is not a flag that responds to the reader / writer as the SW when updating the data object at the time of PUT DATA execution, that is, when SW is 6985h as a flag that responds to the card reader / writer, the CPU 13 A response is sent to the reader / writer as abnormal termination via the
このように本発明によれば、リーダライタ及びその上位機種に係るアプリケーションにより一意に定められるフラグによって所定のコマンドであるPUT DATAコマンドに対する可搬記録媒体1の挙動を同一にしているため、リーダライタ等の上位装置が可搬記録媒体1の挙動に合わせて複数の処理機能を実装する必要が無く、高い互換性を確保することができる。
As described above, according to the present invention, the behavior of the
(実施の形態3)
以下に、本発明の実施の形態3について説明をする。実施の形態3に係る可搬記録媒体1の構成は実施の形態1と同一であるが、実施の形態3に係る可搬記録媒体1は、非接触通信インタフェース11又は接触通信インタフェース12を介して、所定のコマンドとして受信するコマンドがKEY REPLACEコマンドである点が相違する。
(Embodiment 3)
The third embodiment of the present invention will be described below. Although the configuration of the
図13は、可搬記録媒体1が、リーダライタから受信するコマンドのひとつであるKEY REPLACEコマンドのデータ構造及びデータ構造の各項目の説明を示す図である。KEY REPLACEコマンドとは、可搬記録媒体1内においてデータの暗号化及び復号に用いられる鍵を、新規の鍵に置き換えるためのコマンドである。図13に示すように、KEY REPLACEコマンドは、CLAと、INSと、P1と、P2と、Lcと、データと、Leとを備える。
FIG. 13 is a diagram illustrating the data structure of the KEY REPLACE command, which is one of the commands received from the reader / writer by the
CLAは、KEY REPLACEコマンドの場合00hである。INSは、KEY REPLACEコマンドの場合、F1hである。 CLA is 00h for the KEY REPLACE command. INS is F1h for the KEY REPLACE command.
P1は、2バイトの第一パラメータであり、現在の鍵のバージョンを示す。例えばP1は、0002hである。P2は、2バイトの第二パラメータであり、鍵IDを示す。例えばP2は、010Ahである。Lcは後続のデータ部及びLeのデータ長を示す。データ部は、先頭の2バイト長のフラグと、フラグに後続する2バイト長の新規鍵のバージョン番号と、新規鍵のバージョン番号に後続する16バイト長の鍵データ本体とを備える。例えば、フラグが0002h、新規鍵のバージョン番号が0003h、鍵データ本体が873A047AF5862BB16422101C859D867F34hの場合、データ部は、0002|0003|873A047AF5862BB16422101C859D867F34hである。Leは1バイトのデータであり、例えば00hである。 P1 is a 2-byte first parameter indicating the current key version. For example, P1 is 0002h. P2 is a 2-byte second parameter and indicates a key ID. For example, P2 is 010 Ah. Lc indicates the data length of the subsequent data part and Le. The data portion includes a leading 2-byte length flag, a 2-byte long new key version number following the flag, and a 16-byte key data body following the new key version number. For example, if the flag is 0002h, the new key version number is 0003h, and the key data body is 873A047AF5862BB1642101C859D867F34h, the data portion is 0002 | 0003 | 873A047AF5862BB1642101C859D867F34h. Le is 1-byte data, for example, 00h.
図14は、可搬記録媒体1が、リーダライタからKEY REPLACEコマンドを受信した後に、鍵置き換えに係る複数のエラー事象が発生した場合の該複数のエラー事象の優先順位とフラグとの関係を示すテーブルである。ここで、可搬記録媒体1において、鍵置き換えに係るエラー事象が複数生じた場合、可搬記録媒体1のCPU13は、該複数のエラー事象のうち、最も優先順位の高いエラー事象に係る応答をカードリーダライタに対して送信する。すなわち、KEY REPLACEコマンドに対応する応答としては複数の応答があり、CPU13は、複数の応答のうち最も優先順位の高い応答をリーダライタに対して送信する。
FIG. 14 shows the relationship between the priorities of the plurality of error events and the flags when a plurality of error events related to key replacement occur after the
しかしながら実装によってこの優先順位は異なる。そこで実施の形態3においては、フラグにより、可搬記録媒体1におけるエラー事象の優先順位を指定し、所定の優先順位に統一する。なおフラグの値は、リーダライタ及びその上位機種に係るアプリケーションにより一意に定められる。
However, this priority varies depending on the implementation. Therefore, in the third embodiment, the priority order of error events in the
例えばフラグが0001hの場合、該エラー事象のうち、“新規鍵のデータ長が正しくない”というエラー事象及びその応答の優先順位を、最高の優先順位である1番に指定する。なお図14中、優先順位が1番であることを(1)として表記している。また、エラー事象のうち、“Lcの値が正しくない”というエラー事象及びその応答の優先順位を2番に指定する。同様に当該優先順位は(2)として表記している。他のエラー事象についても同様に図14に示す通り、それぞれ3番目の優先順位から9番目の優先順位まで、(3)〜(9)として表記し、各エラー事象及びその応答に付与している。ここで、フラグが0001hの場合の優先順位を、第1の優先順位と呼ぶ。同様にフラグが0002h、0003h、0004h、及び0005hの場合も、各エラー事象及びその応答に優先順位を付与し、当該優先順位を、それぞれ第2の優先順位、第3の優先順位、第4の優先順位、及び第5の優先順位と呼ぶ。
For example, when the flag is 0001h, among the error events, the error event “the data length of the new key is not correct” and the priority of the response are designated as the
図15は、CPU13が、KEY REPLACEコマンドにおけるフラグを不揮発性メモリ16に格納する際の動作を示すフローチャートである。以下詳細に当該フローチャートを説明する。
FIG. 15 is a flowchart showing an operation when the
まず可搬記録媒体1のCPU13は、KEY REPLACEコマンドにおけるデータ部のうち、フラグの値を読み出す(ステップS301)。
First, the
続いてCPU13は、読み出したフラグの値が何であるかを判定する(ステップS302)。CPU13は、当該フラグの値に基づき、エラー事象及び応答の優先順位を確定する。
Subsequently, the
フラグが0001hであった場合、CPU13は、第1の優先順位に係るフラグを不揮発性メモリ16に書き込むものと判断する(ステップS303)。続いてCPU13は、ステップS301で読み出したフラグを、不揮発性メモリ16に書込み(ステップS304)、処理が終了する。
When the flag is 0001h, the
フラグが0002hであった場合、CPU13は、第2の優先順位に係るフラグを不揮発性メモリ16に書き込むものと判断する(ステップS305)。続いてCPU13は、ステップS301で読み出したフラグを、不揮発性メモリ16に書込み(ステップS306)、処理が終了する。
When the flag is 0002h, the
フラグが0003hであった場合、CPU13は、第3の優先順位に係るフラグを不揮発性メモリ16に書き込むものと判断する(ステップS307)。続いてCPU13は、ステップS301で読み出したフラグを、不揮発性メモリ16に書込み(ステップS308)、処理が終了する。
When the flag is 0003h, the
フラグが0004hであった場合、CPU13は、第4の優先順位に係るフラグを不揮発性メモリ16に書き込むものと判断する(ステップS309)。続いてCPU13は、ステップS301で読み出したフラグを、不揮発性メモリ16に書込み(ステップS3010)、処理が終了する。
When the flag is 0004h, the
フラグが0005hであった場合、CPU13は、第5の優先順位に係るフラグを不揮発性メモリ16に書き込むものと判断する(ステップS311)。続いてCPU13は、ステップS301で読み出したフラグを、不揮発性メモリ16に書込み(ステップS312)、処理が終了する。
When the flag is 0005h, the
フラグが0001h、0002h、0003h、0004h、及び0005hのいずれでもない場合、CPU13はエラーと判断する(ステップS313)。そしてCPU13は、KEY REPLACEコマンドのエラーを示すSWをリーダライタに応答し(ステップS314)、処理が終了する。
If the flag is not any of 0001h, 0002h, 0003h, 0004h, and 0005h, the
次に、本発明の実施の形態3に係る可搬記録媒体1について、図16に示すフローチャートによりその動作を説明する。なお、図15の動作フローにより、可搬記録媒体1の不揮発性メモリ16には所定のフラグが格納されているものとする。
Next, the operation of the
はじめに、可搬記録媒体1において、鍵置き換えに係るエラー事象が複数発生する(ステップS320)。このとき、可搬記録媒体1のCPU13は、当該複数エラー事象を示す情報を、メモリ内に保持する(ステップS321)。すなわちCPU13は、所定のコマンドを実行した結果に関する複数の情報をメモリに格納する。
First, a plurality of error events related to key replacement occur in the portable recording medium 1 (step S320). At this time, the
次に、可搬記録媒体1のCPU13は、不揮発性メモリ16に格納されたフラグを取得する(ステップS322)。当該フラグを解釈し、CPU13は、エラー事象及びその応答の優先順位を確定する。
Next, the
続いて、CPU13は、ステップS322において取得したフラグが何であるかを判定する(ステップS323)。
Subsequently, the
判定の結果、取得したフラグが0001hである場合、CPU13は、エラー事象が複数発生した場合に、非接触通信インタフェース11又は接触通信インタフェース12を介して、第1の優先順位に基づき、発生した複数のエラー事象のうち最も優先順位の高いエラー事象を、メモリ内に保持されている当該複数エラー事象を示すデータの中から選択し、当該最も優先順位の高いエラー事象に対応するSWをリーダライタに応答する(ステップS324)。
As a result of the determination, if the acquired flag is 0001h, the
判定の結果、取得したフラグが0002hである場合、CPU13は、エラー事象が複数発生した場合に、非接触通信インタフェース11又は接触通信インタフェース12を介して、第2の優先順位に基づき、発生した複数のエラー事象のうち最も優先順位の高いエラー事象を、メモリ内に保持されている当該複数エラー事象を示すデータの中から選択し、当該最も優先順位の高いエラー事象に対応するSWをリーダライタに応答する(ステップS325)。
As a result of the determination, when the acquired flag is 0002h, the
判定の結果、取得したフラグが0003hである場合、CPU13は、エラー事象が複数発生した場合に、非接触通信インタフェース11又は接触通信インタフェース12を介して、第3の優先順位に基づき、発生した複数のエラー事象のうち最も優先順位の高いエラー事象を、メモリ内に保持されている当該複数エラー事象を示すデータの中から選択し、当該最も優先順位の高いエラー事象に対応するSWをリーダライタに応答する(ステップS326)。
As a result of the determination, when the acquired flag is 0003h, the
判定の結果、取得したフラグが0004hである場合、CPU13は、エラー事象が複数発生した場合に、非接触通信インタフェース11又は接触通信インタフェース12を介して、第4の優先順位に基づき、発生した複数のエラー事象のうち最も優先順位の高いエラー事象を、メモリ内に保持されている当該複数エラー事象を示すデータの中から選択し、当該最も優先順位の高いエラー事象に対応するSWをリーダライタに応答する(ステップS327)。
As a result of the determination, when the acquired flag is 0004h, the
判定の結果、取得したフラグが0005hである場合、CPU13は、エラー事象が複数発生した場合に、非接触通信インタフェース11又は接触通信インタフェース12を介して、第5の優先順位に基づき、発生した複数のエラー事象のうち最も優先順位の高いエラー事象を、メモリ内に保持されている当該複数エラー事象を示すデータの中から選択し、当該最も優先順位の高いエラー事象に対応するSWをリーダライタに応答する(ステップS328)。
As a result of the determination, when the acquired flag is 0005h, the
SWをリーダライタに応答した後、CPU13は、当該複数エラー事象を示す情報を、メモリから削除する。(ステップS329)
After responding SW to the reader / writer, the
このように本発明によれば、リーダライタ及びその上位機種に係るアプリケーションにより一意に定められるフラグによって所定のコマンドであるKEY REPLACEコマンドに関する可搬記録媒体1の挙動を同一にしているため、リーダライタ等の上位装置が可搬記録媒体1の挙動に合わせて複数の処理機能を実装する必要が無く、高い互換性を確保することができる。
As described above, according to the present invention, the behavior of the
ここで、可搬記録媒体1として機能させるために、コンピュータを好適に用いることができ、そのようなコンピュータは、可搬記録媒体1の各機能を実現する処理内容を記述したプログラムを、当該コンピュータの記憶部に格納しておき、当該コンピュータの中央演算処理装置によってこのプログラムを読み出して実行させることで実現することができる。
Here, in order to function as the
本発明を諸図面や実施例に基づき説明してきたが、当業者であれば本開示に基づき種々の変形や修正を行うことが容易であることに注意されたい。したがって、これらの変形や修正は本発明の範囲に含まれることに留意されたい。例えば、各手段、各ステップ等に含まれる機能等は論理的に矛盾しないように再配置可能であり、複数の手段やステップ等を1つに組み合わせたり、或いは分割したりすることが可能である。 Although the present invention has been described based on the drawings and examples, it should be noted that those skilled in the art can easily make various modifications and corrections based on the present disclosure. Therefore, it should be noted that these variations and modifications are included in the scope of the present invention. For example, the functions included in each means, each step, etc. can be rearranged so that there is no logical contradiction, and a plurality of means, steps, etc. can be combined or divided into one. .
1 可搬記録媒体
11 非接触通信インタフェース
12 接触通信インタフェース
13 CPU
14 RAM
15 ROM
16 不揮発性メモリ
21 OS格納領域
22 プログラム格納領域
23 データファイル格納領域
24 ハードウェア
25 暗号コプロセッサ
DESCRIPTION OF
14 RAM
15 ROM
16
Claims (6)
前記フラグを格納するメモリと、
前記メモリに格納された前記フラグを解釈し、前記リーダライタに前記所定のコマンドに対応する応答をする演算装置と、
を有することを特徴とする可搬記録媒体。 A communication interface for receiving said predetermined command from the reader-writer includes a flag for designating a response corresponding to a Jo Tokoro commands in the data structure,
A memory for storing the flag;
An arithmetic unit that interprets the flag stored in the memory and responds to the reader / writer in response to the predetermined command;
A portable recording medium comprising:
前記フラグを格納するメモリと、
前記メモリに格納された前記フラグを解釈し、前記リーダライタに前記所定のコマンドに対応する応答をする演算装置と、
を有し、
前記メモリは、前記所定のコマンドを実行した結果に関する複数の情報を格納し、
前記フラグは、前記所定のコマンドを実行した結果に関する前記複数の情報に各々対応する複数の応答の優先順位を指定し、
前記演算装置は、前記フラグにより指定された前記優先順位に基づき、前記リーダライタに前記所定のコマンドを実行した結果に関する情報に対応する応答をすることを特徴とする可搬記録媒体。 A communication interface for receiving from the reader / writer a flag designating a predetermined command and a response corresponding to the predetermined command;
A memory for storing the flag;
An arithmetic unit that interprets the flag stored in the memory and responds to the reader / writer in response to the predetermined command;
Have
The memory stores a plurality of pieces of information related to a result of executing the predetermined command,
The flag specifies the priority order of a plurality of responses respectively corresponding to the plurality of information related to a result of executing the predetermined command;
The arithmetic unit, based on said specified the priority by a flag, the portable recording medium characterized in that the response corresponding to the information about the result of executing the reader writer to the predetermined command.
前記フラグをメモリに格納するステップと、
前記メモリに格納された前記フラグを解釈し、前記所定のコマンドに対する応答をするステップと、
を含む可搬記録媒体の制御方法。 Receiving said predetermined command from the reader-writer includes a flag for designating a response corresponding to a Jo Tokoro commands in the data structure,
Storing the flag in a memory;
Interpreting the flag stored in the memory and responding to the predetermined command;
A method for controlling a portable recording medium including:
前記フラグをメモリに格納するステップと、
前記メモリに格納された前記フラグを解釈し、前記所定のコマンドに対する応答をするステップと、
を含み、
前記メモリに格納するステップは、前記所定のコマンドを実行した結果に関する複数の情報を前記メモリに格納し、
前記フラグは、前記所定のコマンドを実行した結果に関する前記複数の情報に各々対応する複数の応答の優先順位を指定し、
前記応答をするステップは、前記フラグにより指定された前記優先順位に基づき、前記リーダライタに前記所定のコマンドを実行した結果に関する情報に対応する応答をすることを特徴とする可搬記録媒体の制御方法。 Receiving a flag designating a predetermined command and a response to the predetermined command from the reader / writer;
Storing the flag in a memory;
Interpreting the flag stored in the memory and responding to the predetermined command;
Including
The step of storing in the memory stores a plurality of pieces of information related to a result of executing the predetermined command in the memory,
The flag specifies the priority order of a plurality of responses respectively corresponding to the plurality of information related to a result of executing the predetermined command;
The step of the response, based on said specified the priority by a flag, a portable recording medium you characterized in that the response corresponding to the information about the execution result of the predetermined command to the reader writer Control method.
所定のコマンドに対応する応答を指定するフラグをデータ構造に含む該所定のコマンドをリーダライタから受信するステップと、
前記フラグをメモリに格納するステップと、
前記メモリに格納された前記フラグを解釈し、前記所定のコマンドに対する応答をするステップと、
を実行させるための可搬記録媒体の制御プログラム。 To a computer that operates as a portable recording medium,
Receiving said predetermined command from the reader-writer includes a flag for designating a response corresponding to a Jo Tokoro commands in the data structure,
Storing the flag in a memory;
Interpreting the flag stored in the memory and responding to the predetermined command;
A portable recording medium control program for executing
所定のコマンド及び該所定のコマンドへの応答を指定するフラグをリーダライタから受信するステップと、
前記フラグをメモリに格納するステップと、
前記メモリに格納された前記フラグを解釈し、前記所定のコマンドに対する応答をするステップと、
を実行させ、
前記メモリに格納するステップは、前記所定のコマンドを実行した結果に関する複数の情報を前記メモリに格納し、
前記フラグは、前記所定のコマンドを実行した結果に関する前記複数の情報に各々対応する複数の応答の優先順位を指定し、
前記応答をするステップは、前記フラグにより指定された前記優先順位に基づき、前記リーダライタに前記所定のコマンドを実行した結果に関する情報に対応する応答をすることを特徴とする可搬記録媒体の制御プログラム。 To a computer that operates as a portable recording medium,
Receiving a flag designating a predetermined command and a response to the predetermined command from the reader / writer;
Storing the flag in a memory;
Interpreting the flag stored in the memory and responding to the predetermined command;
And execute
The step of storing in the memory stores a plurality of pieces of information related to a result of executing the predetermined command in the memory,
The flag specifies the priority order of a plurality of responses respectively corresponding to the plurality of information related to a result of executing the predetermined command;
Step, based on the priority specified by the flag, before the portable recording medium characterized in that the response corresponding to the information about the execution result of the predetermined command to cut Daraita to the response Control program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2011256295A JP5689050B2 (en) | 2011-11-24 | 2011-11-24 | Portable recording medium, portable recording medium control method, and portable recording medium control program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2011256295A JP5689050B2 (en) | 2011-11-24 | 2011-11-24 | Portable recording medium, portable recording medium control method, and portable recording medium control program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2013109714A JP2013109714A (en) | 2013-06-06 |
JP5689050B2 true JP5689050B2 (en) | 2015-03-25 |
Family
ID=48706373
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2011256295A Active JP5689050B2 (en) | 2011-11-24 | 2011-11-24 | Portable recording medium, portable recording medium control method, and portable recording medium control program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5689050B2 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP6862734B2 (en) * | 2016-09-20 | 2021-04-21 | 凸版印刷株式会社 | Storage medium device and program |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH089795Y2 (en) * | 1986-03-28 | 1996-03-21 | シチズン時計株式会社 | IC card |
JPH05301425A (en) * | 1992-04-27 | 1993-11-16 | Ricoh Co Ltd | Image forming apparatus |
JP3480746B2 (en) * | 1993-11-11 | 2003-12-22 | 株式会社東芝 | Portable electronic devices |
JP2008076487A (en) * | 2006-09-19 | 2008-04-03 | Murata Mach Ltd | Image forming apparatus |
-
2011
- 2011-11-24 JP JP2011256295A patent/JP5689050B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2013109714A (en) | 2013-06-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4211101B2 (en) | Information processing apparatus and method, and recording medium | |
JP4633647B2 (en) | Control method, control system, and connection confirmation method | |
JPH03240127A (en) | Program control system | |
EP2278501B1 (en) | Smartcard for portable electronic device | |
JP5689050B2 (en) | Portable recording medium, portable recording medium control method, and portable recording medium control program | |
CN104484289A (en) | Sector-based embedded system write protection device and method | |
CN111782605A (en) | Chip card file management method, device, terminal and storage medium | |
US7979606B2 (en) | Method for storing data | |
CN102023873B (en) | Application program execution method and system, storage media controller and storage device | |
CN112527341B (en) | Vehicle system upgrading method, vehicle system and computer storage medium | |
CN113849230A (en) | Server starting method and device, electronic equipment and readable storage medium | |
JP2593007B2 (en) | Program embedded device | |
JP2006190180A (en) | Information device and start management program | |
JP4747450B2 (en) | Portable information processing device | |
KR100256522B1 (en) | I/o memory card type pager | |
KR101437962B1 (en) | Data processing apparatus and data processing method | |
JP4839751B2 (en) | RFID tag | |
JP3641693B2 (en) | IC card and method of using the same | |
JP7438432B1 (en) | Electronic information storage medium, IC chip, IC card, record writing method, and program | |
JP2010198112A (en) | Removable device built-in equipment, removable device, and method for managing drive identification information | |
CN104252334A (en) | Branch target address acquiring method and device | |
JP6823289B2 (en) | IC card and computer program | |
KR20080068381A (en) | Flash memory card | |
JP2008047042A (en) | Portable electronic device and ic card | |
CN116400972A (en) | Starting method, device and medium of baseboard management controller |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20140306 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20140820 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20140902 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20141104 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20150127 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20150127 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 5689050 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |