Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP6926945B2 - IC card and terminal equipment - Google Patents
[go: Go Back, main page]

JP6926945B2 - IC card and terminal equipment - Google Patents

IC card and terminal equipment Download PDF

Info

Publication number
JP6926945B2
JP6926945B2 JP2017206564A JP2017206564A JP6926945B2 JP 6926945 B2 JP6926945 B2 JP 6926945B2 JP 2017206564 A JP2017206564 A JP 2017206564A JP 2017206564 A JP2017206564 A JP 2017206564A JP 6926945 B2 JP6926945 B2 JP 6926945B2
Authority
JP
Japan
Prior art keywords
command
binary
file
card
message
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
Application number
JP2017206564A
Other languages
Japanese (ja)
Other versions
JP2019079349A (en
Inventor
康介 奈良
康介 奈良
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Dai Nippon Printing Co Ltd
Original Assignee
Dai Nippon Printing Co Ltd
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 Dai Nippon Printing Co Ltd filed Critical Dai Nippon Printing Co Ltd
Priority to JP2017206564A priority Critical patent/JP6926945B2/en
Publication of JP2019079349A publication Critical patent/JP2019079349A/en
Application granted granted Critical
Publication of JP6926945B2 publication Critical patent/JP6926945B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Description

本発明は,半導体集積回路(ICチップ)を実装したカード媒体であるICカードと,ICカードと通信するターミナル装置に関する発明である。 The present invention relates to an IC card, which is a card medium on which a semiconductor integrated circuit (IC chip) is mounted, and a terminal device that communicates with the IC card.

半導体集積回路を実装したカード媒体であるICカードは,データを格納するファイルをメモリに記憶し,ファイルに格納したデータを扱うコマンドを備える。例えば,バイナリデータを格納するトランスペアレント(透過)型ファイルに対応したICカードは,トランスペアレント型ファイルに格納したバイナリデータを扱うコマンドであるバイナリコマンドを備える。なお,ICカードの分野では,データを格納するファイルのことをEF(Elementary File)やWEF(Work Elementary File)と呼ぶこともある。 An IC card, which is a card medium on which a semiconductor integrated circuit is mounted, stores a file for storing data in a memory and has a command for handling the data stored in the file. For example, an IC card that supports a transparent file that stores binary data includes a binary command that handles the binary data stored in the transparent file. In the field of IC cards, a file for storing data may be called an EF (Elementary File) or a WEF (Work Elementary File).

JIS X 6319-3等の規格に準拠したICカードは,バイナリデータの書込みを行う書込み・更新系のバイナリコマンドとして,トランスペアレント型ファイルに書き込まれているバイナリデータの初期値を書き換えるコマンドであるライトバイナリコマンドと,ライトバイナリコマンドによりトランスペアレント型ファイルに書き込まれたバイナリデータを更新するアップデートバイナリコマンドを実装する。また,JIS X 6319-3等の規格に準拠したICカードは,バイナリデータの読出しを行う読み出し系のバイナリコマンドとして,トランスペアレント型ファイルからバイナリデータを読み出すリードバイナリコマンドを実装する。 An IC card that conforms to standards such as JIS X 6319-3 is a write / update binary command that writes binary data, and is a command that rewrites the initial value of the binary data written in a transparent file. Implement the command and the update binary command that updates the binary data written to the transparent file by the write binary command. In addition, IC cards that comply with standards such as JIS X 6319-3 implement a read binary command that reads binary data from a transparent file as a read-type binary command that reads binary data.

JIS X 6319-3など多くの規格で規定されているコマンドメッセージは,コマンドのクラスを示すCLA,コマンドの識別に用いるINS,コマンドのパラメータとなるP1−P2を含み,バイナリコマンドの場合,P1−P2には,トランスペアレント型ファイルの先頭からの位置を示すアドレス情報となるオフセット値が少なくとも符号化される。バイナリコマンドに係る処理には,トランスペアレント型ファイルの先頭からの位置を示すアドレス情報の他に,バイナリコマンドに係る処理を行うバイナリデータのデータサイズが必要になり,書込み・更新系のバイナリコマンドのコマンドメッセージは,トランスペアレント型ファイルに書込むバイナリデータのデータサイズを示すLcを含む。また,読出し系のバイナリコマンドのコマンドメッセージは,トランスペアレント型ファイルから読み出すバイナリデータのデータサイズを示すLeを含む。 Command messages specified in many standards such as JIS X 6319-3 include CLA indicating the command class, INS used for command identification, and P1-P2 as command parameters. In the case of binary commands, P1- At least an offset value, which is address information indicating the position from the beginning of the transparent file, is encoded in P2. In addition to the address information indicating the position from the beginning of the transparent file, the data size of the binary data to be processed related to the binary command is required for the processing related to the binary command. The message contains an Lc indicating the data size of the binary data to be written to the transparent file. The command message of the read binary command includes Le indicating the data size of the binary data read from the transparent file.

なお,ICカードのメモリに記憶するファイルの型としては,トランスペアレント型ファイルの他に,レコード構造のデータを格納するレコード型ファイルがあり,レコード型ファイルの場合,レコードコマンドのコマンドメッセージに含ませるアドレス情報はレコード番号になる。 As the file type stored in the memory of the IC card, in addition to the transparent type file, there is a record type file that stores the data of the record structure. In the case of the record type file, the address to be included in the command message of the record command. The information will be the record number.

ファイルに格納されているデータ全てを読み出す場合など,所定のコマンドを連続してICカードに実行させるトランザクションを行う際,コマンドメッセージをICカードへ送信する装置となるターミナル装置は,コマンドの送信回数に応じて,ICカードに送信するコマンドメッセージに含ませるアドレス情報を変更することが必要になる。 When performing a transaction that causes the IC card to execute a predetermined command continuously, such as when reading all the data stored in a file, the terminal device, which is the device that sends the command message to the IC card, determines the number of command transmissions. Therefore, it is necessary to change the address information included in the command message sent to the IC card.

コマンドを連続してICカードに実行させるトランザクションを行う際,コマンドメッセージに含ませるアドレス情報は,ターミナル装置側が計算する値になるが,コマンドに係る処理を実行する従来のICカードは,コマンドに係る処理が終了した位置の次になるアドレス情報をターミナル装置側に通知できるように構成されていなかった。コマンドに係る処理が終了した位置の次になるアドレス情報をICカード側からターミナル装置側に通知できれば,コマンドメッセージに含ませるアドレス情報をターミナル装置が計算する手間を省くことができるし,ターミナル装置が計算したアドレス情報の正当性をターミナル装置側で検証するようにもできる。 When performing a transaction that causes an IC card to execute a command continuously, the address information included in the command message is a value calculated by the terminal device side, but the conventional IC card that executes the processing related to the command is related to the command. It was not configured to notify the terminal device side of the address information next to the position where the processing was completed. If the IC card side can notify the terminal device side of the address information next to the position where the processing related to the command is completed, the terminal device can save the trouble of calculating the address information included in the command message, and the terminal device can do it. The validity of the calculated address information can also be verified on the terminal device side.

コマンドのコマンドメッセージに含ませるアドレス情報の管理に係る発明として,例えば,特許文献1において,トランスペアレント型ファイルのファイルIDとデータのオフセット値を含むプロファイル情報をICカードに記憶させておくことにより,データのオフセット値をターミナル装置に予め登録しておかなくとも,トランスペアレント型ファイル内のデータにターミナル装置がアクセスできるようにした発明が開示されている。また,特許文献2では,オフセット値ではなくタグを用いて,トランスペアレント型ファイル内のデータにターミナル装置がアクセスできるようにした発明が開示されている。 As an invention relating to the management of address information included in a command message of a command, for example, in Patent Document 1, data is stored in an IC card by storing profile information including a file ID of a transparent file and a data offset value. An invention is disclosed in which the terminal device can access the data in the transparent file without registering the offset value of the above in the terminal device in advance. Further, Patent Document 2 discloses an invention in which a terminal device can access data in a transparent file by using a tag instead of an offset value.

しかしながら,コマンドのコマンドメッセージに含ませるアドレス情報の管理に係る従来の発明は,コマンドに係る処理が終了した位置の次になるアドレス情報をターミナル装置側にICカードが通知することに着目した発明ではない。 However, the conventional invention relating to the management of the address information included in the command message of the command is an invention focusing on the fact that the IC card notifies the terminal device side of the address information next to the position where the processing related to the command is completed. No.

特開2017−59022号公報JP-A-2017-59022 特開平9−231113号公報Japanese Unexamined Patent Publication No. 9-231113

そこで,本発明では,ファイルの先頭からの位置を示すアドレス情報を少なくともコマンドメッセージに含むコマンドを実行した後,コマンドに係る処理が終了した位置の次になるアドレス情報をターミナル装置に通知するICカードを提供する。加えて,本発明では,ICカードから通知されたアドレス情報を利用するターミナル装置をも提供する。 Therefore, in the present invention, after executing a command that includes at least the address information indicating the position from the beginning of the file in the command message, the IC card notifies the terminal device of the address information next to the position where the processing related to the command is completed. I will provide a. In addition, the present invention also provides a terminal device that uses the address information notified from the IC card.

上述した課題を解決する第1発明は,データを格納するファイルと,前記ファイルに格納されたデータを扱うコマンドに係る処理を実行するコマンド実行部を備え,前記コマンド実行部は,前記ファイルの先頭からの位置を示すアドレス情報とデータサイズを含む前記コマンドのコマンドメッセージが引き渡されると,前記コマンドのコマンドメッセージに含まれる前記アドレス情報を開始位置とし,前記コマンドのコマンドメッセージに含まれる前記データサイズをサイズとする前記ファイル内の領域に対して前記コマンドに係る処理を実行した後,前記コマンドに係る処理を実行した領域の次の位置を次のアドレス情報として特定し,前記次のアドレス情報を含ませた前記コマンドのレスポンスメッセージを生成することを特徴とするICカードである。 The first invention for solving the above-mentioned problems includes a file for storing data and a command execution unit for executing processing related to a command for handling the data stored in the file, and the command execution unit is the head of the file. When the command message of the command including the address information and the data size indicating the position from is passed, the address information included in the command message of the command is set as the start position, and the data size included in the command message of the command is used. After executing the process related to the command for the area in the file to be the size, the next position of the area where the process related to the command is executed is specified as the next address information, and the next address information is included. This is an IC card characterized by generating a response message for the above command.

更に,第2発明は,第1発明に係る前記コマンドをバイナリコマンドにした発明で,第2発明に係るICカードは,前記ファイルとして,バイナリデータを格納するトランスペアレント型ファイルを備え,前記コマンド実行部として,前記トランスペアレント型ファイルの先頭からの相対アドレスで表記するオフセット値を前記アドレス情報としてコマンドメッセージに含むバイナリコマンドに係る処理を実行する前記コマンド実行部を備え,前記バイナリコマンドに係る処理を実行する前記コマンド実行部は,コマンドメッセージに含まれていた前記オフセット値にコマンドメッセージに含まれていた前記データサイズを加算した位置に対応する相対アドレスを次のオフセット値とすることを特徴とする。 Further, the second invention is an invention in which the command according to the first invention is a binary command, and the IC card according to the second invention includes a transparent file for storing binary data as the file, and the command execution unit. The command execution unit for executing the processing related to the binary command including the offset value represented by the relative address from the beginning of the transparent file as the address information in the command message is provided, and the processing related to the binary command is executed. The command execution unit is characterized in that the relative address corresponding to the position obtained by adding the data size included in the command message to the offset value included in the command message is set as the next offset value.

更に,第3発明は,第1発明に係るICカード,すなわち,データを格納するファイルと,前記ファイルに格納されたデータを扱うコマンドに係る処理を実行するコマンド実行部を備え,前記コマンド実行部が,前記ファイルの先頭からの位置を示すアドレス情報とデータサイズを含む前記コマンドのコマンドメッセージが引き渡されると,前記コマンドのコマンドメッセージに含まれる前記アドレス情報を開始位置とし,前記コマンドのコマンドメッセージに含まれる前記データサイズをサイズとする前記ファイル内の領域に対して前記コマンドに係る処理を実行した後,前記コマンドに係る処理を実行した領域の次の位置を次のアドレス情報として特定し,前記次のアドレス情報を含ませた前記コマンドのレスポンスメッセージを生成するように構成されたICカードを利用したトランザクションを実行するターミナル装置に係る発明で,第3発明に係るターミナル装置は,前記アドレス情報を変えながら前記コマンドを連続して前記ICカードに実行させるトランザクションを行う際,前記コマンドのコマンドメッセージを送信した後,前記コマンドのレスポンスメッセージを前記ICカードから受信すると,前記コマンドのレスポンスメッセージに含まれる前記次のアドレス情報を利用して,次に前記ICカードへ送信する前記コマンドのコマンドメッセージを生成する処理を行うトランザクション管理部を備えることを特徴とする。 Further, the third invention includes an IC card according to the first invention, that is, a file for storing data and a command execution unit for executing processing related to a command for handling the data stored in the file. However, when the command message of the command including the address information indicating the position from the beginning of the file and the data size is passed, the address information included in the command message of the command is set as the start position, and the command message of the command is used. After executing the process related to the command for the area in the file whose size is the included data size, the next position of the area where the process related to the command is executed is specified as the next address information, and the above The invention relates to a terminal device that executes a transaction using an IC card configured to generate a response message for the command including the following address information, and the terminal device according to the third invention uses the address information. When a transaction for causing the IC card to execute the command continuously while changing the command is performed, if the response message of the command is received from the IC card after sending the command message of the command, it is included in the response message of the command. It is characterized by including a transaction management unit that performs a process of generating a command message of the command to be transmitted to the IC card next by using the following address information.

本発明に係るICカードは,バイナリコマンドに係る処理が終了した位置の次になるオフセット値を,ICカードを利用したトランザクションを実行するターミナル装置側に通知できるように, バイナリコマンドのレスポンスメッセージに次のオフセット値を含ませるように構成されている。また,本発明に係るターミナル装置は,本実施形態に係るICカードから通知された次のオフセット値を利用して,次にICカードへ送信するバイナリコマンドのコマンドメッセージを生成するように構成されている。 The IC card according to the present invention follows the response message of the binary command so that the offset value next to the position where the processing related to the binary command is completed can be notified to the terminal device side that executes the transaction using the IC card. It is configured to include the offset value of. Further, the terminal device according to the present invention is configured to generate a command message of a binary command to be transmitted to the IC card next by using the next offset value notified from the IC card according to the present embodiment. There is.

本実施形態に係るICカードの構成を説明する図。The figure explaining the structure of the IC card which concerns on this embodiment. バイナリコマンドのコマンドメッセージを説明する図。The figure explaining the command message of a binary command. ICカードが備えるバイナリコマンド実行部の動作を説明する図。The figure explaining the operation of the binary command execution part included in the IC card. バイナリコマンド実行部の動作説明を補足する図。The figure which supplements the operation explanation of the binary command execution part. 実施形態に係るターミナル装置の構成を説明する図。The figure explaining the structure of the terminal apparatus which concerns on embodiment. ターミナル装置のトランザクション管理部の動作を説明する図。The figure explaining the operation of the transaction management part of a terminal apparatus.

ここから,本発明の好適な実施形態について説明する。なお,以下の記載は本発明の技術的範囲を束縛するものでなく,発明の理解を助けるために記述するものである。 Hereinafter, preferred embodiments of the present invention will be described. The following description does not constrain the technical scope of the present invention, but is described to assist the understanding of the invention.

図1は,本実施形態に係るICカード1の構成を説明する図である。本実施形態に係るICカード1は,I/Oインターフェース124,プロセッサ120,RAM121(Random Access Memory),ROM122(Read-Only Memory),NVM123を実装したICチップ12を備え,NVM123には,データを格納するファイルとして,バイナリデータ(バイトの文字列)を格納するトランスペアレント型ファイル11が記憶されている。また,ICカード1には,ファイルを利用するコマンドとして,バイナリデータを扱うコマンドであるバイナリコマンドに係る処理を実行するコマンド実行部であるバイナリコマンド実行部10を備える。なお,コマンド実行部は,ICカード1が対応しているコマンドごとにICカード1に備えられる機能である。 FIG. 1 is a diagram illustrating a configuration of an IC card 1 according to the present embodiment. The IC card 1 according to the present embodiment includes an IC chip 12 on which an I / O interface 124, a processor 120, a RAM 121 (Random Access Memory), a ROM 122 (Read-Only Memory), and an NVM 123 are mounted, and data is stored in the NVM 123. As a file to be stored, a transparent file 11 for storing binary data (byte character string) is stored. Further, the IC card 1 includes a binary command execution unit 10 which is a command execution unit for executing processing related to a binary command which is a command for handling binary data as a command for using a file. The command execution unit is a function provided in the IC card 1 for each command supported by the IC card 1.

ICカード1のICチップ12に含まれるI/Oインターフェース124は,外部の装置と通信するための回路で,この回路を作動させるソフトウェアも含まれる。例えば,伝送路に有線を用いる場合,ICカード1は,I/Oインターフェース124としてコンタクトインターフェースを備え,伝送路に無線を用いる場合,ICカード1は,I/Oインターフェース124としてコンタクトレスインターフェースを備えることになる。 The I / O interface 124 included in the IC chip 12 of the IC card 1 is a circuit for communicating with an external device, and includes software for operating this circuit. For example, when wired is used for the transmission line, the IC card 1 is provided with a contact interface as the I / O interface 124, and when wireless is used for the transmission line, the IC card 1 is provided with a contactless interface as the I / O interface 124. It will be.

ICカード1のICチップ12に含まれるプロセッサ120は,ICカード1の動作を制御するデバイスである。ICカード1のICチップ12に含まれるRAM121は,プロセッサ120の主記憶装置となるメモリである。ICカード1のICチップ12に含まれるROM122は,電気的に書き換えできない補助記憶装置となるメモリで,ICカード1のICチップ12に含まれるNVM123は,電気的に書き換え可能な補助記憶装置となるメモリで,プロセッサ120を動作させるコンピュータプログラムは,ROM122やNVM123に格納される。 The processor 120 included in the IC chip 12 of the IC card 1 is a device that controls the operation of the IC card 1. The RAM 121 included in the IC chip 12 of the IC card 1 is a memory that serves as a main storage device of the processor 120. The ROM 122 included in the IC chip 12 of the IC card 1 is a memory that is an auxiliary storage device that cannot be electrically rewritten, and the NVM 123 included in the IC chip 12 of the IC card 1 is an electrically rewritable auxiliary storage device. The computer program that operates the processor 120 in the memory is stored in the ROM 122 or the NVM 123.

バイナリコマンドに係る処理を実行するバイナリコマンド実行部10は,バイナリコマンドに係る処理をプロセッサ120に実行させるコンピュータプログラムにより実現される機能である。バイナリコマンドには,トランスペアレント型ファイル11にバイナリデータを書き込む処理を行う書込み・更新系のコマンドと,トランスペアレント型ファイル11からバイナリデータを読み出す処理を行う読み出し系のコマンドがあるが,バイナリコマンドは,書込み・更新系のコマンドでも読み出し系のコマンドのいずれでもよい。 The binary command execution unit 10 that executes the processing related to the binary command is a function realized by a computer program that causes the processor 120 to execute the processing related to the binary command. Binary commands include write / update commands that write binary data to the transparent file 11 and read commands that read binary data from the transparent file 11. -It may be either an update command or a read command.

図2は,バイナリコマンドのコマンドメッセージを説明する図である。図2(a)は,書込み・更新系のコマンドであるバイナリコマンドのコマンドメッセージを説明する図,図2(b)は,書込み・更新系のコマンドであるバイナリコマンドのレスポンスメッセージを説明する図である。また,図2(c)は,読み出し系のコマンドであるバイナリコマンドのコマンドメッセージを説明する図,図2(d)は,読み出し系のコマンドであるバイナリコマンドのレスポンスメッセージを説明する図である。 FIG. 2 is a diagram illustrating a command message of a binary command. FIG. 2A is a diagram for explaining a command message of a binary command which is a write / update command, and FIG. 2B is a diagram for explaining a response message of a binary command which is a write / update command. be. Further, FIG. 2 (c) is a diagram for explaining a command message of a binary command which is a read system command, and FIG. 2 (d) is a diagram for explaining a response message of a binary command which is a read system command.

図2(a)で図示したコマンドメッセージは,JIS X 6319-3などの規格で規定されている内容に準拠する。図2(a)で図示したコマンドメッセージは,コマンドのクラスを示す1バイトのCLA,コマンドの識別に用いる1バイトのINS,コマンドのパラメータとなる2バイトのP1−P2,トランスペアレント型ファイル11に書込むバイナリデータのデータサイズを示す1または3バイトのLc,トランスペアレント型ファイル11に書込むバイナリデータの本体を含む。なお,2バイトのP1−P2には,バイナリコマンドの対象となるトランスペアレント型ファイル11と,トランスペアレント型ファイル11の先頭からの位置を示すアドレス情報となるオフセット値が符号化され,オフセット値は,トランスペアレント型ファイル11の先頭を0x0000(「0x」は16進表記を意味する)とする2バイトの相対アドレスで表記される。 The command message shown in Fig. 2 (a) conforms to the contents specified in standards such as JIS X 6319-3. The command message illustrated in FIG. 2A is written in a 1-byte CLA indicating the command class, a 1-byte INS used for command identification, a 2-byte P1-P2 as a command parameter, and a transparent file 11. Includes 1 or 3 bytes of Lc indicating the data size of the binary data to be loaded, and the main body of the binary data to be written to the transparent file 11. In the 2-byte P1-P2, the transparent file 11 that is the target of the binary command and the offset value that is the address information indicating the position from the beginning of the transparent file 11 are encoded, and the offset value is the transparent. The type file 11 is represented by a 2-byte relative address starting from 0x0000 (“0x” means hexadecimal notation).

図2(a)で図示したコマンドメッセージは,JIS X 6319-3などの規格で規定されている内容に準拠しているが,図2(b)で図示したレスポンスメッセージは,JIS X 6319-3などの規格で規定されている内容に準拠しておらず,書込み・更新系のバイナリコマンドの処理結果を示すSW(Status Word)に加え,次のオフセット値を含む。次のオフセット値とは,バイナリコマンドに係る処理を実行した領域の次の位置を示すオフセット値で,書込み・更新系のコマンドであるバイナリコマンドの場合,次のオフセット値は,トランスペアレント型ファイル11にバイナリデータを書込んだ領域の次の位置に対応する相対アドレスになる。 The command message shown in Fig. 2 (a) conforms to the contents specified by standards such as JIS X 6319-3, while the response message shown in Fig. 2 (b) conforms to JIS X 6319-3. It does not comply with the contents stipulated by standards such as, and includes the following offset values in addition to SW (Status Word) that shows the processing results of write / update binary commands. The next offset value is an offset value that indicates the next position of the area where the processing related to the binary command is executed. In the case of a binary command that is a write / update command, the next offset value is in the transparent file 11. It becomes a relative address corresponding to the next position in the area where the binary data is written.

図2(c)で図示したコマンドメッセージは,JIS X 6319-3などの規格で規定されている内容に準拠し,コマンドのクラスを示す1バイトのCLA,コマンドの識別に用いる1バイトのINS,コマンドのパラメータとなる2バイトのP1−P2,トランスペアレント型ファイル11から読出すバイナリデータのデータサイズを少なくとも示す1バイトまたは3バイトのLeを含む。なお,2バイトのP1−P2には,トランスペアレント型ファイル11の先頭からの位置を示すアドレス情報となるオフセット値が符号化される。 The command message shown in Fig. 2 (c) conforms to the contents specified in standards such as JIS X 6319-3, and has a 1-byte CLA indicating the command class and a 1-byte INS used for command identification. It contains at least 1 byte or 3 bytes of Le indicating the data size of the binary data read from the 2-byte P1-P2 and transparent file 11 that are the parameters of the command. The 2-byte P1-P2 is encoded with an offset value which is address information indicating the position from the beginning of the transparent file 11.

図2(c)で図示したコマンドメッセージは,JIS X 6319-3などの規格で規定されている内容に準拠しているが,図2(d)で図示したレスポンスメッセージは,JIS X 6319-3などの規格で規定されている内容に準拠しておらず,読み出し系のバイナリコマンドの処理結果を示すSW(Status Word)に加え,次のオフセット値を含む。読み出し系のバイナリコマンドの場合,次のオフセット値は,トランスペアレント型ファイル11からバイナリデータを読み出した領域の次の位置に対応する相対アドレスになる。 The command message shown in Fig. 2 (c) conforms to the contents specified by standards such as JIS X 6319-3, while the response message shown in Fig. 2 (d) conforms to JIS X 6319-3. It does not comply with the contents specified in the standards such as, and includes the following offset values in addition to the SW (Status Word) that shows the processing result of the read binary command. In the case of a read-type binary command, the next offset value is the relative address corresponding to the next position in the area where the binary data is read from the transparent file 11.

図3は,ICカード1が備えるバイナリコマンド実行部10の動作を説明する図である。 FIG. 3 is a diagram illustrating the operation of the binary command execution unit 10 included in the IC card 1.

ICカード1が,I/Oインターフェース124を利用して,バイナリコマンドのコマンドメッセージを外部から受信すると,ICカード1は,ICカード1が備えるバイナリコマンド実行部10に,バイナリコマンドのコマンドメッセージを引き渡し,バイナリコマンド実行部10が起動する(S1)。ICカード1は,外部から受信したコマンドメッセージをRAM121に格納した後,コマンドメッセージに含まれるCLAとINSを利用して,コマンドメッセージに対応するコマンドを特定し,コマンドメッセージに対応するコマンドがバイナリコマンドの場合,ICカード1はバイナリコマンド実行部10を起動させる。なお,コマンドメッセージに対応するコマンドがバイナリコマンド以外の場合,ICカード1は,コマンドメッセージに対応するコマンドに係る処理に対応するコマンド実行部を起動させる。 When the IC card 1 receives a command message of a binary command from the outside using the I / O interface 124, the IC card 1 delivers the command message of the binary command to the binary command execution unit 10 included in the IC card 1. , The binary command execution unit 10 starts (S1). After storing the command message received from the outside in the RAM 121, the IC card 1 identifies the command corresponding to the command message by using CLA and INS included in the command message, and the command corresponding to the command message is a binary command. In the case of, the IC card 1 activates the binary command execution unit 10. If the command corresponding to the command message is other than a binary command, the IC card 1 activates the command execution unit corresponding to the processing related to the command corresponding to the command message.

バイナリコマンドに係る処理を実行する際,ICカード1のバイナリコマンド実行部10は,バイナリコマンドに係る処理の対象となるトランスペアレント型ファイル11と,バイナリコマンドに係る処理を開始するトランスペアレント型ファイル11内の位置を特定する(S2)。バイナリコマンドに係る処理を開始するトランスペアレント型ファイル11内の位置は,バイナリコマンドのコマンドメッセージに含まれるP1−P2に符号化されたオフセット値に対応する位置になる。また,バイナリコマンドの対象となるトランスペアレント型ファイル11は,この時点でカレントになっているトランスペアレント型ファイル11になり,カレントのトランスペアレント型ファイル11は,P1−P2で示されるか,或いは, バイナリコマンドのコマンドメッセージを受信する前に選択されたトランスペアレント型ファイル11になる。 When executing the processing related to the binary command, the binary command execution unit 10 of the IC card 1 contains the transparent type file 11 to be the target of the processing related to the binary command and the transparent type file 11 for starting the processing related to the binary command. Specify the position (S2). The position in the transparent file 11 for starting the processing related to the binary command is the position corresponding to the offset value encoded in P1-P2 included in the command message of the binary command. Further, the transparent type file 11 that is the target of the binary command becomes the current transparent type file 11 at this point, and the current transparent type file 11 is indicated by P1-P2 or is a binary command. The transparent file 11 selected before receiving the command message is obtained.

ICカード1のバイナリコマンド実行部10は,バイナリコマンドのコマンドメッセージに含まれるオフセット値で示されるトランスペアレント型ファイル11内の位置を開始位置とし,バイナリコマンドのコマンドメッセージに含まれるデータサイズをサイズとするトランスペアレント型ファイル11内の領域に対して,バイナリコマンドに係る処理を実行する(S3)。 The binary command execution unit 10 of the IC card 1 uses the position in the transparent file 11 indicated by the offset value included in the command message of the binary command as the start position, and the data size included in the command message of the binary command as the size. The process related to the binary command is executed for the area in the transparent file 11 (S3).

ICカード1のバイナリコマンド実行部10は,P1−P2に含まれるオフセット値で示されるトランスペアレント型ファイル11内の位置から開始したバイナリコマンドに係る処理が終了すると,バイナリコマンドに係る処理が正常終了したか否かを判定する(S4)。 When the binary command execution unit 10 of the IC card 1 completes the processing related to the binary command started from the position in the transparent type file 11 indicated by the offset value included in P1-P2, the processing related to the binary command ends normally. Whether or not it is determined (S4).

ICカード1のバイナリコマンド実行部10は,バイナリコマンドが異常終了した場合,バイナリコマンドのコマンドメッセージに含まれていたオフセット値を次のオフセット値として(S9),図3のS7に進む。なお,バイナリコマンドが異常終了した場合,バイナリコマンドのコマンドメッセージに含まれていたオフセット値を次のオフセット値とするのは,バイナリコマンドが異常終了した場合は,図3のS1でICカード1が受信したバイナリコマンドのコマンドメッセージに対応する処理が完了しておらず,オフセット値は変更にならないからである。 When the binary command terminates abnormally, the binary command execution unit 10 of the IC card 1 sets the offset value included in the command message of the binary command as the next offset value (S9), and proceeds to S7 in FIG. If the binary command terminates abnormally, the offset value included in the command message of the binary command is set as the next offset value. If the binary command terminates abnormally, the IC card 1 is set to S1 in FIG. This is because the processing corresponding to the command message of the received binary command has not been completed, and the offset value does not change.

また,ICカード1のバイナリコマンド実行部10は,バイナリコマンドに係る処理が正常終了した場合,バイナリコマンドに係る処理を実行した領域の次の位置がトランスペアレント型ファイル11の領域外になるか否かを判定する(S5)。バイナリコマンドに係る処理を実行した領域の次の位置がトランスペアレント型ファイル11の領域外になる場合,ICカード1のバイナリコマンド実行部10は,次のオフセット値をトランスペアレント型ファイル11の領域外になることを示す値(例えば,0xFFFF)にして(S10),図3のS7に進む。バイナリコマンドに係る処理を実行した領域の次の位置がトランスペアレント型ファイル11の領域外にならない場合,ICカード1のバイナリコマンド実行部10は,次のオフセット値を,バイナリコマンドに係る処理を実行した領域の次の位置に対応する相対アドレスにして(S6),図3のS7に進む。 Further, the binary command execution unit 10 of the IC card 1 determines whether or not the position next to the area where the processing related to the binary command is executed is outside the area of the transparent file 11 when the processing related to the binary command is completed normally. Is determined (S5). When the position next to the area where the processing related to the binary command is executed is outside the area of the transparent file 11, the binary command execution unit 10 of the IC card 1 sets the next offset value outside the area of the transparent file 11. The value indicating that (for example, 0xFFFF) is set to (S10), and the process proceeds to S7 in FIG. When the position next to the area where the processing related to the binary command is executed does not fall outside the area of the transparent file 11, the binary command execution unit 10 of the IC card 1 executes the processing related to the binary command with the following offset value. The relative address corresponding to the next position of the region is set (S6), and the process proceeds to S7 in FIG.

本実施形態では,オフセット値を相対アドレスにより表記しているので,コマンドメッセージのP1−P2に含まれるオフセット値に,バイナリコマンドで扱うバイナリデータのデータサイズ(例えば,Lcの値)を加算することで,次のオフセット値を求めることができる。コマンドメッセージのP1−P2に含まれるオフセット値に,バイナリコマンドで扱うバイナリデータのデータサイズを加算した値が,バイナリコマンドの対象となるトランスペアレント型ファイル11のサイズを超えていれば,バイナリコマンドに係る処理を実行した領域の次の位置がトランスペアレント型ファイル11の領域外になると判断できる。 In this embodiment, since the offset value is represented by a relative address, the data size of the binary data handled by the binary command (for example, the value of Lc) is added to the offset value included in P1-P2 of the command message. Then, the following offset value can be obtained. If the value obtained by adding the data size of the binary data handled by the binary command to the offset value included in P1-P2 of the command message exceeds the size of the transparent file 11 that is the target of the binary command, the binary command is involved. It can be determined that the position next to the area where the processing is executed is outside the area of the transparent file 11.

次に,ICカード1のバイナリコマンド実行部10は,次のオフセット値を含むバイナリコマンドのレスポンスメッセージをRAM121などに生成し(S7),ICカード1は,I/Oインターフェース124を利用して,次のオフセット値を含ませたバイナリコマンドのレスポンスメッセージを外部へ送信して(S8),この手順を終了する。 Next, the binary command execution unit 10 of the IC card 1 generates a response message of the binary command including the following offset value in the RAM 121 or the like (S7), and the IC card 1 uses the I / O interface 124. A response message of the binary command including the following offset value is sent to the outside (S8), and this procedure ends.

図4は,バイナリコマンド実行部の動作説明を補足する図で,図4(a)は,16バイトのトランスペアレント型ファイル11の初期状態を説明する図,図4(b)は,0x0000から8バイトのバイナリデータを書き込んだ後のトランスペアレント型ファイル11を説明する図,図4(c)は,0x0008から8バイトのバイナリデータを書き込んだ後のトランスペアレント型ファイル11を説明する図である。 FIG. 4 is a diagram supplementing the operation explanation of the binary command execution unit, FIG. 4 (a) is a diagram explaining the initial state of the 16-byte transparent file 11, and FIG. 4 (b) is 0x0000 to 8 bytes. FIG. 4C is a diagram for explaining the transparent type file 11 after writing the binary data of 0x0008, and FIG. 4C is a diagram for explaining the transparent type file 11 after writing the binary data of 0x0008 to 8 bytes.

図4(a)で図示したように,NVMに創生された直後の状態である初期状態におけるトランスペアレント型ファイル11の領域全てには,バイナリデータの初期値となる0xFFが書き込まれている。 As shown in FIG. 4A, 0xFF, which is the initial value of the binary data, is written in all the areas of the transparent file 11 in the initial state, which is the state immediately after being created in NVM.

トランスペアレント型ファイル11におけるバイナリデータの初期値を更新するバイナリコマンドは,書込み・更新系のバイナリコマンドの一つであるライトバイナリコマンドになる。ライトバイナリコマンドを用い,図4(a)のトランスペアレント型ファイル11の0x0000から0x0007までの領域に8バイトのバイナリデータ(0xF0F1F2F3F4F5F6F7)を書込むことで,トランスペアレント型ファイル11の状態は図4(b)の状態になる。 The binary command for updating the initial value of the binary data in the transparent file 11 is a write binary command, which is one of the write / update binary commands. By writing 8-byte binary data (0xF0F1F2F3F4F5F6F7) in the area from 0x0000 to 0x0007 of the transparent file 11 of FIG. 4 (a) using the write binary command, the state of the transparent file 11 is shown in FIG. 4 (b). It becomes the state of.

トランスペアレント型ファイル11の0x0000から0x0007までの領域に8バイトのバイナリデータ(0xF0F1F2F3F4F5F6F7)を書込む最初のライトバイナリコマンドのコマンドメッセージにおいて,P1−P2に含まれるオフセット値は0x0000で,書込みデータのデータサイズを示すLcは,0x08または0x000008になる。最初のライトバイナリコマンドが正常終了した場合,最初のライトバイナリコマンドのレスポンスメッセージは,次のオフセット値となる0x0008と正常終了を示すSWになる。また,本実施形態では,最初のライトバイナリコマンドが異常終了した場合,最初のライトバイナリコマンドのレスポンスメッセージは,次のオフセット値となる0x0000と異常終了を示すSWになる。なお,異常終了した場合の次のオフセット値である0x0000は,最初のライトバイナリコマンドのコマンドメッセージに含まれるオフセット値である。 In the command message of the first write binary command to write 8-byte binary data (0xF0F1F2F3F4F5F6F7) in the area from 0x0000 to 0x0007 of the transparent file 11, the offset value included in P1-P2 is 0x0000, and the data size of the write data. Lc indicating is 0x08 or 0x000008. When the first write binary command ends normally, the response message of the first write binary command becomes 0x0008 which is the next offset value and SW indicating the normal end. Further, in the present embodiment, when the first write binary command terminates abnormally, the response message of the first write binary command becomes 0x0000 which is the next offset value and SW indicating the abnormal termination. The next offset value, 0x0000, when the command ends abnormally is the offset value included in the command message of the first write binary command.

トランスペアレント型ファイル11の0x0008から0x000Fまでの領域に8バイトのバイナリデータ(0xF8F9FAFBFCFDFEFF)を書込む2回目のライトバイナリコマンドのコマンドメッセージにより,8バイトのバイナリデータが図4(b)のトランスペアレント型ファイル11の0x0008から0x000Fまでの領域に書込まれることで,トランスペアレント型ファイル11の状態は図4(c)の状態になる。 By the command message of the second write binary command to write the 8-byte binary data (0xF8F9FAFBFCDFFEFF) in the area from 0x0008 to 0x000F of the transparent type file 11, the 8-byte binary data is converted into the transparent type file 11 in FIG. 4 (b). By writing in the area from 0x0008 to 0x000F, the state of the transparent file 11 becomes the state shown in FIG. 4 (c).

2回目のライトバイナリコマンドのコマンドメッセージにおいて,P1−P2に含まれるオフセット値は0x0008で,書込むデータのデータサイズを示すLcは,0x08または0x000008になる。2回目のライトバイナリコマンドが正常終了した場合,バイナリコマンドに係る処理を実行した領域の次の位置がトランスペアレント型ファイル11の領域外になるため,2回目のライトバイナリコマンドのレスポンスメッセージは,トランスペアレント型ファイル11の領域外になることを示す次のオフセット値と正常終了を示すSWになる。なお,本実施形態では,2回目のライトバイナリコマンドが異常終了した場合,2回目のライトバイナリコマンドのレスポンスメッセージは,次のオフセット値となる0x0008と異常終了を示すSWになる。なお,異常終了した場合の次のオフセット値である0x0008は,2回目のライトバイナリコマンドのコマンドメッセージに含まれるオフセット値である。 In the command message of the second write binary command, the offset value included in P1-P2 is 0x0008, and the Lc indicating the data size of the data to be written is 0x08 or 0x000008. When the second write binary command ends normally, the position next to the area where the processing related to the binary command is executed is outside the area of the transparent file 11, so the response message of the second write binary command is the transparent type. The next offset value indicating that the file 11 is out of the area and the SW indicating normal termination are obtained. In the present embodiment, when the second write binary command terminates abnormally, the response message of the second write binary command becomes 0x0008 which is the next offset value and SW indicating the abnormal termination. The next offset value, 0x0008, in the case of abnormal termination is the offset value included in the command message of the second write binary command.

なお,書込み・更新系のバイナリコマンドには,ライトバイナリコマンドの他にアップデートバイナリコマンドもあるが,アップデートバイナリコマンドについては,バイナリデータを書込む前の状態のバイナリデータの値が初期値でないことを除き,上述したライトバイナリコマンドと同じであるため,ここでは説明を省く。 In addition to the write binary command, there is also an update binary command for writing / updating binary commands, but for the update binary command, the value of the binary data in the state before writing the binary data is not the initial value. Except for this, it is the same as the write binary command described above, so the explanation is omitted here.

トランスペアレント型ファイル11からバイナリデータを読出すバイナリコマンドはリードバイナリコマンドになる。トランスペアレント型ファイル11の先頭である0x0000から8バイトのバイナリデータを読出す最初のリードバイナリコマンドを用いて,図4(c)の状態のトランスペアレント型ファイル11の先頭である0x0000から8バイトのバイナリデータを読出すとき,最初のリードバイナリコマンドのコマンドメッセージにおいて,P1−P2に含まれるオフセット値は0x0000で,読み出しデータのデータサイズを示すLeは,0x08または0x000008になる。 The binary command for reading the binary data from the transparent file 11 is a read binary command. Read the binary data from 0x0000 to 8 bytes at the beginning of the transparent file 11 Using the first read binary command, the binary data from 0x0000 to 8 bytes at the beginning of the transparent file 11 in the state of FIG. 4 (c). In the command message of the first read binary command, the offset value included in P1-P2 is 0x0000, and the Le indicating the data size of the read data is 0x08 or 0x000008.

最初のリードバイナリコマンドが正常終了した場合,最初のリードバイナリコマンドのレスポンスメッセージは,トランスペアレント型ファイル11の先頭から8バイト目までに格納されているバイナリデータ(0xF0F1F2F3F4F5F6F7)と,次のオフセット値となる0x0008と,正常終了を示すSWになる。なお,本実施形態では,最初のリードバイナリコマンドが異常終了した場合,最初のリードバイナリコマンドのレスポンスメッセージは,次のオフセット値となる0x0000と異常終了を示すSWのみになる。なお,異常終了した場合の次のオフセット値である0x0000は,最初のリードバイナリコマンドのコマンドメッセージに含まれるオフセット値である。 When the first read binary command ends normally, the response message of the first read binary command is the binary data (0xF0F1F2F3F4F5F6F7) stored in the 8th byte from the beginning of the transparent file 11 and the next offset value. It becomes 0x0008 and SW indicating normal termination. In the present embodiment, when the first read binary command terminates abnormally, the response message of the first read binary command is only 0x0000, which is the next offset value, and the SW indicating the abnormal termination. The next offset value, 0x0000, when the command ends abnormally is the offset value included in the command message of the first read binary command.

図4(c)の状態のトランスペアレント型ファイル11の9バイト目になる0x0008から8バイトのバイナリデータを読出す2回目のリードバイナリコマンドを用いて,図4(c)の状態のトランスペアレント型ファイル11の9バイト目になる0x0008から8バイトのバイナリデータを読出すとき,2回目のリードバイナリコマンドのコマンドメッセージにおいて,P1−P2に含まれるオフセット値は0x0008で,読み出しデータのデータサイズを示すLeは,0x08または0x000008になる。2回目のリードバイナリコマンドが正常終了した場合,2回目のリードバイナリコマンドのレスポンスメッセージは,トランスペアレント型ファイル11の0x0008から0x000Fまでに格納されているバイナリデータ(0xF8F9FAFBFCFDFEFF)と,トランスペアレント型ファイル11の領域外になることを示す次のオフセット値と,正常終了を示すSWになる。なお,2回目のリードバイナリコマンドが異常終了した場合,2回目のリードバイナリコマンドのレスポンスメッセージは,次のオフセット値となる0x0008と異常終了を示すSWになる。なお,異常終了した場合の次のオフセット値である0x0008は,2回目のリードバイナリコマンドのコマンドメッセージに含まれるオフセット値である。 Using the second read binary command to read 8 bytes of binary data from 0x0008, which is the 9th byte of the transparent file 11 in the state of FIG. 4 (c), the transparent file 11 in the state of FIG. 4 (c) is used. When reading 8 bytes of binary data from 0x0008, which is the 9th byte of, in the command message of the second read binary command, the offset value included in P1-P2 is 0x0008, and Le indicating the data size of the read data is , 0x08 or 0x000008. When the second read binary command ends normally, the response message of the second read binary command is the binary data (0xF8F9FAFBFCDFFEFF) stored in the transparent file 11 from 0x0008 to 0x000F and the area of the transparent file 11. It becomes the next offset value indicating that it is outside and the SW indicating normal termination. If the second read binary command terminates abnormally, the response message of the second read binary command becomes 0x0008, which is the next offset value, and SW indicating abnormal termination. Note that 0x0008, which is the next offset value in the case of abnormal termination, is an offset value included in the command message of the second read binary command.

これまで述べたように,本実施形態に係るICカード1は,バイナリコマンドに係る処理が終了した位置の次になるオフセット値を,ICカード1を利用したトランザクションを実行するターミナル装置側に通知できるように, バイナリコマンドのレスポンスメッセージに次のオフセット値を含ませるように構成されている。バイナリコマンドに係る処理が終了した位置の次になるオフセット値となる次のオフセット値をICカード1側からターミナル装置側に通知できれば,バイナリコマンドに係る処理が終了した位置の次になるオフセット値をターミナル装置が計算する手間を省くことができるし,ターミナル装置が計算したオフセット値の正当性をターミナル装置側で検証することもできる。 As described above, the IC card 1 according to the present embodiment can notify the terminal device side that executes the transaction using the IC card 1 of the offset value next to the position where the processing related to the binary command is completed. As shown above, the response message of the binary command is configured to include the following offset value. If the IC card 1 can notify the terminal device of the next offset value, which is the offset value next to the position where the processing related to the binary command is completed, the offset value next to the position where the processing related to the binary command is completed can be notified. The time and effort required for the terminal device to calculate can be saved, and the validity of the offset value calculated by the terminal device can be verified on the terminal device side.

ここから,本実施形態に係るICカード1を利用したトランザクションを実行するターミナル装置2について説明する。図5は,本実施形態に係るターミナル装置2の構成を説明する図である。 From here, the terminal device 2 that executes a transaction using the IC card 1 according to the present embodiment will be described. FIG. 5 is a diagram illustrating a configuration of the terminal device 2 according to the present embodiment.

本実施形態に係るターミナル装置2は,リーダライタ214,プロセッサ210,RAM211,ROM212,ストレージ213を含むハードウェア21を備え,ハードウェア21上で動作するソフトウェアにより実現される機能として,バイナリコマンドを少なくとも利用するトランザクションを管理するトランザクション管理部20を備える。 The terminal device 2 according to the present embodiment includes hardware 21 including a reader / writer 214, a processor 210, a RAM 211, a ROM 212, and a storage 213, and at least a binary command is used as a function realized by software running on the hardware 21. A transaction management unit 20 that manages transactions to be used is provided.

ターミナル装置2のハードウェア21に含まれるリーダライタ214は,ICカード1と通信するための回路で,この回路を作動させるソフトウェアも含まれる。ターミナル装置2のハードウェア21に含まれるリーダライタ214は,ICカード1のI/Oインターフェース124に対応する。ICカード1が,I/Oインターフェース124としてコンタクトインターフェースを備える場合,ターミナル装置2が備えるリーダライタ214はコンタクト用になり,ICカード1が,I/Oインターフェース124としてコンタクトレスインターフェースを備える場合,ターミナル装置2が備えるリーダライタ214はコンタクトレス用になる。 The reader / writer 214 included in the hardware 21 of the terminal device 2 is a circuit for communicating with the IC card 1, and includes software for operating this circuit. The reader / writer 214 included in the hardware 21 of the terminal device 2 corresponds to the I / O interface 124 of the IC card 1. When the IC card 1 has a contact interface as the I / O interface 124, the reader / writer 214 included in the terminal device 2 is for contact, and when the IC card 1 has a contactless interface as the I / O interface 124, the terminal. The reader / writer 214 included in the device 2 is for contactless use.

ターミナル装置2のハードウェア21に含まれるプロセッサ210は,ターミナル装置2の動作を制御するデバイスである。ターミナル装置2のハードウェア21に含まれるRAM211は,ターミナル装置2の主記憶装置となるメモリである。ターミナル装置2のハードウェア21に含まれるROM212は,電気的に書き換えできない補助記憶装置となるメモリで,ターミナル装置2のハードウェア21に含まれるストレージ213は,電気的に書き換え可能な補助記憶装置となるハードディスクなどのメモリで,プロセッサ210を動作させるソフトウェアは,ROM212やストレージ213に格納される。 The processor 210 included in the hardware 21 of the terminal device 2 is a device that controls the operation of the terminal device 2. The RAM 211 included in the hardware 21 of the terminal device 2 is a memory that serves as a main storage device of the terminal device 2. The ROM 212 included in the hardware 21 of the terminal device 2 is a memory that is an auxiliary storage device that cannot be electrically rewritten, and the storage 213 included in the hardware 21 of the terminal device 2 is an electrically rewritable auxiliary storage device. The software that operates the processor 210 in a memory such as a hard disk is stored in the ROM 212 or the storage 213.

ターミナル装置2のトランザクション管理部20は,ICカード1に実装されたコマンドを利用する一連のトランザクションの実行を管理する機能を備え,一つのバイナリコマンドでは済まないほど長いデータサイズのバイナリデータを扱う場合など,オフセット値を変えながらバイナリコマンドを連続してICカード1に実行させるトランザクションを行う際,ICカード1から受信したバイナリコマンドのレスポンスメッセージに含まれる次のオフセット値を用いて,次にICカード1へ送信するバイナリコマンドのコマンドメッセージを生成する処理を行うように構成されている。 The transaction management unit 20 of the terminal device 2 has a function of managing the execution of a series of transactions using the commands mounted on the IC card 1, and handles binary data having a data size longer than one binary command. , When performing a transaction to make the IC card 1 execute binary commands continuously while changing the offset value, the next offset value included in the response message of the binary command received from the IC card 1 is used, and then the IC card 1 is used. It is configured to generate a command message for a binary command to be sent to.

図6は,ターミナル装置2のトランザクション管理部20の動作を説明する図で,一つのバイナリコマンド(リードバイナリコマンドになる)では済まないほど長いデータサイズのバイナリデータをICカード1から読み出す場合におけるトランザクション管理部20の動作を図示している。 FIG. 6 is a diagram for explaining the operation of the transaction management unit 20 of the terminal device 2. Transaction management when reading binary data having a data size long enough that one binary command (which becomes a read binary command) is not enough from the IC card 1. The operation of the unit 20 is illustrated.

一つのバイナリコマンドでは済まないほど長いデータサイズのバイナリデータをICカード1から読み出す際,ターミナル装置2のトランザクション管理部20は,まず,リーダライタ214を利用して,バイナリコマンドを利用するトランザクションの対象になるトランスペアレント型ファイル11の先頭から所定のデータサイズのバイナリデータを読み出す最初のバイナリコマンドのコマンドメッセージをICカード1へ送信する処理を実行する(S20)。なお,図4(c)で図示したトランスペアレント型ファイル11の先頭から8バイトのバイナリデータを読み出す場合,最初のバイナリコマンドのコマンドメッセージに含まれるオフセット値は0x0000で,Leは,トランスペアレント型ファイル11から読み出すデータサイズは,0x08または0x000008になる。 When reading binary data having a data size that is too long for one binary command from the IC card 1, the transaction management unit 20 of the terminal device 2 first uses the reader / writer 214 to target the transaction using the binary command. A process of transmitting a command message of the first binary command for reading binary data of a predetermined data size from the beginning of the transparent file 11 to the IC card 1 is executed (S20). When reading 8-byte binary data from the beginning of the transparent file 11 shown in FIG. 4 (c), the offset value included in the command message of the first binary command is 0x0000, and Le is from the transparent file 11. The data size to be read is 0x08 or 0x000008.

ICカード1のバイナリコマンド実行部10が,ターミナル装置2が送信したバイナリコマンドのコマンドメッセージを処理して,バイナリコマンドのレスポンスメッセージを送信し,リーダライタ214を利用して,ターミナル装置2のトランザクション管理部20が,バイナリコマンドのレスポンスメッセージをICカード1から受信すると(S21),ターミナル装置2のトランザクション管理部20は,バイナリコマンドを利用するトランザクションで読み出すバイナリデータの読み出しが完了したか判定する処理を実行する(S22)。 The binary command execution unit 10 of the IC card 1 processes the command message of the binary command sent by the terminal device 2, sends the response message of the binary command, and manages the transaction of the terminal device 2 by using the reader / writer 214. When the unit 20 receives the response message of the binary command from the IC card 1 (S21), the transaction management unit 20 of the terminal device 2 performs a process of determining whether the reading of the binary data to be read by the transaction using the binary command is completed. Execute (S22).

トランスペアレント型ファイル11に格納されたバイナリデータ全てを読み出す場合,バイナリコマンドを利用するトランザクションで読み出すバイナリデータの読み出しが完了したかの判定に,バイナリコマンドのレスポンスメッセージに含まれる次のオフセット値を利用することもできるが,トランスペアレント型ファイル11に格納されたバイナリデータの一部を読み出す場合も考慮して,ターミナル装置2のトランザクション管理部20側で,バイナリコマンドを利用するトランザクションで読み出したバイナリデータのデータサイズを管理することが望ましい。例えば,バイナリコマンドを利用するトランザクションで読み出すバイナリデータのデータサイズと,ICカード1から読み出したバイナリデータのデータサイズの合計値を比較することで,バイナリコマンドを利用するトランザクションで読み出すバイナリデータの読み出しが完了したかを判定できる。 When reading all the binary data stored in the transparent file 11, the following offset value included in the response message of the binary command is used to determine whether the reading of the binary data to be read by the transaction using the binary command is completed. Although it is possible, in consideration of the case where a part of the binary data stored in the transparent file 11 is read, the binary data data read by the transaction using the binary command on the transaction management unit 20 side of the terminal device 2 It is desirable to manage the size. For example, by comparing the total value of the data size of the binary data read by the transaction using the binary command with the data size of the binary data read from the IC card 1, the reading of the binary data read by the transaction using the binary command can be performed. You can determine if it is complete.

ターミナル装置2のトランザクション管理部20は,バイナリコマンドを利用するトランザクションで読み出すバイナリデータの読み出しが完了している場合,図6で図示した手順を終了し,バイナリコマンドを利用するトランザクションで読み出すバイナリデータの読み出しが完了していない場合,バイナリコマンドのレスポンスメッセージに含まれる次のオフセット値を利用して,次にICカード1へ送信するバイナリコマンドのコマンドメッセージを生成する処理を実行する(S23)。 When the reading of the binary data read by the transaction using the binary command is completed, the transaction management unit 20 of the terminal device 2 ends the procedure shown in FIG. 6 and reads the binary data by the transaction using the binary command. If the reading is not completed, the next offset value included in the response message of the binary command is used to execute the process of generating the command message of the binary command to be transmitted to the IC card 1 (S23).

例えば,バイナリコマンドのレスポンスメッセージに含まれる次のオフセット値を,次にICカード1へ送信するバイナリコマンドのコマンドメッセージに含ませるオフセット値に用いることで,ターミナル装置2側でオフセット値を算出することなく,次にICカード1へ送信するバイナリコマンドのコマンドメッセージを生成できる。また,ターミナル装置2のトランザクション管理部20が,次にICカード1へ送信するバイナリコマンドのコマンドメッセージに含ませるオフセット値を算出する場合は,ターミナル装置2のトランザクション管理部20が算出したオフセット値と,バイナリコマンドのレスポンスメッセージに含まれる次のオフセット値を照合することで,次にICカード1へ送信するバイナリコマンドのコマンドメッセージに含ませるオフセット値の正当性を検証できる。 For example, the offset value can be calculated on the terminal device 2 side by using the next offset value included in the response message of the binary command as the offset value included in the command message of the binary command to be transmitted to the IC card 1 next. Instead, the command message of the binary command to be sent to the IC card 1 can be generated next. When the transaction management unit 20 of the terminal device 2 calculates the offset value to be included in the command message of the binary command to be transmitted to the IC card 1 next, the offset value calculated by the transaction management unit 20 of the terminal device 2 is used. By collating the next offset value included in the response message of the binary command, the validity of the offset value included in the command message of the binary command sent to the IC card 1 can be verified.

ターミナル装置2のトランザクション管理部20は,バイナリコマンドのレスポンスメッセージに含まれる次のオフセット値を利用して,次にICカード1へ送信するバイナリコマンドのコマンドメッセージを生成すると,ターミナル装置2は,トランザクション管理部20が生成したバイナリコマンドのコマンドメッセージをICカード1へ送信して(S24),図6のS21に戻る。 When the transaction management unit 20 of the terminal device 2 uses the next offset value included in the response message of the binary command to generate a command message of the binary command to be transmitted to the IC card 1 next, the terminal device 2 makes a transaction. The command message of the binary command generated by the management unit 20 is transmitted to the IC card 1 (S24), and the process returns to S21 in FIG.

これまで述べたように,本実施形態に係るターミナル装置2は,本実施形態に係るICカード1から通知された次のオフセット値を利用して,次にICカード1へ送信するバイナリコマンドのコマンドメッセージを生成するように構成されている。ICカード1から通知された次のオフセット値を利用して,次にICカード1へ送信するバイナリコマンドのコマンドメッセージを生成することで,コマンドに係る処理が終了した位置の次になるオフセット値をターミナル装置2が計算する手間を省くことができるし,ターミナル装置2が計算したオフセット値の正当性をターミナル装置2側で検証することもできる。なお,本実施形態では,バイナリデータをICカード1から読み出すときの動作について説明したが,書込み・更新系のバイナリコマンドの場合についても同じである。 As described above, the terminal device 2 according to the present embodiment uses the next offset value notified from the IC card 1 according to the present embodiment, and then sends a binary command to the IC card 1. It is configured to generate a message. By using the next offset value notified from the IC card 1 to generate a command message for the binary command to be sent to the IC card 1, the offset value next to the position where the processing related to the command is completed can be calculated. The time and effort required for the terminal device 2 to calculate can be saved, and the validity of the offset value calculated by the terminal device 2 can be verified on the terminal device 2 side. In this embodiment, the operation when reading the binary data from the IC card 1 has been described, but the same applies to the case of the writing / updating binary command.

1 ICカード
10 バイナリコマンド実行部
11 トランスペアレント型ファイル
2 ターミナル装置
20 トランザクション管理部
1 IC card 10 Binary command execution unit 11 Transparent file 2 Terminal device 20 Transaction management unit

Claims (3)

データを格納するファイルと,前記ファイルに格納されたデータを扱うコマンドに係る処理を実行するコマンド実行部を備え,
前記コマンド実行部は,前記ファイルの先頭からの位置を示すアドレス情報とデータサイズを含む前記コマンドのコマンドメッセージが引き渡されると,前記コマンドのコマンドメッセージに含まれる前記アドレス情報を開始位置とし,前記コマンドのコマンドメッセージに含まれる前記データサイズをサイズとする前記ファイル内の領域に対して前記コマンドに係る処理を実行した後,前記コマンドに係る処理を実行した領域の次の位置を次のアドレス情報として特定し,前記次のアドレス情報を含ませた前記コマンドのレスポンスメッセージを生成する,
ことを特徴とするICカード。
It is equipped with a file that stores data and a command execution unit that executes processing related to commands that handle the data stored in the file.
When the command message of the command including the address information indicating the position from the beginning of the file and the data size is passed, the command execution unit sets the address information included in the command message of the command as the start position and sets the command. After executing the process related to the command for the area in the file whose size is the data size included in the command message of, the next position of the area where the process related to the command is executed is set as the next address information. Identify and generate a response message for the command that includes the following address information:
An IC card characterized by this.
前記ファイルとして,バイナリデータを格納するトランスペアレント型ファイルを備え,前記コマンド実行部として,前記トランスペアレント型ファイルの先頭からの相対アドレスで表記するオフセット値を前記アドレス情報としてコマンドメッセージに含むバイナリコマンドに係る処理を実行する前記コマンド実行部を備え,前記バイナリコマンドに係る処理を実行する前記コマンド実行部は,コマンドメッセージに含まれていた前記オフセット値にコマンドメッセージに含まれていた前記データサイズを加算した位置に対応する相対アドレスを次のオフセット値とすることを特徴とする,請求項1に記載したICカード。 A transparent type file for storing binary data is provided as the file, and a process related to a binary command including an offset value represented by a relative address from the beginning of the transparent type file as the address information in a command message as the command execution unit. The command execution unit is provided with the command execution unit that executes the command, and the command execution unit that executes the processing related to the binary command is the position where the data size included in the command message is added to the offset value included in the command message. The IC card according to claim 1, wherein the relative address corresponding to is set to the next offset value. データを格納するファイルと,前記ファイルに格納されたデータを扱うコマンドに係る処理を実行するコマンド実行部を備え,前記コマンド実行部が,前記ファイルの先頭からの位置を示すアドレス情報とデータサイズを含む前記コマンドのコマンドメッセージが引き渡されると,前記コマンドのコマンドメッセージに含まれる前記アドレス情報を開始位置とし,前記コマンドのコマンドメッセージに含まれる前記データサイズをサイズとする前記ファイル内の領域に対して前記コマンドに係る処理を実行した後,前記コマンドに係る処理を実行した領域の次の位置を次のアドレス情報として特定し,前記次のアドレス情報を含ませた前記コマンドのレスポンスメッセージを生成するように構成されたICカードを利用したトランザクションを実行するターミナル装置であって,
前記ターミナル装置は,前記アドレス情報を変えながら前記コマンドを連続して前記ICカードに実行させるトランザクションを行う際,前記コマンドのコマンドメッセージを送信した後,前記コマンドのレスポンスメッセージを前記ICカードから受信すると,前記コマンドのレスポンスメッセージに含まれる前記次のアドレス情報を利用して,次に前記ICカードへ送信する前記コマンドのコマンドメッセージを生成する処理を行うトランザクション管理部を備えた,
ことを特徴とするターミナル装置。
It is equipped with a file that stores data and a command execution unit that executes processing related to commands that handle the data stored in the file, and the command execution unit provides address information and data size that indicate the position from the beginning of the file. When the command message of the command including the command is passed, the address information included in the command message of the command is set as the start position, and the data size included in the command message of the command is set as the size of the area in the file. After executing the process related to the command, the next position of the area where the process related to the command is executed is specified as the next address information, and the response message of the command including the next address information is generated. It is a terminal device that executes a command using the IC card configured in.
When the terminal device performs a transaction to continuously execute the command on the IC card while changing the address information, the terminal device sends a command message of the command and then receives a response message of the command from the IC card. , A transaction management unit is provided that performs a process of generating a command message of the command to be transmitted to the IC card next by using the following address information included in the response message of the command.
A terminal device characterized by that.
JP2017206564A 2017-10-25 2017-10-25 IC card and terminal equipment Active JP6926945B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2017206564A JP6926945B2 (en) 2017-10-25 2017-10-25 IC card and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2017206564A JP6926945B2 (en) 2017-10-25 2017-10-25 IC card and terminal equipment

Publications (2)

Publication Number Publication Date
JP2019079349A JP2019079349A (en) 2019-05-23
JP6926945B2 true JP6926945B2 (en) 2021-08-25

Family

ID=66627905

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2017206564A Active JP6926945B2 (en) 2017-10-25 2017-10-25 IC card and terminal equipment

Country Status (1)

Country Link
JP (1) JP6926945B2 (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63785A (en) * 1986-06-20 1988-01-05 Toshiba Corp Portable electronic equipment
JP2008310596A (en) * 2007-06-14 2008-12-25 Toshiba Corp Portable electronic device and method for controlling portable electronic device
FR2983622B1 (en) * 2011-12-02 2014-01-24 Morpho WRITING DATA IN A NON-VOLATILE MEMORY OF A CHIP CARD

Also Published As

Publication number Publication date
JP2019079349A (en) 2019-05-23

Similar Documents

Publication Publication Date Title
US9183400B2 (en) IC card and IC card control method
JP5259513B2 (en) Portable electronic device, IC card, and portable electronic device control method
JP2025097584A (en) Electronic information storage medium, ic chip, ic card, element data storage method, and program
JP4891587B2 (en) Portable electronic device, IC card and IC module
JP6926945B2 (en) IC card and terminal equipment
JP6769265B2 (en) Electronic information storage medium, IC card, data abnormality confirmation method, and data abnormality confirmation program
JP5301018B2 (en) Portable electronic device
JP7468757B1 (en) ELECTRONIC INFORMATION STORAGE MEDIUM, IC CHIP, IC CARD, RESPONSE TRANSMISSION METHOD, AND PROGRAM
EP3379424B1 (en) Ic card, portable electronic device, program, processing apparatus, and processing system
JP4868979B2 (en) Portable electronic device and IC card
JPH09231113A (en) IC card
JP6984328B2 (en) Electronic information storage medium, IC card, external device, data writing method and data writing program
JP7420179B1 (en) Electronic information storage medium, IC card, issuance processing method, and program
JP7438432B1 (en) Electronic information storage medium, IC chip, IC card, record writing method, and program
JP7468765B1 (en) ELECTRONIC INFORMATION STORAGE MEDIUM, IC CHIP, IC CARD, ALL-IN-ONE DATA UPDATE METHOD, AND PROGRAM
JP6325394B2 (en) IC card, portable electronic device, and IC card processing device
JP2016081344A (en) Ic card, portable electronic device, and ic card processing device
JPH05100961A (en) Data storage system
JP6823289B2 (en) IC card and computer program
US7346730B2 (en) Mobile electronic device
JP6039036B2 (en) IC card, portable electronic device, and control method of IC card
JPH04205291A (en) Ic card and information transmitting system
JP2025122710A (en) Electronic information storage medium, IC chip, record processing method, and program
JP5085055B2 (en) IC card and IC module
JP5492172B2 (en) Portable electronic device, IC card and IC module

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20200828

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20210624

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: 20210706

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20210719

R150 Certificate of patent or registration of utility model

Ref document number: 6926945

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150