JP5883295B2 - IC card - Google Patents

IC card Download PDF

Info

Publication number
JP5883295B2
JP5883295B2 JP2012006396A JP2012006396A JP5883295B2 JP 5883295 B2 JP5883295 B2 JP 5883295B2 JP 2012006396 A JP2012006396 A JP 2012006396A JP 2012006396 A JP2012006396 A JP 2012006396A JP 5883295 B2 JP5883295 B2 JP 5883295B2
Authority
JP
Japan
Prior art keywords
record
card
command
read
record file
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
JP2012006396A
Other languages
Japanese (ja)
Other versions
JP2013145523A (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.)
Toshiba Corp
Original Assignee
Toshiba Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Toshiba Corp filed Critical Toshiba Corp
Priority to JP2012006396A priority Critical patent/JP5883295B2/en
Publication of JP2013145523A publication Critical patent/JP2013145523A/en
Application granted granted Critical
Publication of JP5883295B2 publication Critical patent/JP5883295B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明の実施形態は、一括読出し可能なICカードに関する。   Embodiments described herein relate generally to an IC card capable of batch reading.

ICカードは、ICカードリーダ・ライタ(R/W)を備えた端末上のアプリケーション、あるいは、この端末とネットワーク接続されたサーバ又は端末上のアプリケーションによって、外部端末からアクセスされる。外部端末からICカード内の複数のレコードEF(エレメンタリファイル)ID内レコードを読み出す場合、現状では、ICカードリーダ・ライタ(R/W)がレコードEF−IDと、そのID内のレコード番号を指定し、ICカードはICカードリーダ・ライタからの命令を解釈し、指定ID内のレコード番号で指定されたレコードを読み出す、という処理を繰り返す。   The IC card is accessed from an external terminal by an application on a terminal equipped with an IC card reader / writer (R / W), or an application on a server or terminal connected to the terminal via a network. When reading a plurality of record EF (elementary file) ID records in the IC card from an external terminal, at present, the IC card reader / writer (R / W) uses the record EF-ID and the record number in the ID. The IC card repeats the process of interpreting the command from the IC card reader / writer and reading the record specified by the record number in the specified ID.

なお、上記レコードEF(Elementary File:エレメンタリファイル)とは、ISO/IEC 7816-4で規定されているデータを格納するファイルである。   The record EF (Elementary File) is a file that stores data defined in ISO / IEC 7816-4.

図6は、従来の偶数INS READ RECORD命令の命令形式及び応答形式の一例である。図7は、ICカードリーダ・ライタ(R/W)から送信された偶数INS READ RECORD命令に対するICカードのファイルアクセス処理を示すフローチャートである。図8は、ICカードとICカードリーダ・ライタとの通信処理を説明する図である。以下、これらの図を参照して従来のICカードのファイルアクセス処理を説明する。   FIG. 6 shows an example of the command format and response format of the conventional even INS READ RECORD command. FIG. 7 is a flowchart showing an IC card file access process in response to an even INS READ RECORD command transmitted from the IC card reader / writer (R / W). FIG. 8 is a diagram for explaining communication processing between an IC card and an IC card reader / writer. Hereinafter, a conventional IC card file access process will be described with reference to these drawings.

まず、ICカードにおける従来のファイルアクセス方法において、2つのレコードEF−ID(EF#1, EF#2)からそれぞれのレコード(record#1(EF#1),record#2(EF#2))を読み出す例を記述する。   First, in the conventional file access method in the IC card, each record (record # 1 (EF # 1), record # 2 (EF # 2)) is obtained from two records EF-ID (EF # 1, EF # 2). An example of reading is described.

まず、図6に従来の偶数INS READ RECORD命令の命令形式を示す。図6(1)は、従来の偶数INS READ RECORD命令形式である。この命令形式は、CLA/INS/P1/P2/ Le で構成されている。P1では、P2で指定されるレコードEFのレコード番号を指定し、P2で短縮EF−IDを指定する。図6(2)は、図6(1)に示す偶数INS READ RECORD命令に対するICカードからR/Wに対する応答形式である。なお、上記「応答」を表現上の誤解を防ぐため「応答メッセージ」と表記する場合もある。   First, FIG. 6 shows a command format of a conventional even INS READ RECORD command. FIG. 6A shows a conventional even number INS READ RECORD command format. This command format consists of CLA / INS / P1 / P2 / Le. In P1, the record number of the record EF designated in P2 is designated, and the shortened EF-ID is designated in P2. FIG. 6 (2) shows a response format from the IC card to the R / W in response to the even INS READ RECORD command shown in FIG. 6 (1). The “response” may be described as a “response message” in order to prevent misunderstanding in terms of expression.

2つのレコードEF−ID(EF#1、EF#2)からそれぞれ指定したレコード番号のレコード(record#1(EF#1), record#2(EF#2))を読み出す場合、図6(1)で示す命令をR/WがICカードに送信し、図6(2)で示す令処理結果を応答メッセージとしてICカードがR/W返送する。図示した例は、2つのレコードを読み出すために図6(1)及び図6(3)に示す偶数INS READ RECORD命令を送信し、図6(2)及び図6(4)に示す命令処理結果を応答メッセージとして返送している。   When reading the records (record # 1 (EF # 1), record # 2 (EF # 2)) with the specified record numbers from the two records EF-ID (EF # 1, EF # 2), respectively, the information shown in FIG. The R / W transmits a command indicated by () to the IC card, and the IC card returns the R / W as a response message with the command processing result shown in FIG. In the illustrated example, the even INS READ RECORD command shown in FIGS. 6 (1) and 6 (3) is transmitted to read two records, and the command processing results shown in FIGS. 6 (2) and 6 (4) are transmitted. Is returned as a response message.

図7は、R/Wから送信された偶数INS READ RECORD命令に対するICカードの従来のファイルアクセス処理を示すフローチャートである。また、図8は、ICカードとR/Wとの通信処理を示すフローチャートで、READ RECORD 命令が2個連続した場合の処理を示すフローチャートである。以下、これらの図を参照して従来のファイルアクセス処理を説明する。   FIG. 7 is a flowchart showing a conventional file access process of the IC card in response to the even INS READ RECORD command transmitted from the R / W. FIG. 8 is a flowchart showing communication processing between the IC card and the R / W, and is a flowchart showing processing in a case where two READ RECORD commands are consecutive. A conventional file access process will be described below with reference to these drawings.

(1)R/WからREAD RECORD命令送信
R/WがICカードに、READ RECORD 命令のP1−P2でレコードEF#1のレコード#1を指定したREAD RECORD 命令 (READ RECORD record#1(EF#1))を送信する。
(1) Transmission of READ RECORD command from R / W R / W sends a READ RECORD command (READ RECORD record # 1 (EF #) that specifies record # 1 of record EF # 1 in P1-P2 of the READ RECORD command to the IC card. Send 1)).

(2)ICカードREAD RECORD命令受信
ICカードがR/Wから、READ RECORD 命令のP1−P2でレコードEF#1のレコード#1を指定したREAD RECORD 命令 (READ RECORD record#1(EF#1))を受信する。
(2) IC card READ RECORD command received The IC card reads from the R / W the READ RECORD command (READ RECORD record # 1 (EF # 1)) that specifies record # 1 of record EF # 1 in P1-P2 of the READ RECORD command ).

(3)ICカードREAD RECORD命令処理
ICカードは、READ RECORD 命令 (READ RECORD record#1(EF#1))のP2で指定されているレコードEF#1のP1で指定されているレコード#1を検索する(S20−S21)。レコードEF#1が存在しなければ(S24のNo)命令処理結果に応じたSW(異常)を送信バッファにセットし(S28)、R/Wに送信し(S29)、レコードEF#1内のレコード#1が存在しなければ(S26のNo)、命令処理結果に応じたSW(異常)を送信バッファにセットし(S28)、R/Wに送信する(S29)。
(3) IC card READ RECORD command processing The IC card reads record # 1 specified by P1 of record EF # 1 specified by P2 of READ RECORD command (READ RECORD record # 1 (EF # 1)). Search is performed (S20-S21). If the record EF # 1 does not exist (No in S24), the SW (abnormality) corresponding to the instruction processing result is set in the transmission buffer (S28), transmitted to the R / W (S29), and the record EF # 1 If record # 1 does not exist (No in S26), SW (abnormal) corresponding to the instruction processing result is set in the transmission buffer (S28), and transmitted to the R / W (S29).

(4)ICカードレスポンス送信処理
ICカードは、レコード#1のレコードデータ、SW(正常)を送信バッファにセットし(S27)、READ RECORD 命令(READ RECORD record#1(EF#1))処理結果を送信する(S29)。
(4) IC card response transmission processing The IC card sets the record data of record # 1, SW (normal) in the transmission buffer (S27), and the result of the READ RECORD command (READ RECORD record # 1 (EF # 1)) Is transmitted (S29).

(5)R/WからREAD RECORD命令送信
R/WがICカードに、READ RECORD 命令のP1−P2でレコードEF−ID#2(レコードEF#2と記述する)のレコード#2を指定したREAD RECORD 命令 (READ RECORD record#2(EF#2))を送信する。
(5) READ RECORD command transmission from R / W R / W specifies the record # 2 of record EF-ID # 2 (described as record EF # 2) in P1-P2 of the READ RECORD command to the IC card. Send RECORD command (READ RECORD record # 2 (EF # 2)).

(6)ICカードREAD RECORD命令受信
ICカードがR/Wから、READ RECORD 命令のP1−P2でレコードEF#2のレコード#2を指定したREAD RECORD 命令 (READ RECORD record#2(EF#2))を受信する。
(6) IC card READ RECORD command received The IC card reads from R / W the READ RECORD command (READ RECORD record # 2 (EF # 2)) that specifies record # 2 of record EF # 2 in P1-P2 of the READ RECORD command ).

(7)ICカードREAD RECORD命令処理
ICカードは、READ RECORD 命令 (READ RECORD record#2(EF#2))のP2で指定されているレコードEF#2のP1で指定されているレコード#2を検索する。レコードEF#2が存在しなければ(S24のNo)、命令処理結果に応じたSW(異常)を送信バッファにセットし(S28)、R/Wに送信し(S29)、レコードEF#2内のレコード#2が存在しなければ(S26のNo)、命令処理結果に応じたSW(異常)を送信バッファにセットし(S28)、R/Wに送信する(S29)。
(7) IC card READ RECORD command processing The IC card reads record # 2 specified by P1 of record EF # 2 specified by P2 of READ RECORD command (READ RECORD record # 2 (EF # 2)). Search for. If the record EF # 2 does not exist (No in S24), the SW (abnormality) corresponding to the instruction processing result is set in the transmission buffer (S28), transmitted to the R / W (S29), and in the record EF # 2 If there is no record # 2 (No in S26), SW (abnormal) corresponding to the instruction processing result is set in the transmission buffer (S28), and transmitted to the R / W (S29).

(8)ICカードレスポンス送信処理
ICカードは、レコード#2のレコードデータ、SW(正常)を送信バッファにセットし(S27)、READ RECORD 命令(READ RECORD record#2(EF#2))処理結果を送信する(S29)。
(8) IC card response transmission processing The IC card sets the record data of record # 2, SW (normal) in the transmission buffer (S27), and the result of the READ RECORD command (READ RECORD record # 2 (EF # 2)) Is transmitted (S29).

(9)R/WからREAD RECORD命令送信
R/WがICカードに、READ RECORD 命令のP1−P2でレコードEF#2のレコード#2を指定したREAD RECORD 命令 (READ RECORD record#2(EF#2))を送信する。
(9) READ RECORD command transmission from R / W R / W sends a READ RECORD command (READ RECORD record # 2 (EF #) that specifies record # 2 of record EF # 2 in P1-P2 of the READ RECORD command to the IC card. Send 2)).

(10)上記(2)から(8)に示す処理を行う。この処理によってレコード#1及びレコード#2のデータがICカードからR/Wに送信される。 (10) The processes shown in (2) to (8) above are performed. By this process, the data of record # 1 and record # 2 is transmitted from the IC card to the R / W.

なお、一回に送信可能なデータ量の最大値を規定しないことにより、読み出すデータの量が多くても読み出しにおけるコマンド/レスポンス処理が一回で済む方法が知られている(例えば、特許文献1参照。)。   A method is known in which the maximum value of the data amount that can be transmitted at one time is not defined, so that even if the amount of data to be read is large, the command / response process in reading can be performed only once (for example, Patent Document 1). reference.).

特開2007−122451号公報JP 2007-122451 A

しかしながら、上述した従来の技術では、複数のレコードEF−IDから複数のレコードを読み出す場合、ICカードリーダ・ライタ(R/W)がレコードEF−IDとそのID内のレコード番号を指定し、ICカードはR/Wからの命令を解釈し、指定ID内の指定レコードを読み出す処理を繰り返す。これにより、R/Wからの命令をICカードが解釈する回数が増え、ICカードのファイルアクセスにおける処理時間が増えるという課題があった。なお、特許文献1記載の方法は、大量データの送受信を行うため通信状態が安定にできる領域での使用が推奨されている。   However, in the conventional technique described above, when reading a plurality of records from a plurality of records EF-ID, the IC card reader / writer (R / W) designates the record EF-ID and the record number in the ID, and the IC The card interprets the command from the R / W and repeats the process of reading the designated record in the designated ID. As a result, the number of times the IC card interprets instructions from the R / W increases, and there is a problem that the processing time for file access of the IC card increases. Note that the method described in Patent Document 1 is recommended to be used in an area where the communication state can be stabilized because a large amount of data is transmitted and received.

本発明は、上述した課題を解決するためになされたもので、ICカードの記憶部に記憶された異なるレコードEF−ID内の異なるレコードを、一括読出すことにより、ICカードのファイルアクセスにおける全体の処理時間を短縮することができるICカードを提供することを目的とする。   The present invention has been made in order to solve the above-described problems. By reading different records in different records EF-ID stored in the storage unit of the IC card in batch, the entire file access of the IC card can be performed. An object of the present invention is to provide an IC card capable of shortening the processing time.

上記目的を達成するために、本発明の請求項1記載のICカードは、制御部、記憶部及び通信部を有して構成され、外部端末から送信されたヘッダ領域及びボディ領域で構成された命令を受信し、この命令を解釈、実行してその結果を応答として前記外部端末に送信するICカードにおいて、前記通信部は、前記外部端末から受信した命令を前記記憶部に記憶し、前記制御部は、前記記憶部に記憶された前記ボディ領域内の命令データ部に、メモリ領域を示すレコードファイルIDとそのレコードファイルID内のレコードを指定するためのレコード番号との対が複数指定されている場合、当該指定された複数のレコードファイルIDと対になるレコード番号のデータを前記記憶部に設けられた送信バッファに設定し、前記通信部は、前記送信バッファに設定されたデータを前記外部端末に送信する。 In order to achieve the above object, an IC card according to claim 1 of the present invention includes a control unit, a storage unit, and a communication unit, and includes a header region and a body region transmitted from an external terminal. In an IC card that receives an instruction, interprets and executes the instruction, and transmits the result to the external terminal as a response, the communication unit stores the instruction received from the external terminal in the storage unit, and the control In the command data section in the body area stored in the storage section, a plurality of pairs of record file IDs indicating memory areas and record numbers for specifying records in the record file IDs are specified. If there is, the record number data paired with the specified plurality of record file IDs is set in the transmission buffer provided in the storage unit, and the communication unit Sending a data set in the buffer to the external terminal.

実施例1に係るICカードの概略構成図1 is a schematic configuration diagram of an IC card according to a first embodiment. 実施例1に係るICカードリーダ・ライタとICカード間の通信プロトコルの一例Example of communication protocol between IC card reader / writer and IC card according to embodiment 1 実施例1に係るREAD RECORD命令形式とレスポンス形式READ RECORD command format and response format according to the first embodiment ICカードリーダ・ライタから送信された偶数INS READ RECORD命令に対するICカードのファイルアクセス処理を示すフローチャートFlowchart showing IC card file access processing for even INS READ RECORD command transmitted from IC card reader / writer 実施例1に係るICカードとICカードリーダ・ライタとの通信処理を示すフローチャート1 is a flowchart showing communication processing between an IC card and an IC card reader / writer according to the first embodiment. 従来の偶数INS READ RECORD命令の命令形式及び応答形式の一例Example of command format and response format of conventional even INS READ RECORD command R/Wから送信された偶数INS READ RECORD命令に対するICカードの従来のファイルアクセス処理を示すフローチャートThe flowchart which shows the conventional file access processing of the IC card with respect to the even INS READ RECORD command transmitted from the R / W ICカードとR/Wとの従来の通信処理を示すフローチャートA flowchart showing conventional communication processing between an IC card and an R / W

本実施例に係るICカードは、制御部、記憶部及び通信部を有して構成される。制御部としてCPU(Central Processing Unit:中央処理装置)が配置される。また、記憶部としてROM(Read Only Memory:読み取り専用メモリ)、RAM(Random Access Memory:揮発性メモリ)及びNVM(Non-volatile memory:不揮発性メモリ)が配置される。通信部は、ICカード10内に設けられた外部端子を介してICカードリーダ・ライタ(端末)20と通信を行う。   The IC card according to this embodiment includes a control unit, a storage unit, and a communication unit. A CPU (Central Processing Unit) is arranged as a control unit. In addition, a ROM (Read Only Memory), a RAM (Random Access Memory), and an NVM (Non-volatile memory) are arranged as storage units. The communication unit communicates with the IC card reader / writer (terminal) 20 via an external terminal provided in the IC card 10.

以下、ICカード10とICカードリーダ・ライタ20との通信において、一括読み出しできるICカードのファイルアクセス処理機能を、以下図面を参照して説明する。   Hereinafter, a file access processing function of an IC card that can be collectively read in communication between the IC card 10 and the IC card reader / writer 20 will be described with reference to the drawings.

図1は、実施例1に係るICカードの概略構成図である。ICカード10は、制御部及び通信部で構成される。   FIG. 1 is a schematic configuration diagram of an IC card according to the first embodiment. The IC card 10 includes a control unit and a communication unit.

制御部はCPU11を有し、記憶部はROM13、RAM14及びNVM15を有して構成される。ROM13及びNVM15は、当該CPU11を動作するためのプログラムが実装される。   The control unit includes a CPU 11, and the storage unit includes a ROM 13, a RAM 14, and an NVM 15. A program for operating the CPU 11 is mounted on the ROM 13 and the NVM 15.

通信部12は、接触端子を介した接触式ICカード(以下。ICカードと称する。)10とICカードリーダ・ライタ(端末)20との間の通信を行う。   The communication unit 12 performs communication between a contact IC card (hereinafter referred to as an IC card) 10 and an IC card reader / writer (terminal) 20 via a contact terminal.

図2は、実施例1に係るICカードリーダ・ライタ20とICカード10間の通信プロトコルの一例である。ICカード10とICカードリーダ・ライタ20との間の通信で用いられるプロトコルには国際規格があり、通常は、この国際規格に基づくプロトコルに応じて送受信が行われる。本実施例で用いられるプロトコルは、ISO/IEC 7816に準拠している。このプロトコルは、ICカード10とICカードリーダ・ライタ20間の基本命令、ファイル構造及びセキュリティの基本構造を規定している。   FIG. 2 is an example of a communication protocol between the IC card reader / writer 20 and the IC card 10 according to the first embodiment. There are international standards for protocols used for communication between the IC card 10 and the IC card reader / writer 20, and transmission and reception are usually performed according to protocols based on the international standards. The protocol used in this embodiment conforms to ISO / IEC 7816. This protocol defines basic instructions, file structure, and basic security structure between the IC card 10 and the IC card reader / writer 20.

図2(1)は、本実施例に用いられるICカードリーダ・ライタ(端末)20からICカード10に対する命令形式(コマンドフォーマット)である。   FIG. 2A shows an instruction format (command format) for the IC card 10 from the IC card reader / writer (terminal) 20 used in the present embodiment.

命令部分はCLA、INS、P1及びP2からなる4バイトのヘッダ領域で構成され、ICカード10に対する命令を構成する。   The command part is composed of a 4-byte header area consisting of CLA, INS, P1 and P2, and constitutes a command for the IC card 10.

INS:具体的な命令内容を示す。 INS: Indicates specific instruction content.

Lc、Data Field(命令データ部)及びLeは、送信するデータがある場合に用いられるボディ領域を構成するが、READ RECORD命令では、LC、Data FieldがなくてもLeは必要になる。 Lc, Data Field (command data part), and Le constitute a body region used when there is data to be transmitted. In the READ RECORD command, Le is required even without LC and Data Field.

Lc:Data Fieldのサイズ
Data Field:Lcで示されるサイズのデータ
Le:レスポンスの最大サイズ
ICカードからICカードリーダ・ライタに対する応答時のデータサイズ
上述したボディ領域は、オプションであり、設定されない場合もあるが本実施例では使用している。なお、詳細は後述する。
Lc: Data Field size
Data Field: Data of the size indicated by Lc Le: Maximum response size Data size at the time of response from the IC card to the IC card reader / writer The body area described above is optional and may not be set. I use it. Details will be described later.

図2(2)は、本実施例に用いられるICカード10からICカードリーダ・ライタ20に対するステータスフォーマットである。このフォーマットは、ステータスワードの前にレコードデータ領域からなるボディ領域を有する。このレコードデータのデータサイズは、図2(1)で示すLeで指定した値以下に設定される。   FIG. 2B shows a status format from the IC card 10 to the IC card reader / writer 20 used in this embodiment. This format has a body area consisting of a record data area before the status word. The data size of this record data is set to be equal to or smaller than the value designated by Le shown in FIG.

SW1、SW2:ステータスワードと呼ばれ、命令が成功したかを示す値と、命令が失敗した理由を示す値で構成される。その一例を下記に示す。   SW1, SW2 are called status words and are composed of a value indicating whether the instruction has been successful and a value indicating the reason why the instruction has failed. An example is shown below.

SW1 SW2
90 00・・・・・正常終了
62 00・・・・・照合不一致
62 83・・・・・出力データに異常がある
図3は、実施例1に係るREAD RECORD 命令形式とレスポンス形式であり、図2に示す命令形式及びステータスフォーマットの詳細図である。
SW1 SW2
90 00: Normal end 62 00: Verification mismatch 62 83: Abnormality in output data FIG. 3 shows a READ RECORD command format and a response format according to the first embodiment. FIG. 3 is a detailed view of an instruction format and a status format shown in FIG. 2.

図3(1)は、本実施例の偶数INS READ RECORD命令の命令形式とレスポンス形式を示す。   FIG. 3A shows the command format and response format of the even INS READ RECORD command of this embodiment.

上記命令形式を以下に示す。   The above instruction format is shown below.

[CLA][INS][P1][P2][DATA Field][Le]
INS:B2・・・・偶数INS READ RECORD、偶数命令になっている
Lc :04・・・・Data Field のデータサイズが4バイトであることを示す
Data Field
01:レコード#1(レコード番号1のこと)
下記、短縮EF−ID#1で指定された最初のレコードRC11を示す(図3(3)参照)。
[CLA] [INS] [P1] [P2] [DATA Field] [Le]
INS: B2... Even INS READ RECORD, Lc in even instruction: 04... Indicates that the data size of the data field is 4 bytes.
Data Field
01: Record # 1 (record number 1)
The following shows the first record RC11 designated by the abbreviated EF-ID # 1 (see FIG. 3 (3)).

01:短縮EF−ID#1
短縮EF−ID#1とは、図3(3)に示すメモリ領域(短縮EF−ID#1)のことであり、このメモリ領域にはレコード#1〜レコード#n個のレコードが存在する。
01: Short EF-ID # 1
The shortened EF-ID # 1 is a memory area (shortened EF-ID # 1) shown in FIG. 3 (3), and there are records # 1 to #n in this memory area.

02:レコード#2
下記、短縮EF−ID#2で指定された2番目のレコード(#2)RC22を示す(図3(3)参照)。
02: Record # 2
The second record (# 2) RC22 designated by the shortened EF-ID # 2 is shown below (see FIG. 3 (3)).

02:短縮EF−ID#2
短縮EF−ID#2とは、図3(3)に示すメモリ領域(短縮EF−ID#2)のことであり、このメモリ領域にはレコード#1〜レコード#n(レコード番号nのこと)個のレコードが存在する。
02: Short EF-ID # 2
The shortened EF-ID # 2 is a memory area (shortened EF-ID # 2) shown in FIG. 3 (3). In this memory area, record # 1 to record #n (record number n). Records exist.

Le :00・・・・レスポンスの最大サイズ、00の場合、レポンスサイズは制限なし。 Le: 00 ···· maximum size of the response, the case of 00, Les scan Pons size is no limit.

本実施例では、P1、P2は使用せずにアクセスするレコードEFの短縮EF−IDとその内部のレコード番号対は、すべて[Data Field]で指定する。   In the present embodiment, the shortened EF-ID of the record EF accessed without using P1 and P2 and the record number pair in the record EF are all specified by [Data Field].

図3(2)は、本実施例の偶数INS READ RECORD命令に対するICカードのレスポンスである。このレスポンスは、ISO/IEC 7816-3準拠のR−APDU(Response Application Protocol Data Unit)で示され、下記にその形式を示す。   FIG. 3B is a response of the IC card to the even INS READ RECORD command of this embodiment. This response is indicated by R-APDU (Response Application Protocol Data Unit) conforming to ISO / IEC 7816-3, and the format is shown below.

[(response)Data][SW1][SW2]
[(response)Data]の形式をTLV DATA objectにBER-TLVを使用して独自に規定した。
[(response) Data] [SW1] [SW2]
The format of [(response) Data] was uniquely defined using BER-TLV for TLV DATA object.

図3(3)は、上述した短縮EF−IDに対するレコードを説明するメモリマップの構造である。すでに上記図3(1)のビット説明に合わせて説明した通りである。   FIG. 3 (3) shows a memory map structure for explaining a record for the above-mentioned shortened EF-ID. This has already been described in accordance with the bit description in FIG.

なお、短縮EF−IDの短縮とは、上記メモリマップ内EF−IDの位置を説明する上で短縮した表現形式を用いていることを示す。   Note that the shortening of the shortened EF-ID indicates that a shortened expression format is used for explaining the position of the EF-ID in the memory map.

図3(1)の命令形式で指示した短縮EF−IDとレコード番号対がその順番通りに読み出され、[(response)DATA]は、record#1(EF#1)とrecord#2(EF#2)の[Tag][Length][Value]が連結した[Tag][Length][Value(record#1(EF#1))][Tag][Length][Value(record#2(EF#2))]
からなる。なお、Tagは請求項に記載のタグに該当する。
The abbreviated EF-ID and record number pair specified in the instruction format of FIG. 3 (1) are read in the order, and [(response) DATA] is record # 1 (EF # 1) and record # 2 (EF [Tag] [Length] [Value (record # 1 (EF # 1))] [Tag] [Length] [Value (record # 2 (EF # 2))]
Consists of. Tag corresponds to the tag described in the claims.

2つのレコードEF−ID(EF#1,EF#2)からそれぞれのレコード(record#1(EF#1)),record#2(EF#2))を読み出す場合、図3(1)で表わされる命令形式を用いてICカードリーダ・ライタ20がICカード10に送信し、図3(2)で表わされるレスポンス形式を用いてICカード10がICカードリーダ・ライタ20に命令の処理結果を送信(返送)する。   When each record (record # 1 (EF # 1)), record # 2 (EF # 2)) is read from two records EF-ID (EF # 1, EF # 2), it is represented by (1) in FIG. The IC card reader / writer 20 transmits the command processing result to the IC card 10 using the command format, and the IC card 10 transmits the processing result of the command to the IC card reader / writer 20 using the response format shown in FIG. (Return).

図4は、ICカードリーダ・ライタ20から送信された偶数INS READ RECORD命令に対するICカードのファイルアクセス処理を示すフローチャートである。   FIG. 4 is a flowchart showing file access processing of the IC card in response to the even INS READ RECORD command transmitted from the IC card reader / writer 20.

最初に、READ RECORD 命令(READ RECORD read#1(EF#1)(1st), READ RECORD read#2(EF#2)(2nd))を受信後、当該命令のP1、P2をチェックする(S01)。   First, after receiving a READ RECORD command (READ RECORD read # 1 (EF # 1) (1st), READ RECORD read # 2 (EF # 2) (2nd)), P1 and P2 of the command are checked (S01). ).

P1=00かつP2=FFの場合(S02のYes)、READ RECORD 命令のLcをチェックする(S03)。なお、ステップS02でP1=00かつP2=FFでない場合は、ステップS14に移行し、命令処理に応じたSW(異常)を送信バッファにセットし(S14)、ステップS15で当該SWをICカードリーダ・ライタ20に送信する(S15)。   If P1 = 00 and P2 = FF (Yes in S02), the Lc of the READ RECORD instruction is checked (S03). If P1 = 00 and P2 = FF are not satisfied in step S02, the process proceeds to step S14, the SW (abnormality) corresponding to the command processing is set in the transmission buffer (S14), and the SW is set in the IC card reader in step S15. Transmit to the writer 20 (S15).

上記Lc(Data Fieldのサイズ)が00でない場合(S04のYes)、連続実行制御カウンタにLcの値をセットする(S05)。なお、Lcが00の場合は、Data Fieldに検索対象のデータがないため、上述同様ステップS14に移行し、命令処理に応じたSW(異常)を送信バッファにセットし(S14)、ステップS15で当該SWをICカードリーダ・ライタ20に送信する(S15)。   If Lc (Data Field size) is not 00 (Yes in S04), the value of Lc is set in the continuous execution control counter (S05). If Lc is 00, since there is no data to be searched in the Data Field, the process proceeds to step S14 as described above, SW (abnormal) corresponding to the command processing is set in the transmission buffer (S14), and in step S15 The SW is transmitted to the IC card reader / writer 20 (S15).

上記Lcに関し、図3(1)に示す実施例の場合を下記に示す。   Regarding the above Lc, the case of the embodiment shown in FIG.

Lc=04
検索対象に命令データ部からEFの識別子(EF#1)とその内部のレコード対(レコード#1)をセットする(S06)。実施例の場合を下記に示す。
Lc = 04
An EF identifier (EF # 1) and an internal record pair (record # 1) are set from the instruction data portion to the search target (S06). The case of an example is shown below.

EFの識別子(EF#1) :01・・・短縮EF−ID#1
短縮EF(Element File)のID番号が1であることを示す。
レコード対(レコード#1):01・・・短縮EF−ID#2
短縮EF(Element File)のID番号が2であることを示す。
ICカードは、レコードEF#1(レコードEF#1と記述する)の識別子から、レコードEF#1を検索する(S07)。この検索の結果、検索対象のレコードEF#1が存在すれば(S08のYes)、ICカードはレコードEF#1の中から、レコード#1を検索する(S09)。
EF identifier (EF # 1): 01... Shortened EF-ID # 1
It indicates that the ID number of the shortened EF (Element File) is 1.
Record pair (record # 1): 01... Shortened EF-ID # 2
This indicates that the ID number of the shortened EF (Element File) is 2.
The IC card searches for the record EF # 1 from the identifier of the record EF # 1 (described as record EF # 1) (S07). If the search target record EF # 1 exists as a result of this search (Yes in S08), the IC card searches for the record # 1 from the record EF # 1 (S09).

この検索の結果、レコード#1が存在すれば(S10のYes)、レコードEF#1のレコードデータ、SW(SW1、SW2の総称)(正常)を送信バッファにセットする。実施例では上述したようにSWには下記の値がセットされる。   If record # 1 exists as a result of this search (Yes in S10), the record data of record EF # 1, SW (generic name for SW1 and SW2) (normal) is set in the transmission buffer. In the embodiment, as described above, the following values are set in SW.

SW1 SW2
90 00
なお、ステップS08で検索対象のレコードEF#1が存在しない場合(S08のNo)及び当該検索対象レコード#1が存在しない場合(S10のNo)、上記同様にステップS14に移行し、命令処理に応じたSW(異常)を送信バッファにセットし(S14)、ステップS15で当該SWをICカードリーダ・ライタ20に送信する(S15)。
SW1 SW2
90 00
If the search target record EF # 1 does not exist in step S08 (No in S08) and the search target record # 1 does not exist (No in S10), the process proceeds to step S14 in the same manner as described above, and command processing is performed. The corresponding SW (abnormality) is set in the transmission buffer (S14), and the SW is transmitted to the IC card reader / writer 20 in step S15 (S15).

連続実行制御カウンタを2減算する(S12)。連続制御実行カウンタが0でなければ(S13のNo)、上述したステップS06以降の処理を行う。ただし、検索対象に命令データ部からEFの識別子(EF#2)とその内部のレコード番号対(レコード#2)に関して上述したEFの識別子(EF#1)の場合と同様の処理をステップS06からステップS12で行う。   The continuous execution control counter is decremented by 2 (S12). If the continuous control execution counter is not 0 (No in S13), the processing from step S06 described above is performed. However, the same processing as in the case of the EF identifier (EF # 1) described above with respect to the EF identifier (EF # 2) and the internal record number pair (record # 2) from the instruction data portion as the search target is performed from step S06. This is performed in step S12.

上記処理終了後、ステップS13において、連続制御カウンタが0になれば(S13のYes)、ICカードリーダ・ライタ20に応答メッセージを送信し、次の命令の受信待ち状態にする(S15)。   When the continuous control counter reaches 0 in step S13 after the above process is completed (Yes in S13), a response message is transmitted to the IC card reader / writer 20, and a next command reception wait state is set (S15).

なお、ステップS02でP1=00かつP2=FFでない場合は、ステップS14に移行し、命令処理に応じたSW(異常)を送信バッファにセットし(S14)、ステップS15で当該SWをICカードリーダ・ライタ20に送信する。   If P1 = 00 and P2 = FF are not satisfied in step S02, the process proceeds to step S14, the SW (abnormality) corresponding to the command processing is set in the transmission buffer (S14), and the SW is set in the IC card reader in step S15. Transmit to writer 20

図5は、ICカード10とICカードリーダ・ライタとの通信処理を示すフローチャートである。ICカードリーダ・ライタ20からREAD RECORD 命令が送信される。この命令は、図2(1)に示す命令形式に従って送信される(20a)。   FIG. 5 is a flowchart showing communication processing between the IC card 10 and the IC card reader / writer. A READ RECORD command is transmitted from the IC card reader / writer 20. This command is transmitted according to the command format shown in FIG. 2 (1) (20a).

ICカード10は、ICカードリーダ・ライタから受信したREAD RECORD 命令を受信し(10a)、図4に示すファイルアクセス処理フローチャートに従い、当該READ RECORD命令を実行する(10b)。   The IC card 10 receives the READ RECORD command received from the IC card reader / writer (10a), and executes the READ RECORD command according to the file access processing flowchart shown in FIG. 4 (10b).

READ RECORD 命令処理(10b)の処理結果は、レスポンスとしてICカード送信される(20b)。   The processing result of the READ RECORD command processing (10b) is transmitted as a response to the IC card (20b).

なお、従来技術でこの方法を用いることができなかった理由を下記に示す。
従来技術は、「現状では、1つの論理チャネル上にCurrent EFは、最大1つずつしか存在しえない。従って、レコードデータ読出命令でcurrent EFを対象にすると1つのファイルからレコード読み出しを実施する。」ので、従来技術では、「1つのREAD RECORD命令で、1つのファイルからしかレコードを読み出せない」ということになり、それを解決すべく上述した本実施例が考案された。
The reason why this method could not be used in the prior art will be described below.
According to the prior art, “Currently, there can be at most one Current EF on one logical channel. Therefore, when current EF is targeted by a record data read command, a record is read from one file. Therefore, according to the prior art, “a record can be read from only one file with one READ RECORD command”, and the above-described embodiment has been devised to solve this problem.

なお、上記Current EFとは、本実施例に記載のレコードEFに関し、選択中の操作可能なEFをいう。ここでは、レコードEF内の1個のレコードデータ読み出し命令に付き1個のレコードデータを読み出すことができる。   Note that the Current EF is an operable EF that is being selected with respect to the record EF described in the present embodiment. Here, one record data can be read per one record data read command in the record EF.

以上説明したように、本実施例の偶数INS READ RECORD命令形式のData Field を使用することにより、1つの命令で異なる複数のEFから、そのEF内レコードを一括して読み出すことができる。この方法によれば、ICカードが命令を解釈する回数が減り、ICカードの全体の処理時間を短縮することができる。   As described above, by using the data field of the even INS READ RECORD command format of this embodiment, the records in the EF can be read at once from a plurality of different EFs by one command. According to this method, the number of times the IC card interprets the command is reduced, and the entire processing time of the IC card can be shortened.

10 ICカード
10a READ RECORD 命令受信処理
10b ICカード命令処理
10c RERAD RECORD 命令処理結果送処理
20 ICカードリーダ・ライタ
20a READ RECOD 命令送信処理
10 IC card 10a READ RECORD command reception processing 10b IC card command processing 10c RERAD RECORD command processing result transmission processing 20 IC card reader / writer 20a READ RECOD command transmission processing

Claims (3)

制御部、記憶部及び通信部を有して構成され、外部端末から送信されたヘッダ領域及びボディ領域で構成された命令を受信し、この命令を解釈、実行してその結果を応答として前記外部端末に送信するICカードにおいて、
前記通信部は、
前記外部端末から受信した命令を前記記憶部に記憶し、
前記制御部は、
前記記憶部に記憶された前記ボディ領域内の命令データ部に、メモリ領域を示すレコードファイルIDとそのレコードファイルID内のレコードを指定するためのレコード番号との対が複数指定されている場合、当該指定された複数のレコードファイルIDと対になるレコード番号のデータを前記記憶部に設けられた送信バッファに設定し、
前記通信部は、
前記送信バッファに設定されたデータを前記外部端末に送信するICカード。
It is configured to have a control unit, a storage unit, and a communication unit, receives a command composed of a header region and a body region transmitted from an external terminal, interprets and executes this command, and sends the result as a response to the external In the IC card to be sent to the terminal,
The communication unit is
Storing the instruction received from the external terminal in the storage unit;
The controller is
When a plurality of pairs of record file IDs indicating memory areas and record numbers for specifying records in the record file IDs are specified in the instruction data part in the body area stored in the storage unit, Set the data of the record number paired with the specified plurality of record file IDs in the transmission buffer provided in the storage unit,
The communication unit is
An IC card that transmits data set in the transmission buffer to the external terminal.
前記制御部はまた、
前記記憶部に記憶された前記ボディ領域内の命令データ部に、メモリ領域を示すレコードファイルIDとそのレコードファイルID内のレコードを指定するためのレコード番号との対が複数指定されている場合、当該指定されたレコードファイルID及びその対になるレコード番号のそれぞれを検索対象として検索した結果、当該指定された複数のレコードファイルID又は当該レコードファイルIDと対になるレコード番号によって指定されたレコードのいずれかが存在しない場合、異常発生と判断し、異常発生時点で検索を終了して異常を示すステータスを返信する請求項1記載のICカード。
The controller is also
When a plurality of pairs of record file IDs indicating memory areas and record numbers for specifying records in the record file IDs are specified in the instruction data part in the body area stored in the storage unit, result of searching each of the specified record file ID and the record number that the pair as a search target, the record specified by the designated plurality of record file ID or the record file ID and a record number to be paired 2. The IC card according to claim 1, wherein if any of them does not exist, it is determined that an abnormality has occurred, the search is terminated at the time of occurrence of the abnormality, and a status indicating the abnormality is returned.
前記制御部はさらに、
前記記憶部に記憶された前記ボディ領域内の命令データ部に、メモリ領域を示すレコードファイルIDとそのレコードファイルID内のレコードを指定するためのレコード番号との対が複数指定されている場合、当該命令の処理結果として前記レコードファイルIDとそのレコードファイルID内のレコードを指定するためのレコード番号のそれぞれに対する処理結果を連結して、当該外部端末に送信するとき、レコードファイルIDとレコード番号をタグとして応答の先頭にセットして送信する請求項1又は請求項2記載のICカード。
The control unit further includes:
When a plurality of pairs of record file IDs indicating memory areas and record numbers for specifying records in the record file IDs are specified in the instruction data part in the body area stored in the storage unit, When the processing result for each of the record file ID and the record number for designating the record in the record file ID is concatenated as the processing result of the command and transmitted to the external terminal, each record file ID and the record number The IC card according to claim 1 , wherein the tag is transmitted at a head of a response as a tag.
JP2012006396A 2012-01-16 2012-01-16 IC card Active JP5883295B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012006396A JP5883295B2 (en) 2012-01-16 2012-01-16 IC card

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012006396A JP5883295B2 (en) 2012-01-16 2012-01-16 IC card

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2016018106A Division JP6097855B2 (en) 2016-02-02 2016-02-02 IC card

Publications (2)

Publication Number Publication Date
JP2013145523A JP2013145523A (en) 2013-07-25
JP5883295B2 true JP5883295B2 (en) 2016-03-09

Family

ID=49041270

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012006396A Active JP5883295B2 (en) 2012-01-16 2012-01-16 IC card

Country Status (1)

Country Link
JP (1) JP5883295B2 (en)

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4059452B2 (en) * 1997-08-29 2008-03-12 大日本印刷株式会社 IC card
JP3727907B2 (en) * 2002-06-28 2005-12-21 株式会社東芝 Issuing system and issuing method for portable electronic medium and portable electronic medium
JP2005011147A (en) * 2003-06-20 2005-01-13 Dainippon Printing Co Ltd Ic card and ic card program
JP2010009467A (en) * 2008-06-30 2010-01-14 Toshiba Corp Information storage medium, information processing system, and command method

Also Published As

Publication number Publication date
JP2013145523A (en) 2013-07-25

Similar Documents

Publication Publication Date Title
US7428992B2 (en) Secure device and system for issuing IC cards
US9894469B2 (en) NFC device with multiple secure elements
US6676022B1 (en) Smart card system with command queuing
JP6516133B2 (en) Communication device and communication system
JP2008522303A (en) Method, system, and microcontroller card for communicating application services from a microcontroller card to a terminal
JP6097855B2 (en) IC card
JP5976458B2 (en) IC card and portable electronic device
JP4468407B2 (en) Data management system, management server, data management method, and program
JP5883295B2 (en) IC card
JP4283611B2 (en) IC card remote control system
JP6194714B2 (en) Universal IC card and security attribute verification method
US9542632B2 (en) IC card, portable electronic device, and reader/writer
JP2008107991A (en) Information processing medium, program therefor, error processing method for information processing medium, and information processing system
JP6182940B2 (en) IC card, status word output method, and status word output processing program
JP4590201B2 (en) Data carrier and data carrier program
JP7005934B2 (en) Electronic information storage medium, IC card, data transmission method, data writing method, data transmission program and data writing program
JP5799754B2 (en) IC chip, processing method in IC chip, IC chip processing program, IC card, and portable terminal
JP2005011147A (en) Ic card and ic card program
JP5306079B2 (en) IC card, IC card processing device, and IC card processing system
JP7468757B1 (en) ELECTRONIC INFORMATION STORAGE MEDIUM, IC CHIP, IC CARD, RESPONSE TRANSMISSION METHOD, AND PROGRAM
JP2013191117A (en) Ic chip, atr response processing program, and atr response method
KR101455539B1 (en) Ic card and ic card control method
JP2013161310A (en) Ic card
JP5437163B2 (en) Information processing method, information processing apparatus, and information processing system
JP2013190987A (en) Ic card

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20141021

RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20150218

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20150728

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20150731

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20150925

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20160205

R151 Written notification of patent or utility model registration

Ref document number: 5883295

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

Free format text: JAPANESE INTERMEDIATE CODE: R313114

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350