JP2020013212A - Portable electronic device, IC card, and issuing device - Google Patents

Portable electronic device, IC card, and issuing device Download PDF

Info

Publication number
JP2020013212A
JP2020013212A JP2018133423A JP2018133423A JP2020013212A JP 2020013212 A JP2020013212 A JP 2020013212A JP 2018133423 A JP2018133423 A JP 2018133423A JP 2018133423 A JP2018133423 A JP 2018133423A JP 2020013212 A JP2020013212 A JP 2020013212A
Authority
JP
Japan
Prior art keywords
data
storage unit
command
information
card
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2018133423A
Other languages
Japanese (ja)
Inventor
西村 佐織
Saori Nishimura
佐織 西村
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
Toshiba Infrastructure Systems and Solutions Corp
Original Assignee
Toshiba Corp
Toshiba Infrastructure Systems and Solutions 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, Toshiba Infrastructure Systems and Solutions Corp filed Critical Toshiba Corp
Priority to JP2018133423A priority Critical patent/JP2020013212A/en
Publication of JP2020013212A publication Critical patent/JP2020013212A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Credit Cards Or The Like (AREA)

Abstract

To provide a portable electronic device, an IC card, and an issuing device that can restart an issuing process when the issuing process is interrupted halfway.SOLUTION: A portable electronic device according to an embodiment has a data storage unit, a final data information storage unit, a completion information storage unit, and a processing unit. The final data information storage unit stores data identification information in which a write process for storing, by a write request including data to be stored in the data storage unit and the data identification information, the data in the data storage unit was last successfully executed. The completion information storage unit stores, by the write request, completion information indicating whether or not an issuing process for storing data corresponding to an application in the data storage unit has been completed. When the completion information indicates that the issuing process has not been completed, the processing unit performs a process of transmitting the data identification information stored by the final data information storage unit.SELECTED DRAWING: Figure 3

Description

本発明の実施形態は、携帯可能電子装置、ICカード、及び発行装置に関する。   Embodiments of the present invention relate to a portable electronic device, an IC card, and an issuing device.

近年、IC(Integrated Circuit)チップを内蔵したICカードなどの携帯可能電子装置が広く使用されている。従来の携帯可能電子装置では、例えば、STORE DATAコマンドなどの書き込み要求のコマンドを用いて、ICチップ内に書き込む発行処理が実行される。しかしながら、従来の携帯可能電子装置では、書き込み要求のコマンドにより発行処理が実行されている途中で、例えば、接触不良などが発生して発行処理が中断されると、途中から発行処理を再開することが困難であり、携帯可能電子装置を廃棄する場合があった。   2. Description of the Related Art In recent years, portable electronic devices such as an IC card incorporating an IC (Integrated Circuit) chip have been widely used. In a conventional portable electronic device, for example, an issuance process of writing in an IC chip is executed using a write request command such as a STORE DATA command. However, in the conventional portable electronic device, if the issuance process is interrupted due to, for example, a contact failure while the issuance process is being executed by a write request command, the issuance process is restarted from the middle. And the portable electronic device is sometimes discarded.

特開2017−72932号公報JP 2017-72932 A

本発明が解決しようとする課題は、発行処理が途中中断された場合に、発行処理を再開することができる携帯可能電子装置、ICカード、及び発行装置を提供することである。   The problem to be solved by the present invention is to provide a portable electronic device, an IC card, and an issuing device that can restart the issuing process when the issuing process is interrupted halfway.

実施形態の携帯可能電子装置は、データ記憶部と、最終データ情報記憶部と、完了情報記憶部と、処理部とを持つ。データ記憶部は、データを記憶する。最終データ情報記憶部は、外部装置から受信したデータと、前記データを識別するデータ識別情報とを含んで、前記データ記憶部に書き込むよう要求する前記外部装置からのデータ書き込み要求によって、前記データを前記データ記憶部に記憶させる書き込み処理が、最後に正常に実行された前記データ識別情報を記憶する。完了情報記憶部は、前記書き込み要求によって、アプリケーションに対応したデータを前記データ記憶部に記憶させる発行処理が完了したか否かを示す完了情報を記憶する。処理部は、前記完了情報記憶部が記憶する前記完了情報が、前記発行処理が完了していないことを示す場合に、前記最終データ情報記憶部が記憶する前記データ識別情報を前記外部装置に送信する処理を行う。   The portable electronic device according to the embodiment has a data storage unit, a final data information storage unit, a completion information storage unit, and a processing unit. The data storage unit stores data. The final data information storage unit includes the data received from the external device and the data identification information for identifying the data, and the data is written by the data write request from the external device requesting the data storage unit to write the data. The writing process to be stored in the data storage unit stores the data identification information that was last normally executed. The completion information storage unit stores completion information indicating whether or not an issuance process for storing data corresponding to an application in the data storage unit has been completed in response to the write request. The processing unit transmits the data identification information stored in the final data information storage unit to the external device when the completion information stored in the completion information storage unit indicates that the issuing process has not been completed. Perform the following processing.

第1の実施形態のICカードの一例を示す外観図。FIG. 1 is an external view illustrating an example of an IC card according to a first embodiment. 第1の実施形態のICカードのハードウェア構成例を示す図。FIG. 2 is a diagram illustrating an example of a hardware configuration of the IC card according to the first embodiment. 第1の実施形態のICカードの機能構成例を示すブロック図。FIG. 2 is a block diagram illustrating a functional configuration example of the IC card according to the first embodiment. 第1の実施形態のSTORE DATAコマンドのデータ構成例を示す図。FIG. 4 is a diagram illustrating a data configuration example of a STORE DATA command according to the first embodiment. 第1の実施形態のSELECTコマンドのデータ構成例を示す図。FIG. 3 is a diagram illustrating a data configuration example of a SELECT command according to the first embodiment. 第1の実施形態のSELECTコマンドのレスポンスのデータ構成例を示す図。FIG. 3 is a diagram illustrating a data configuration example of a response to a SELECT command according to the first embodiment. 第1の実施形態のICカードのSTORE DATAコマンド処理の一例を示すフローチャート。9 is a flowchart illustrating an example of STORE DATA command processing of the IC card according to the first embodiment. 第1の実施形態のICカードのSELECTコマンド処理の一例を示すフローチャート。5 is a flowchart illustrating an example of a SELECT command process of the IC card according to the first embodiment. 第1の実施形態のICカードの正常終了した場合の発行処理の一例を示す図。FIG. 6 is a diagram illustrating an example of an issuing process when the IC card according to the first embodiment is normally completed. 第1の実施形態のICカードの異常中断した場合の発行処理、及び発行の再開処理の一例を示す図。FIG. 6 is a diagram illustrating an example of an issuance process when an IC card is abnormally interrupted and an issuance restart process according to the first embodiment. 第2の実施形態のICカードの機能構成例を示すブロック図。FIG. 9 is a block diagram illustrating an example of a functional configuration of the IC card according to the second embodiment. 第2の実施形態の最終データ情報記憶部のデータ例を示す図。FIG. 10 is a diagram illustrating an example of data in a final data information storage unit according to the second embodiment. 第2の実施形態の完了情報記憶部のデータ例を示す図。FIG. 14 is a diagram illustrating an example of data in a completion information storage unit according to the second embodiment. 第3の実施形態のICカードの機能構成例を示すブロック図。FIG. 13 is a block diagram showing a functional configuration example of an IC card according to a third embodiment. 第3の実施形態のICカードのSTORE DATAコマンド処理の一例を示すフローチャート。13 is a flowchart illustrating an example of STORE DATA command processing of the IC card according to the third embodiment. 第4の実施形態のICカード発行システムの構成例を示すブロック図。FIG. 11 is a block diagram showing a configuration example of an IC card issuing system according to a fourth embodiment. 第4の実施形態の発行装置の動作の一例を示すフローチャート。13 is a flowchart illustrating an example of the operation of the issuing device according to the fourth embodiment.

以下、実施形態の携帯可能電子装置、ICカード、及び発行装置を、図面を参照して説明する。   Hereinafter, a portable electronic device, an IC card, and an issuing device according to an embodiment will be described with reference to the drawings.

(第1の実施形態)
図1は、第1の実施形態のICカード1の一例を示す外観図である。なお、本実施形態では、携帯可能電子装置の一例として、ICカード1について説明する。
図1に示すように、ICカード1は、ICモジュール10を備える。ICモジュール10は、ICカード1が接触式ICカードの場合は、コンタクト部3と、ICチップ100とを備える。ICカード1は、例えば、プラスチックのカード基材PT(カード本体の一例)に、ICモジュール10を実装して形成されている。すなわち、ICカード1は、ICモジュール10と、ICモジュール10が埋め込まれたカード基材PTとを備えている。また、ICカード1は、コンタクト部3を介して外部装置2と通信可能である。
(First embodiment)
FIG. 1 is an external view illustrating an example of an IC card 1 according to the first embodiment. In the present embodiment, an IC card 1 will be described as an example of a portable electronic device.
As shown in FIG. 1, the IC card 1 includes an IC module 10. When the IC card 1 is a contact IC card, the IC module 10 includes the contact section 3 and an IC chip 100. The IC card 1 is formed, for example, by mounting an IC module 10 on a plastic card base PT (an example of a card body). That is, the IC card 1 includes the IC module 10 and the card base PT in which the IC module 10 is embedded. The IC card 1 can communicate with the external device 2 via the contact unit 3.

ICカード1は、例えば、外部装置2が送信したコマンド(処理要求)を、コンタクト部3を介して受信し、受信したコマンドに応じた処理(コマンド処理)を実行する。そして、ICカード1は、コマンド処理の実行結果であるレスポンス(処理応答)を外部装置2にコンタクト部3を介して送信する。
ここで、外部装置2は、ICカード1と通信する上位装置であり、例えば、リーダ/ライタ装置や発行装置などである。
The IC card 1 receives, for example, a command (processing request) transmitted from the external device 2 via the contact unit 3, and executes processing (command processing) according to the received command. Then, the IC card 1 transmits a response (processing response) as an execution result of the command processing to the external device 2 via the contact unit 3.
Here, the external device 2 is a higher-level device that communicates with the IC card 1, and is, for example, a reader / writer device or an issuing device.

ICモジュール10は、コンタクト部3と、ICチップ100とを備え、例えば、テープ上にICモジュール10が複数配置されたCOT(Chip On Tape)などの形態で取引されるモジュールである。なお、テープから個片抜きして切り離した単体のICモジュール10をCOTという場合がある。   The IC module 10 is a module that includes the contact unit 3 and the IC chip 100 and is traded in a form such as COT (Chip On Tape) in which a plurality of IC modules 10 are arranged on a tape, for example. A single IC module 10 that has been individually separated from a tape and cut off may be referred to as a COT.

コンタクト部3は、ICカード1が動作するために必要な各種信号の端子を有している。ここで、各種信号の端子には、電源電圧、クロック信号、リセット信号などを外部装置2から供給を受ける端子、及び、外部装置2と通信するためのシリアルデ―タ入出力端子(SIO端子)が含まれる。
ICチップ100は、例えば、1チップのマイクロプロセッサなどのLSI(Large Scale Integration)である。
The contact section 3 has terminals for various signals necessary for the operation of the IC card 1. The terminals for various signals include a terminal for receiving a power supply voltage, a clock signal, a reset signal, and the like from the external device 2 and a serial data input / output terminal (SIO terminal) for communicating with the external device 2. included.
The IC chip 100 is, for example, an LSI (Large Scale Integration) such as a one-chip microprocessor.

次に、図2を参照して、本実施形態のICカード1のハードウェア構成について説明する。
図2は、本実施形態のICカード1のハードウェア構成例を示す図である。
図2に示すように、ICカード1は、コンタクト部3と、ICチップ100とを備えたICモジュール10を備えている。そして、ICチップ100は、UART(Universal Asynchronous Receiver Transmitter)4と、CPU(Central Processing Unit)5と、ROM(Read Only Memory)6と、RAM(Random Access Memory)7と、EEPROM(Electrically Erasable Programmable ROM)8とを備えている。
Next, a hardware configuration of the IC card 1 according to the present embodiment will be described with reference to FIG.
FIG. 2 is a diagram illustrating an example of a hardware configuration of the IC card 1 according to the present embodiment.
As shown in FIG. 2, the IC card 1 includes an IC module 10 including a contact section 3 and an IC chip 100. The IC chip 100 includes a UART (Universal Asynchronous Receiver Transmitter) 4, a CPU (Central Processing Unit) 5, a ROM (Read Only Memory) 6, a RAM (Random Access Memory) 7, and an EEPROM (Electrically Erasable Programmable ROM). And 8).

UART4は、上述したSIO端子を介して、外部装置2とシリアルデータ通信を行う。UART4は、SIO端子を介して受信したシリアルデータ信号をパラレル変換したデータ(例えば、1バイトのデータ)を内部バスBS1に出力する。また、UART4は、内部バスBS1を介して取得したデータをシリアル変換して、SIO端子を介して外部装置2に出力する。UART4は、例えば、SIO端子を介してコマンドを外部装置2から受信する。また、UART4は、SIO端子を介してレスポンスを外部装置2に送信する。   The UART 4 performs serial data communication with the external device 2 via the above-described SIO terminal. The UART 4 outputs data (for example, 1-byte data) obtained by parallel-converting a serial data signal received via the SIO terminal to the internal bus BS1. The UART 4 also converts data obtained via the internal bus BS1 into serial data and outputs the data to the external device 2 via the SIO terminal. The UART 4 receives a command from the external device 2 via, for example, an SIO terminal. The UART 4 transmits a response to the external device 2 via the SIO terminal.

CPU5は、ROM6又はEEPROM8に記憶されているプログラムを実行して、ICカード1の各種処理を行う。CPU5は、例えば、コンタクト部3を介して、UART4が受信したコマンドに応じたコマンド処理を実行する。   The CPU 5 executes a program stored in the ROM 6 or the EEPROM 8 to perform various processes of the IC card 1. The CPU 5 executes, for example, command processing according to the command received by the UART 4 via the contact unit 3.

ROM6は、例えば、マスクROMなどの不揮発性メモリであり、ICカード1の各種処理を実行するためのプログラム、及びコマンドテーブルなどのデータを記憶する。
RAM7は、例えば、SRAM(Static RAM)などの揮発性メモリであり、ICカード1の各種処理を行う際に利用されるデータを一時記憶する。
The ROM 6 is a non-volatile memory such as a mask ROM, for example, and stores a program for executing various processes of the IC card 1 and data such as a command table.
The RAM 7 is a volatile memory such as an SRAM (Static RAM), for example, and temporarily stores data used when performing various processes of the IC card 1.

EEPROM8は、例えば、電気的に書き換え可能な不揮発性メモリである。EEPROM8は、ICカード1が利用する各種データを記憶する。EEPROM8は、例えば、ICカード1を利用した各種サービス(アプリケーション)に使用される情報を記憶する。   The EEPROM 8 is, for example, an electrically rewritable nonvolatile memory. The EEPROM 8 stores various data used by the IC card 1. The EEPROM 8 stores information used for various services (applications) using the IC card 1, for example.

次に、図3を参照して、本実施形態によるICカード1の機能構成例について説明する。
図3は、本実施形態のICカード1の機能構成例を示すブロック図である。
図3に示すように、ICカード1は、通信部40と、制御部50と、AP(アプリケーション)データ記憶部81と、ファイル管理情報記憶部82と、最終データ情報記憶部83と、完了情報記憶部84とを備える。
ここで、図3に示されるICカード1の各部は、図2に示されるICカード1のハードウェアを用いて実現される。
Next, an example of a functional configuration of the IC card 1 according to the present embodiment will be described with reference to FIG.
FIG. 3 is a block diagram illustrating an example of a functional configuration of the IC card 1 according to the present embodiment.
As shown in FIG. 3, the IC card 1 includes a communication unit 40, a control unit 50, an AP (application) data storage unit 81, a file management information storage unit 82, a final data information storage unit 83, a completion information And a storage unit 84.
Here, each part of the IC card 1 shown in FIG. 3 is realized using the hardware of the IC card 1 shown in FIG.

通信部40は、例えば、UART4と、CPU5と、ROM6に記憶されているプログラムとにより実現され、コンタクト部3を介して、例えば、外部装置2との間でコマンド及びレスポンスの送受信を行う。すなわち、通信部40は、所定の処理を要求するコマンド(処理要求)を外部装置2から受信するとともに、コマンドに対するレスポンス(処理応答)を外部装置2に送信する。   The communication unit 40 is realized by, for example, the UART 4, the CPU 5, and a program stored in the ROM 6, and transmits and receives commands and responses to and from the external device 2 via the contact unit 3, for example. That is, the communication unit 40 receives a command (processing request) requesting a predetermined process from the external device 2 and transmits a response (processing response) to the command to the external device 2.

APデータ記憶部81(データ記憶部の一例)は、例えば、EEPROM8により構成された記憶部であり、ICカード1の用途(アプリケーション)に応じた各種データを記憶する。APデータ記憶部81は、ICカード1の発行によって、アプリケーションに対応したDF(Dedicated File)と、アプリケーションにおいて利用される各種データ及び内部制御用のデータを記憶するEF(Elementary File)とが構築(確保)される。APデータ記憶部81の各EFには、例えば、発行工程において、STORE DATAコマンドによって、データが記憶される。   The AP data storage unit 81 (an example of a data storage unit) is, for example, a storage unit including the EEPROM 8, and stores various data according to the use (application) of the IC card 1. By issuing the IC card 1, the AP data storage unit 81 builds a DF (Dedicated File) corresponding to the application and an EF (Elementary File) for storing various data used in the application and data for internal control ( Secured). In each EF of the AP data storage unit 81, data is stored by, for example, a STORE DATA command in an issuing process.

ファイル管理情報記憶部82は、例えば、EEPROM8により構成され、データを記憶する各種ファイルを管理する管理情報(例えば、ディレクトリ情報)を記憶する。ファイル管理情報記憶部82は、例えば、ファイル及び各種データの識別情報(例えば、ファイルID、DGIなど)と、EEPROM8の物理アドレスとを対応付けて記憶する。ここで、「DGI」(Data Grouping Identifier)とは、データを識別するデータ識別情報の一例である。   The file management information storage unit 82 includes, for example, the EEPROM 8, and stores management information (for example, directory information) for managing various files for storing data. The file management information storage unit 82 stores, for example, identification information (for example, file ID, DGI, etc.) of files and various data and physical addresses of the EEPROM 8 in association with each other. Here, “DGI” (Data Grouping Identifier) is an example of data identification information for identifying data.

最終データ情報記憶部83は、例えば、EEPROM8により構成され、発行処理において、外部装置2から受信した書き込みコマンド(書き込み要求)によって、データをAPデータ記憶部81に記憶させる書き込み処理が、最後に正常に実行されたDGI(データ識別情報)を記憶する。なお、ここでの書き込みコマンドは、例えば、STORE DATAコマンドであり、STORE DATAコマンドの詳細については後述する。   The final data information storage unit 83 is composed of, for example, the EEPROM 8. In the issuance processing, the write processing for storing data in the AP data storage unit 81 by the write command (write request) received from the external device 2 is finally completed normally. The executed DGI (data identification information) is stored. The write command here is, for example, a STORE DATA command, and details of the STORE DATA command will be described later.

完了情報記憶部84は、例えば、EEPROM8により構成され、書き込みコマンドによって発行処理が完了したか否かを示す完了情報を記憶する。ここで、完了情報は、例えば、フラグ情報であり、発行処理が完了した場合に“1”が記憶され、発行処理が完了しでいない場合に“0”が記憶される。   The completion information storage unit 84 includes, for example, the EEPROM 8, and stores completion information indicating whether or not the issuing process has been completed by the write command. Here, the completion information is, for example, flag information, in which “1” is stored when the issuing process is completed, and “0” is stored when the issuing process is not completed.

制御部50は、例えば、CPU5と、RAM7と、ROM6又はEEPROM8とにより実現され、ICカード1を統括的に制御する。制御部50は、ファイル管理部51と、コマンド処理部52とを備える。   The control unit 50 is realized by, for example, the CPU 5, the RAM 7, the ROM 6, or the EEPROM 8, and controls the IC card 1 comprehensively. The control unit 50 includes a file management unit 51 and a command processing unit 52.

ファイル管理部51は、ファイル管理情報記憶部82が記憶する管理情報(例えば、ディレクトリ情報)に基づいて、APデータ記憶部81内のファイルを管理する。ファイル管理部51は、例えば、ファイルへのアクセス処理を実行する際に、ファイル管理情報記憶部82が記憶する管理情報を検索して、ファイルの記憶場所(例えば、EEPROM8の物理アドレス)を特定する。   The file management unit 51 manages files in the AP data storage unit 81 based on management information (for example, directory information) stored in the file management information storage unit 82. For example, when executing a file access process, the file management unit 51 searches the management information stored in the file management information storage unit 82 and specifies a storage location of the file (for example, a physical address of the EEPROM 8). .

コマンド処理部52(処理部の一例)は、外部装置2からICカード1に送信されたコマンド(処理要求)に応じて、各種コマンドの処理(コマンド処理)を実行する。コマンド処理部52は、例えば、通信部40を介して外部装置2から受信したコマンドに応じて、コマンド処理を実行する。また、コマンド処理部52は、コマンド処理の結果であるレスポンスを、通信部40を介して外部装置2に送信する。   The command processing unit 52 (an example of a processing unit) executes processing (command processing) of various commands in response to a command (processing request) transmitted from the external device 2 to the IC card 1. The command processing unit 52 executes command processing according to a command received from the external device 2 via the communication unit 40, for example. In addition, the command processing unit 52 transmits a response as a result of the command processing to the external device 2 via the communication unit 40.

コマンド処理部52は、例えば、発行用の書き込みコマンドであるSTORE DATAコマンドのコマンド処理、アプリケーション(DF:Dedicated File)、EF(Elementary File)等の選択をするコマンドであるSELECTコマンドのコマンド処理などを実行する。
ここで、まず、図4を参照して、STORE DATAコマンドのデータ構成例について説明する。
The command processing unit 52 performs, for example, command processing of a STORE DATA command, which is a write command for issuing, and command processing of a SELECT command, which is a command for selecting an application (DF: Dedicated File), EF (Elementary File), and the like. Execute.
Here, first, an example of the data configuration of the STORE DATA command will be described with reference to FIG.

図4は、本実施形態のICカード1のSTORE DATAコマンドのデータ構成例を示す図である。
この図に示すように、STORE DATAコマンド(書き込み要求の一例)は、コマンドヘッダと、コマンドボディとを有している。コマンドヘッダは、「CLA」(クラスバイト)、「INS」(命令バイト)、「P1」(パラメータ1)、及び「P2」(パラメータ2)を有している。なお、「CLA」、「INS」、「P1」、及び「P2」のぞれぞれは、1バイトで構成されている。また、コマンドボディは、「Lc」(データ長)、及び「DATA」(データ)を有している。なお、「Lc」は、1バイトで構成され、「DATA」は、「Lc」によって指定されたデータ長(例えば、mバイト)のデータである。
FIG. 4 is a diagram illustrating a data configuration example of a STORE DATA command of the IC card 1 according to the present embodiment.
As shown in this figure, the STORE DATA command (an example of a write request) has a command header and a command body. The command header has “CLA” (class byte), “INS” (instruction byte), “P1” (parameter 1), and “P2” (parameter 2). Each of "CLA", "INS", "P1", and "P2" is composed of one byte. The command body has “Lc” (data length) and “DATA” (data). “Lc” is composed of one byte, and “DATA” is data having a data length (for example, m bytes) specified by “Lc”.

また、STORE DATAコマンドの「DATA」は、「DGI」と、「DGI長」と、「DGI DATA」とを含んでいる。なお、「DGI」は、2バイトで構成され、「DGI長」は、1バイトで構成される。また、「DGI DATA」は、「DGI長」によって指定されたデータ長(例えば、nバイト)のデータである。   “DATA” of the STORE DATA command includes “DGI”, “DGI length”, and “DGI DATA”. Note that “DGI” is composed of 2 bytes, and “DGI length” is composed of 1 byte. “DGI DATA” is data having a data length (for example, n bytes) specified by “DGI length”.

例えば、図4に示す例では、STORE DATAコマンドは、「DGI」が“0x0101”のデータ領域(EF)に対して、「DGI DATA」が“0x1122334455”の5バイトのデータを記憶させる(書き込む)処理要求をICカード1に行うことを示している。このように、STORE DATAコマンドには、APデータ記憶部81に記憶させるデータ(「DGI DATA」)と、データ識別情報(「DGI」)とを含んでいる。   For example, in the example shown in FIG. 4, the STORE DATA command stores (writes) 5 bytes of data in which “DGI DATA” is “0x112233455” in the data area (EF) in which “DGI” is “0x0101”. This indicates that a processing request is sent to the IC card 1. As described above, the STORE DATA command includes the data (“DGI DATA”) to be stored in the AP data storage unit 81 and the data identification information (“DGI”).

なお、STORE DATAコマンドは、上述した「P2」の最上位ビットであるb8(ビット8)により、最終のSTORE DATAコマンド(以下、LAST STORE DATAコマンドという)であるか否かを指定可能である。例えば、「P2」のb8が“1”である場合に、LAST STORE DATAコマンドであることを示し、「P2」のb8が“0”である場合に、LAST STORE DATAコマンドでないことを示す。   The STORE DATA command can specify whether or not it is the last STORE DATA command (hereinafter, referred to as a LAST STORE DATA command) by b8 (bit 8) which is the most significant bit of “P2” described above. For example, when b8 of “P2” is “1”, it indicates that it is a LAST STORE DATA command, and when b8 of “P2” is “0”, it indicates that it is not a LAST STORE DATA command.

図3の説明に戻り、コマンド処理部52は、通信部40を介して、STORE DATAコマンドを受信した場合に、APデータ記憶部81のDGIに対応するEFに、データ(DGI DATA)を記憶させる。また、コマンド処理部52は、受信したSTORE DATAコマンドが、LAST STORE DATAコマンドでない(P2のb8が“0”である)場合に、最終データ情報記憶部83に、STORE DATAコマンドに含まれるDGIをデータ識別情報として記憶させる。すなわち、コマンド処理部52は、STORE DATAコマンドに、データが発行処理の最後のデータであることを示す情報が含まれていない場合に、最終データ情報記憶部83に、STORE DATAコマンドに含まれるDGIを記憶させる。   Returning to the description of FIG. 3, when the command processing unit 52 receives the STORE DATA command via the communication unit 40, the command processing unit 52 stores the data (DGI DATA) in the EF corresponding to the DGI in the AP data storage unit 81. . When the received STORE DATA command is not the LAST STORE DATA command (b8 of P2 is “0”), the command processing unit 52 stores the DGI included in the STORE DATA command in the final data information storage unit 83. It is stored as data identification information. That is, if the STORE DATA command does not include information indicating that the data is the last data of the issuing process, the command processing unit 52 stores the DGI included in the STORE DATA command in the final data information storage unit 83. Is stored.

また、コマンド処理部52は、受信したSTORE DATAコマンドが、LAST STORE DATAコマンドである(P2のb8が“1”である)場合に、完了情報記憶部84に、“1”を記憶させる。すなわち、コマンド処理部52は、STORE DATAコマンドに、データが発行処理の最後のデータであることを示す情報が含まれている場合に、発行処理が完了したことを示す情報(“1”)を、完了情報として、完了情報記憶部84に記憶させる。
なお、コマンド処理部52は、LAST STORE DATAコマンドである場合に、最終データ情報記憶部83に記憶されているDGIを削除するようにしてもよい。
When the received STORE DATA command is a LAST STORE DATA command (b8 of P2 is “1”), the command processing unit 52 stores “1” in the completion information storage unit 84. That is, when the STORE DATA command includes information indicating that the data is the last data of the issuing process, the command processing unit 52 outputs the information (“1”) indicating that the issuing process has been completed. , Is stored in the completion information storage unit 84 as completion information.
In the case where the command is the LAST STORE DATA command, the command processing unit 52 may delete the DGI stored in the final data information storage unit 83.

次に、図5及び図6を参照して、SELECTコマンドのデータ構成例について説明する。
図5は、本実施形態のICカード1のSELECTコマンドのデータ構成例を示す図である。
この図に示すように、SELECTコマンド(選択要求の一例)は、コマンドヘッダと、コマンドボディとを有している。コマンドヘッダは、「CLA」、「INS」、「P1」、及び「P2」を有している。また、コマンドボディは、「Lc」(送信データのデータ長)、「DATA」(送信データ)、及び「Le」(受信データのデータ長)を有している。なお、「Lc」及び「Le」は、1バイトで構成され、「DATA」は、「Lc」によって指定されたデータ長(例えば、mバイト)のデータである。
Next, an example of the data structure of the SELECT command will be described with reference to FIGS.
FIG. 5 is a diagram illustrating an example of a data configuration of a SELECT command of the IC card 1 according to the present embodiment.
As shown in this figure, the SELECT command (an example of a selection request) has a command header and a command body. The command header has “CLA”, “INS”, “P1”, and “P2”. The command body has "Lc" (data length of transmission data), "DATA" (transmission data), and "Le" (data length of reception data). Note that “Lc” and “Le” are each composed of 1 byte, and “DATA” is data having a data length (for example, m bytes) specified by “Lc”.

また、図6は、本実施形態のICカード1のSELECTコマンドのレスポンスのデータ構成例を示す図である。
この図に示すように、SELECTコマンドのレスポンスは、「FCI」(File Control Information:ファイル制御情報)と、「Status Word」(ステータス情報)とを有している。なお、「Status Word」は、2バイトで構成され、「FCI」は、上述した「Le」により指定されたデータ長である。
FIG. 6 is a diagram illustrating a data configuration example of a response to a SELECT command of the IC card 1 according to the present embodiment.
As shown in this figure, the response to the SELECT command has “FCI” (File Control Information) and “Status Word” (Status Information). Note that “Status Word” is composed of 2 bytes, and “FCI” is the data length specified by “Le” described above.

また、「FCI」は、階層構造を持ったTLV形式のデータである。ここで、TLV形式とは、タグ(Tag)、データ長(Length)、及びデータ部(Value)を並べたデータ形式のことである。   “FCI” is data in a TLV format having a hierarchical structure. Here, the TLV format is a data format in which a tag (Tag), a data length (Length), and a data part (Value) are arranged.

「FCI」は、タグが“0x6F”のTLV形式のデータであり、「FCI」のデータ部の「FCI Template」は、下位階層として、タグが“0x84”及び“0xA5”のTLV形式のデータを有している。また、タグが“0xA5”のデータ部の「FCI Proprietary Template」は、さらに下位階層として、タグが“0x50”及び“0xBF0C”のTLV形式のデータを有している。   “FCI” is data in TLV format with a tag “0x6F”, and “FCI Template” in the data part of “FCI” is data in TLV format with tags “0x84” and “0xA5” as lower layers. Have. In addition, “FCI Proprietary Template” in the data portion having the tag “0xA5” has TLV format data with the tags “0x50” and “0xBF0C” as a lower layer.

また、タグが“0xBF0C”のデータ部の「FCI Issuer Discretionary DATA」は、さらに下位階層として、タグが“0xDF01”のTLV形式のデータを有している。本実施形態では、SELECTコマンドのレスポンスには、この“0xDF01”のTLV形式データD1に、STORE DATAコマンドにより、最後に正常終了したDGI(最終データ情報記憶部83に記憶されているDGI)が含まれる。
なお、発行処理が完了している場合(LAST STORE DATAコマンドが実行された場合)には、SELECTコマンドのレスポンスには、この“0xDF01”のTLV形式データD1は含まれない。
Further, “FCI Issuer Discretionary DATA” in the data portion having the tag “0xBF0C” has TLV format data with the tag “0xDF01” as a further lower layer. In the present embodiment, the response to the SELECT command includes, in the TLV format data D1 of “0xDF01”, the DGI (the DGI stored in the final data information storage unit 83) that normally ended normally by the STORE DATA command. It is.
When the issuance process is completed (when the LAST STORE DATA command is executed), the TLV format data D1 of “0xDF01” is not included in the response of the SELECT command.

再び、図3の説明に戻り、コマンド処理部52は、通信部40を介して、アプリケーションを選択するSELECTコマンドを受信した場合に、SELECTコマンドに含まれるAP識別情報に対応するアプリケーション(DF)を選択する。ここで、AP識別情報は、アプリケーションを識別する識別情報であり、例えば、DF名、ファイルIDなどである。   Returning to the description of FIG. 3 again, when the command processing unit 52 receives a SELECT command for selecting an application via the communication unit 40, the command processing unit 52 converts the application (DF) corresponding to the AP identification information included in the SELECT command. select. Here, the AP identification information is identification information for identifying an application, such as a DF name and a file ID.

また、コマンド処理部52は、SELECTコマンドを受信した場合に、完了情報記憶部84が記憶する完了情報が、発行処理が完了していないことを示す場合に、最終データ情報記憶部83が記憶するDGIを外部装置2に送信する処理を行う。コマンド処理部52は、例えば、完了情報が“0”である場合に、最終データ情報記憶部83が記憶するDGIを、上述した“0xDF01”のTLV形式データD1として含むレスポンスを、通信部40を介して、外部装置2に送信する。   When the command processing unit 52 receives the SELECT command and the completion information stored in the completion information storage unit 84 indicates that the issuing process is not completed, the command processing unit 52 stores the command in the final data information storage unit 83. A process of transmitting the DGI to the external device 2 is performed. For example, when the completion information is “0”, the command processing unit 52 transmits a response including the DGI stored in the final data information storage unit 83 as the above-described “0xDF01” TLV format data D1 to the communication unit 40. To the external device 2 via the external device.

また、コマンド処理部52は、アプリケーションを選択するSELECTコマンドに応じて、例えば、完了情報が“1”である場合に、上述した“0xDF01”のTLV形式データD1を含まないレスポンスを、通信部40を介して、外部装置2に送信する。   In addition, in response to the SELECT command for selecting an application, for example, when the completion information is “1”, the command processing unit 52 transmits a response that does not include the above-described “0xDF01” TLV format data D1 to the communication unit 40. To the external device 2 via.

次に、図面を参照して、本実施形態のICカード1の動作について説明する。
図7は、本実施形態のICカード1のSTORE DATAコマンド処理の一例を示すフローチャートである。
Next, the operation of the IC card 1 of the present embodiment will be described with reference to the drawings.
FIG. 7 is a flowchart illustrating an example of the STORE DATA command processing of the IC card 1 according to the present embodiment.

図7に示すように、外部装置2とICカード1とがコンタクト部3を介して接続され、ICカード1が活性化された状態において、ICカード1は、コマンドを受信したか否かを判定する(ステップS101)。すなわち、ICカード1の通信部40は、UART4を介して、外部装置2からコマンドを受信したか否かを判定する。通信部40は、コマンドを受信した場合(ステップS101:YES)に、処理をステップS102に進める。また、通信部40は、コマンドを受信していない場合(ステップS101:NO)に、処理をステップS101に戻し、ステップS101の処理を繰り返す。   As shown in FIG. 7, in a state where the external device 2 and the IC card 1 are connected via the contact unit 3 and the IC card 1 is activated, the IC card 1 determines whether or not a command has been received. (Step S101). That is, the communication unit 40 of the IC card 1 determines whether or not a command has been received from the external device 2 via the UART 4. If the communication unit 40 receives the command (step S101: YES), the process proceeds to step S102. If a command has not been received (step S101: NO), the communication unit 40 returns the process to step S101 and repeats the process of step S101.

ステップS102において、ICカード1のコマンド処理部52は、コマンドを取得する。すなわち、コマンド処理部52は、通信部40からコマンドを取得する。
次に、コマンド処理部52は、受信したコマンドがSTORE DATAコマンドであるか否かを判定する(ステップS103)。コマンド処理部52は、取得したコマンドのうちの「CLA」及び「INS」に基づいて、受信したコマンドがSTORE DATAコマンドであるか否かを判定する。コマンド処理部52は、受信したコマンドがSTORE DATAコマンドである場合(ステップS103:YES)に、処理をステップS104に進める。また、コマンド処理部52は、受信したコマンドがSTORE DATAコマンドでない場合(ステップS103:NO)に、処理をステップS109に進める。
In step S102, the command processing unit 52 of the IC card 1 acquires a command. That is, the command processing unit 52 acquires a command from the communication unit 40.
Next, the command processing unit 52 determines whether or not the received command is a STORE DATA command (Step S103). The command processing unit 52 determines whether the received command is a STORE DATA command based on “CLA” and “INS” of the acquired commands. If the received command is a STORE DATA command (step S103: YES), the command processing unit 52 advances the processing to step S104. If the received command is not a STORE DATA command (step S103: NO), the command processing unit 52 advances the processing to step S109.

ステップS104において、コマンド処理部52は、STORE DATAコマンドに含まれる「DGI DATA」(図4参照)をAPデータ記憶部81に書き込む。コマンド処理部52は、ファイル管理情報記憶部82を参照し、取得したDGIに対応するEFのEEPROM8の先頭アドレスをファイル管理部51から取得する。コマンド処理部52は、EEPROM8の先頭アドレスから順に、受信したデータ(「DGI DATA」)を記憶させる。   In step S104, the command processing unit 52 writes “DGI DATA” (see FIG. 4) included in the STORE DATA command into the AP data storage unit 81. The command processing unit 52 refers to the file management information storage unit 82 and acquires from the file management unit 51 the start address of the EF EEPROM 8 corresponding to the acquired DGI. The command processing unit 52 stores the received data (“DGI DATA”) in order from the top address of the EEPROM 8.

次に、コマンド処理部52は、受信したコマンドがLAST STORE DATAコマンドであるか否かを判定する(ステップS105)。コマンド処理部52は、受信したSTORE DATAコマンドのコマンドヘッドのP2のb8が“1”であるか否かを判定する。コマンド処理部52は、LAST STORE DATAコマンドである(P2のb8が“1”である)場合(ステップS105:YES)に、処理をステップS108に進める。また、コマンド処理部52は、LAST STORE DATAコマンドでなお(P2のb8が“0”である)場合(ステップS105:NO)に、処理をステップS106に進める。   Next, the command processing unit 52 determines whether or not the received command is a LAST STORE DATA command (Step S105). The command processing unit 52 determines whether b8 of P2 of the command head of the received STORE DATA command is “1”. If the command is a LAST STORE DATA command (b8 of P2 is “1”) (step S105: YES), the command processing unit 52 advances the processing to step S108. If the LAST STORE DATA command is still received (b8 of P2 is “0”) (step S105: NO), the command processing unit 52 advances the process to step S106.

ステップS106において、コマンド処理部52は、受信DGIを最終データ情報記憶部83に記憶させる。すなわち、コマンド処理部52は、STORE DATAコマンドに含まれるDGIを、STORE DATAコマンドが最後に正常に実行されたデータ識別情報として、最終データ情報記憶部83に記憶させる。   In step S106, the command processing unit 52 stores the received DGI in the final data information storage unit 83. That is, the command processing unit 52 causes the final data information storage unit 83 to store the DGI included in the STORE DATA command as data identification information on which the STORE DATA command was last normally executed.

次に、ICカード1は、レスポンスを外部装置2に送信する(ステップS107)。すなわち、コマンド処理部52は、STORE DATAコマンドが正常終了したことを示す情報(「Status Word」)を含むレスポンスを生成し、当該レスポンスを、通信部40を介して外部装置2に送信する。ステップS107の処理後に、コマンド処理部52は、処理をステップS101に戻す。   Next, the IC card 1 transmits a response to the external device 2 (Step S107). That is, the command processing unit 52 generates a response including information (“Status Word”) indicating that the STORE DATA command has been normally completed, and transmits the response to the external device 2 via the communication unit 40. After the processing in step S107, the command processing unit 52 returns the processing to step S101.

また、ステップS108において、コマンド処理部52は、完了情報記憶部84に発行処理が完了したことを示す情報を記憶させる。すなわち、コマンド処理部52は、完了情報記憶部84に、完了情報として、“1”を記憶させる。ステップS108の処理後に、コマンド処理部52は、処理をステップS107に進め、レスポンスを外部装置2に送信する。   In step S108, the command processing unit 52 causes the completion information storage unit 84 to store information indicating that the issuing process has been completed. That is, the command processing unit 52 causes the completion information storage unit 84 to store “1” as the completion information. After the processing in step S108, the command processing unit 52 advances the processing to step S107, and transmits a response to the external device 2.

また、ステップS109おいて、コマンド処理部52は、他のコマンド処理を実行する。ここで、他のコマンド処理とは、STORE DATAコマンド以外の「CLA」及び「INS」に対応するコマンドの処理を示す。   In step S109, the command processing unit 52 executes another command process. Here, other command processing refers to processing of commands corresponding to “CLA” and “INS” other than the STORE DATA command.

次に、ICカード1は、レスポンスを外部装置2に送信する(ステップS110)。すなわち、コマンド処理部52は、コマンド処理の結果を含むレスポンスを生成し、当該レスポンスを、通信部40を介して外部装置2に送信する。ステップS110の処理後に、コマンド処理部52は、処理をステップS101に戻す。   Next, the IC card 1 transmits a response to the external device 2 (Step S110). That is, the command processing unit 52 generates a response including the result of the command processing, and transmits the response to the external device 2 via the communication unit 40. After the processing in step S110, the command processing unit 52 returns the processing to step S101.

次に、図8を参照して、本実施形態のICカード1のSELECTコマンド処理について説明する。
図8は、本実施形態のICカード1のSELECTコマンド処理の一例を示すフローチャートである。なお、ここでのSELECTコマンドのコマンド処理は、アプリケーション(DF)を選択する場合について説明する。
Next, the SELECT command processing of the IC card 1 according to the present embodiment will be described with reference to FIG.
FIG. 8 is a flowchart illustrating an example of the SELECT command processing of the IC card 1 according to the present embodiment. Here, the command processing of the SELECT command will be described for a case where an application (DF) is selected.

図8に示すように、外部装置2とICカード1とがコンタクト部3を介して接続され、ICカード1が活性化された状態において、ICカード1は、コマンドを受信したか否かを判定する(ステップS201)。ICカード1の通信部40は、コマンドを受信した場合(ステップS201:YES)に、処理をステップS202に進める。また、通信部40は、コマンドを受信していない場合(ステップS201:NO)に、処理をステップS201に戻し、ステップS201の処理を繰り返す。   As shown in FIG. 8, in a state where the external device 2 and the IC card 1 are connected via the contact unit 3 and the IC card 1 is activated, the IC card 1 determines whether or not a command has been received. (Step S201). When the communication unit 40 of the IC card 1 receives the command (step S201: YES), the processing proceeds to step S202. If a command has not been received (step S201: NO), the communication unit 40 returns the process to step S201 and repeats the process of step S201.

ステップS202において、ICカード1のコマンド処理部52は、コマンドを取得する。
次に、コマンド処理部52は、受信したコマンドがSELECTコマンドであるか否かを判定する(ステップS203)。コマンド処理部52は、取得したコマンドのうちの「CLA」及び「INS」に基づいて、受信したコマンドがSELECTコマンドであるか否かを判定する。コマンド処理部52は、受信したコマンドがSELECTコマンドである場合(ステップS203:YES)に、処理をステップS204に進める。また、コマンド処理部52は、受信したコマンドがSELECTコマンドでない場合(ステップS203:NO)に、処理をステップS208に進める。
In step S202, the command processing unit 52 of the IC card 1 acquires a command.
Next, the command processing unit 52 determines whether or not the received command is a SELECT command (Step S203). The command processing unit 52 determines whether the received command is a SELECT command based on “CLA” and “INS” of the acquired commands. If the received command is a SELECT command (step S203: YES), the command processing unit 52 advances the processing to step S204. If the received command is not the SELECT command (step S203: NO), the command processing unit 52 advances the processing to step S208.

ステップS204において、コマンド処理部52は、アプリケーション(DF)を選択する。コマンド処理部52は、SELECTコマンドに含まれるDFのファイルID又はDF名に対応するアプリケーション(DF)を現在の選択ファイルとして選択する。   In step S204, the command processing unit 52 selects an application (DF). The command processing unit 52 selects an application (DF) corresponding to the DF file ID or DF name included in the SELECT command as a currently selected file.

次に、コマンド処理部52は、発行処理が完了しているか否かを判定する(ステップS205)。コマンド処理部52は、例えば、完了情報記憶部84が記憶する完了情報を参照して、当該完了情報が“1”であるか否かを判定することにより、発行処理が完了しているか否かを判定する。コマンド処理部52は、発行処理が完了している(完了情報が“1”である)場合(ステップS205:YES)に、処理をステップS207に進める。また、コマンド処理部52は、発行処理が完了していない(完了情報が“0”である)場合(ステップS205:NO)に、処理をステップS206に進める。   Next, the command processing unit 52 determines whether or not the issuing process has been completed (Step S205). For example, the command processing unit 52 refers to the completion information stored in the completion information storage unit 84 and determines whether the completion information is “1”, thereby determining whether the issuing process is completed. Is determined. If the issuing process has been completed (the completion information is “1”) (step S205: YES), the command processing unit 52 advances the process to step S207. If the issuing process has not been completed (the completion information is “0”) (step S205: NO), the command processing unit 52 advances the process to step S206.

ステップS206において、コマンド処理部52は、最後に正常終了したDGIを含むFCIをレスポンスで送信する。コマンド処理部52は、最終データ情報記憶部83が記憶しているDGIを、最後に正常終了したDGIとして取得する。コマンド処理部52は、上述した図6に示すように、“0xDF01”のTLV形式データD1に、最後に正常終了したDGIを含むレスポンス(FCI)を生成し、当該レスポンスを、通信部40を介して外部装置2に送信する。ステップS206の処理後に、コマンド処理部52は、処理をステップS201に戻す。   In step S206, the command processing unit 52 transmits, as a response, the FCI including the last successfully completed DGI. The command processing unit 52 acquires the DGI stored in the final data information storage unit 83 as the last normally completed DGI. As shown in FIG. 6 described above, the command processing unit 52 generates a response (FCI) including the last successfully completed DGI in the TLV format data D1 of “0xDF01”, and transmits the response via the communication unit 40. To the external device 2. After the processing in step S206, the command processing unit 52 returns the processing to step S201.

また、ステップS207において、コマンド処理部52は、通常のFCIをレスポンスで送信する。すなわち、コマンド処理部52は、上述した図6の“0xDF01”のTLV形式データD1を含まないレスポンス(FCI)を生成し、当該レスポンスを、通信部40を介して外部装置2に送信する。ステップS207の処理後に、コマンド処理部52は、処理をステップS201に戻す。   In step S207, the command processing unit 52 transmits a normal FCI as a response. That is, the command processing unit 52 generates a response (FCI) that does not include the TLV format data D1 of “0xDF01” in FIG. 6 described above, and transmits the response to the external device 2 via the communication unit 40. After the processing in step S207, the command processing unit 52 returns the processing to step S201.

また、ステップS208おいて、コマンド処理部52は、他のコマンド処理を実行する。ここで、他のコマンド処理とは、SELECTコマンド以外の「CLA」及び「INS」に対応するコマンドの処理を示す。   In step S208, the command processing unit 52 executes another command process. Here, other command processing refers to processing of a command corresponding to “CLA” and “INS” other than the SELECT command.

次に、ICカード1は、レスポンスを外部装置2に送信する(ステップS209)。すなわち、コマンド処理部52は、コマンド処理の結果を含むレスポンスを生成し、当該レスポンスを、通信部40を介して外部装置2に送信する。ステップS209の処理後に、コマンド処理部52は、処理をステップS201に戻す。   Next, the IC card 1 transmits a response to the external device 2 (Step S209). That is, the command processing unit 52 generates a response including the result of the command processing, and transmits the response to the external device 2 via the communication unit 40. After the processing in step S209, the command processing unit 52 returns the processing to step S201.

次に、図9及び図10を参照して、本実施形態のICカード1の発行処理について説明する。まず、図9を参照して、正常終了した場合の発行処理について説明する。
図9は、本実施形態のICカード1の正常終了した場合の発行処理の一例を示す図である。
Next, the issuing process of the IC card 1 according to the present embodiment will be described with reference to FIGS. First, with reference to FIG. 9, a description will be given of the issuance processing when the processing ends normally.
FIG. 9 is a diagram illustrating an example of an issuing process when the IC card 1 according to the present embodiment is normally completed.

図9に示すように、外部装置2とICカード1とがコンタクト部3を介して接続され、ICカード1が活性化された状態において、外部装置2が、まず、DFを選択するSELECTコマンドをICカード1に送信する(ステップS301)。
SELECTコマンドに応じて、ICカード1は、指定されたDFを発行処理するDFに選択し、レスポンスを外部装置2に送信する(ステップS302)。
As shown in FIG. 9, when the external device 2 and the IC card 1 are connected via the contact unit 3 and the IC card 1 is activated, the external device 2 first issues a SELECT command for selecting a DF. The data is transmitted to the IC card 1 (step S301).
In response to the SELECT command, the IC card 1 selects the designated DF as the DF to be issued and sends a response to the external device 2 (step S302).

次に、外部装置2は、DGI_1にデータを書き込むSTORE DATAコマンド(DGI_1)を、ICカード1に送信する(ステップS303)。このSTORE DATAコマンド(DGI_1)に応じて、ICカード1のコマンド処理部52は、APデータ記憶部81のDGI_1に対応するEFに、受信したデータを記憶させる。また、コマンド処理部52は、最終データ情報記憶部83に、受信したDGI_1を記憶させる。
次に、ICカード1は、STORE DATAコマンド(DGI_1)が正常終了したことを示すレスポンスを、外部装置2に送信する(ステップS304)。
Next, the external device 2 transmits a STORE DATA command (DGI_1) for writing data to DGI_1 to the IC card 1 (Step S303). In response to the STORE DATA command (DGI_1), the command processing unit 52 of the IC card 1 stores the received data in the EF of the AP data storage unit 81 corresponding to DGI_1. Further, the command processing unit 52 stores the received DGI_1 in the final data information storage unit 83.
Next, the IC card 1 transmits a response indicating that the STORE DATA command (DGI_1) has been normally completed to the external device 2 (step S304).

次に、外部装置2は、次にDGI_2にデータを書き込むSTORE DATAコマンド(DGI_2)を、ICカード1に送信し(ステップS305)、ICカード1は、DGI_2についてステップS303と同様の処理を行って、レスポンスを、外部装置2に送信する(ステップS306)。   Next, the external device 2 transmits a STORE DATA command (DGI_2) for writing data to DGI_2 to the IC card 1 (step S305), and the IC card 1 performs the same processing as that of step S303 for DGI_2. The response is transmitted to the external device 2 (step S306).

このような、STORE DATAコマンドによる指定したDGIにデータを書き込む処理が、繰り返される。
次に、外部装置2は、次にDGI_Nにデータを書き込むLAST STORE DATAコマンド(DGI_N)を、ICカード1に送信する(ステップS307)。このLAST STORE DATAコマンド(DGI_N)に応じて、ICカード1のコマンド処理部52は、APデータ記憶部81のDGI_Nに対応するEFに、受信したデータを記憶させる。また、コマンド処理部52は、完了情報記憶部84に、“1”を完了情報として記憶させる。
Such a process of writing data to the DGI specified by the STORE DATA command is repeated.
Next, the external device 2 transmits a LAST STORE DATA command (DGI_N) for writing data to DGI_N to the IC card 1 (step S307). In response to the LAST STORE DATA command (DGI_N), the command processing unit 52 of the IC card 1 stores the received data in the EF of the AP data storage unit 81 corresponding to DGI_N. Further, the command processing unit 52 causes the completion information storage unit 84 to store “1” as completion information.

次に、ICカード1は、LAST STORE DATAコマンド(DGI_N)が正常終了したことを示すレスポンスを、外部装置2に送信する(ステップS308)。これにより、ICカード1に対するDGI_1〜DGI_Nに発行情報を書き込む発行処理が完了する。   Next, the IC card 1 transmits a response indicating that the LAST STORE DATA command (DGI_N) has been normally completed to the external device 2 (step S308). This completes the issuance processing for writing the issuance information in DGI_1 to DGI_N for the IC card 1.

次に、外部装置2が、DFを選択するSELECTコマンドをICカード1に送信する(ステップS309)と、ICカード1は、通常のFCI(最後に終了したDGIを含まないFCI)を含むレスポンスを、外部装置2に送信する(ステップS310)。この場合、ICカード1のコマンド処理部52は、完了情報記憶部84の完了情報が“1”であるため、発行処理が完了していると判定し、通常のFCIを含むレスポンスを外部装置2に送信する。   Next, when the external device 2 transmits a SELECT command for selecting a DF to the IC card 1 (step S309), the IC card 1 sends a response including a normal FCI (an FCI that does not include the last completed DGI). Is transmitted to the external device 2 (step S310). In this case, the command processing unit 52 of the IC card 1 determines that the issuing process has been completed because the completion information in the completion information storage unit 84 is “1”, and sends a response including normal FCI to the external device 2. Send to

次に、図10を参照して、異常中断した場合の発行処理、及び発行の再開処理について説明する。
図10は、本実施形態のICカード1の異常中断した場合の発行処理、及び発行の再開処理の一例を示す図である。
Next, with reference to FIG. 10, a description will be given of an issuance process and an issuance resumption process in the case of abnormal interruption.
FIG. 10 is a diagram illustrating an example of an issuance process and an issuance resumption process when the IC card 1 according to the present embodiment is abnormally interrupted.

図10において、ステップS401からステップS406までの処理は、上述した図9の示すステップS301からステップS306までの処理と同様であるため、ここではその説明を省略する。
次に、外部装置2は、次にDGI_3にデータを書き込むSTORE DATAコマンド(DGI_3)を、ICカード1に送信するが、通信エラーが発生したものとする(ステップS407)。この例では、通信エラーにより、ICカード1の発行処理が、異常により中断したものとする。
In FIG. 10, the processing from step S401 to step S406 is the same as the processing from step S301 to step S306 shown in FIG. 9 described above, and a description thereof will be omitted here.
Next, the external device 2 transmits a STORE DATA command (DGI_3) for writing data to DGI_3 to the IC card 1, but it is assumed that a communication error has occurred (step S407). In this example, it is assumed that the issuing process of the IC card 1 has been interrupted due to a communication error.

次に、外部装置2は、発行処理を再度実行する場合に、まず、DFを選択するSELECTコマンドをICカード1に送信する(ステップS408)と、ICカード1は、レスポンス(DGI_2を含むFCI)を、外部装置2に送信する(ステップS409)。この場合、ICカード1のコマンド処理部52は、完了情報記憶部84の完了情報が“0”であるため、発行処理が完了していないと判定し、最終データ情報記憶部83が記憶するDGI_2を含むレスポンスを外部装置2に送信する。   Next, when executing the issuing process again, the external device 2 first transmits a SELECT command for selecting a DF to the IC card 1 (step S408), and the IC card 1 returns a response (FCI including DGI_2). Is transmitted to the external device 2 (step S409). In this case, since the completion information in the completion information storage unit 84 is “0”, the command processing unit 52 of the IC card 1 determines that the issuing process is not completed, and the DGI_2 stored in the final data information storage unit 83 is stored. Is transmitted to the external device 2.

次に、外部装置2は、レスポンスのFCIに含まれるDGI_2の次のDGI_3から、STORE DATAコマンドの送信を再開する。すなわち、外部装置2は、DGI_3にデータを書き込むSTORE DATAコマンド(DGI_3)を、ICカード1に送信し(ステップS410)、ICカード1は、レスポンスを、外部装置2に送信する(ステップS411)。   Next, the external device 2 restarts transmission of the STORE DATA command from DGI_3 next to DGI_2 included in the FCI of the response. That is, the external device 2 transmits a STORE DATA command (DGI_3) for writing data to DGI_3 to the IC card 1 (step S410), and the IC card 1 transmits a response to the external device 2 (step S411).

このような、STORE DATAコマンドによる指定したDGIにデータを書き込む処理が、DGI_Nまで繰り返される。最後に、外部装置2は、DGI_Nにデータを書き込むLAST STORE DATAコマンド(DGI_N)を、ICカード1に送信し(ステップS412)、ICカード1は、レスポンスを、外部装置2に送信する(ステップS413)。
このように、本実施形態のICカード1は、発行処理が異常などにより、途中中断された場合でも、発行処理を途中から再開することができる。
Such a process of writing data to the DGI designated by the STORE DATA command is repeated up to DGI_N. Finally, the external device 2 transmits a LAST STORE DATA command (DGI_N) for writing data to DGI_N to the IC card 1 (step S412), and the IC card 1 transmits a response to the external device 2 (step S413). ).
In this manner, the IC card 1 of the present embodiment can restart the issuing process from the middle even if the issuing process is interrupted halfway due to an abnormality or the like.

以上説明したように、本実施形態によるICカード1は、ICカード1(携帯可能電子装置)は、APデータ記憶部81(データ記憶部)と、最終データ情報記憶部83と、完了情報記憶部84と、コマンド処理部52(処理部)とを備える。APデータ記憶部81は、データを記憶する。最終データ情報記憶部83は、外部装置2から受信したAPデータ記憶部81に記憶させるデータと、データを識別するDGI(データ識別情報)とを含むSTORE DATAコマンド(書き込み要求)によって、データをAPデータ記憶部81に記憶させる書き込み処理が、最後に正常に実行されたDGIを記憶する。ここで、STORE DATAコマンドは、外部装置2から受信したデータと、データを識別するDGIとを含んで、APデータ記憶部81に書き込むよう要求する外部装置2からのデータ書き込み要求である。完了情報記憶部84は、STORE DATAコマンドによって、アプリケーションに対応したデータをAPデータ記憶部81に記憶させる発行処理が完了したか否かを示す完了情報を記憶する。コマンド処理部52(処理部)は、完了情報記憶部84が記憶する完了情報が、発行処理が完了していないことを示す場合(例えば、完了情報が“1”の場合)に、最終データ情報記憶部83が記憶するDGIを外部装置2に送信する処理を行う。   As described above, the IC card 1 according to the present embodiment is different from the IC card 1 (portable electronic device) in that the AP data storage unit 81 (data storage unit), the final data information storage unit 83, and the completion information storage unit 84 and a command processing unit 52 (processing unit). The AP data storage unit 81 stores data. The final data information storage unit 83 stores the data in the AP in response to a STORE DATA command (write request) including data to be stored in the AP data storage unit 81 received from the external device 2 and DGI (data identification information) for identifying the data. The write processing to be stored in the data storage unit 81 stores the DGI that was last normally executed. Here, the STORE DATA command is a data write request from the external device 2 requesting writing to the AP data storage unit 81, including the data received from the external device 2 and the DGI for identifying the data. The completion information storage unit 84 stores completion information indicating whether or not an issuance process for storing data corresponding to an application in the AP data storage unit 81 has been completed in response to a STORE DATA command. When the completion information stored in the completion information storage unit 84 indicates that the issuing process is not completed (for example, when the completion information is “1”), the command processing unit 52 (processing unit) A process of transmitting the DGI stored in the storage unit 83 to the external device 2 is performed.

これにより、本実施形態によるICカード1は、例えば、発行処理が途中中断された場合に、書き込み処理が最後に正常に実行されたDGIを知ることができる。そのため、本実施形態によるICカード1は、例えば、発行処理が途中中断された場合に、発行処理を再開することができる。また、本実施形態によるICカード1では、発行処理に失敗したカードに再発行処理を行う場合に、既に成功した発行処理を省略し、失敗した処理以降の発行処理を行うことができるため、再発行処理の処理時間を低減することができる。   As a result, for example, when the issuing process is interrupted in the middle, the IC card 1 according to the present embodiment can know the DGI in which the writing process was normally executed last. Therefore, the IC card 1 according to the present embodiment can restart the issuance process, for example, when the issuance process is interrupted halfway. Further, in the IC card 1 according to the present embodiment, when reissuing processing is performed on a card that has failed in issuing processing, it is possible to omit the already successful issuing processing and perform issuing processing subsequent to the failed processing. The processing time of the issuing process can be reduced.

また、本実施形態では、コマンド処理部52は、外部装置2から受信したアプリケーションを選択するSELECTコマンド(選択要求)に応じて、完了情報が、発行処理が完了していないことを示す場合(例えば、完了情報が“0”の場合)に、最終データ情報記憶部83が記憶するDGIを含むレスポンス(応答)を外部装置2に送信する処理を行う。   Further, in the present embodiment, the command processing unit 52 responds to the SELECT command (selection request) for selecting the application received from the external device 2 when the completion information indicates that the issuing process is not completed (for example, , When the completion information is “0”), a process of transmitting a response including the DGI stored in the final data information storage unit 83 to the external device 2 is performed.

これにより、本実施形態によるICカード1は、SELECTコマンド(選択要求)により、書き込み処理が最後に正常に実行されたDGIを知ることができるため、最後に正常に実行されたDGIを取得するために、新たに専用のコマンドを追加必要がない。また、本実施形態によるICカード1は、SELECTコマンドという簡易は手法で、最後に正常に実行されたDGIを取得することができ、利便性を向上させることができる。   As a result, the IC card 1 according to the present embodiment can know, by the SELECT command (selection request), the DGI on which the writing process was last normally executed, and obtain the DGI on which the last normally executed DGI was executed. There is no need to add a new dedicated command. In addition, the IC card 1 according to the present embodiment can acquire the last normally executed DGI by the simple technique of the SELECT command, and can improve the convenience.

また、本実施形態では、コマンド処理部52は、完了情報が、発行処理が完了している場合に、最終データ情報記憶部83が記憶するDGIを含めない応答を外部装置2に送信する処理を行う。
これにより、本実施形態によるICカード1は、発行処理が正常に完了した後に、従来のSELECTコマンドとして使用可能であるため、既存のシステムに影響を与えることなく、発行処理が途中中断された場合に、発行処理を再開することができる。
In the present embodiment, the command processing unit 52 performs a process of transmitting a response not including the DGI stored in the final data information storage unit 83 to the external device 2 when the completion information indicates that the issuing process has been completed. Do.
As a result, the IC card 1 according to the present embodiment can be used as a conventional SELECT command after the issuance process has been completed normally, so that the issuance process can be interrupted without affecting the existing system. Then, the issuing process can be restarted.

また、本実施形態では、コマンド処理部52は、STORE DATAコマンドに、データが発行処理の最後のデータであることを示す情報が含まれている場合(LAST STORE DATAコマンドである場合)に、発行処理が完了したことを示す情報を、完了情報として、完了情報記憶部84に記憶させる。また、コマンド処理部52は、STORE DATAコマンドに、データが発行処理の最後のデータであることを示す情報が含まれていない場合に、最終データ情報記憶部83に、STORE DATAコマンドに含まれるDGIを記憶させる。   Further, in the present embodiment, when the STORE DATA command includes information indicating that the data is the last data of the issuing process (when the command is a LAST STORE DATA command), the command processing unit 52 issues the command. Information indicating that the processing has been completed is stored in the completion information storage unit 84 as completion information. When the STORE DATA command does not include information indicating that the data is the last data of the issuing process, the command processing unit 52 stores the DGI included in the STORE DATA command in the final data information storage unit 83. Is stored.

これにより、本実施形態によるICカード1は、STORE DATAコマンドを用いる簡易な手法により、最後に正常に実行されたDGIを保持するとともに、簡易な手法により、発行処理が完了したか否かを判定することができる。   As a result, the IC card 1 according to the present embodiment retains the last normally executed DGI by the simple method using the STORE DATA command, and determines whether or not the issuing process is completed by the simple method. can do.

また、本実施形態では、コマンド処理部52は、STORE DATAコマンドに、データが発行処理の最後のデータであることを示す情報が含まれている場合に、最終データ情報記憶部83に記憶されているDGIを削除する。なお、コマンド処理部52は、最終データ情報記憶部83のデータ領域を削除してもよい。
これにより、本実施形態によるICカード1は、発行処理完了後に、不要になった最終データ情報記憶部83のデータ又はデータ領域を削除するため、EEPROM8のメモリ領域をより有効に利用することができる。
In the present embodiment, when the STORE DATA command includes information indicating that the data is the last data of the issuing process, the command processing unit 52 stores the information in the final data information storage unit 83. Delete the existing DGI. Note that the command processing unit 52 may delete the data area of the final data information storage unit 83.
As a result, the IC card 1 according to the present embodiment deletes the unnecessary data or data area of the final data information storage unit 83 after the issuance process is completed, so that the memory area of the EEPROM 8 can be used more effectively. .

(第2の実施形態)
次に、図面を参照して、第2の実施形態のICカード1aについて説明する。
第2の実施形態では、複数のアプリケーション(DF)について発行処理を行うことを想定し、最後に正常に実行されたDGI及び完了情報をアプリケーションごとに保持する場合の一例について説明する。
(Second embodiment)
Next, an IC card 1a according to a second embodiment will be described with reference to the drawings.
In the second embodiment, an example will be described in which issuance processing is performed for a plurality of applications (DFs), and the last normally executed DGI and completion information are stored for each application.

図11は、第2の実施形態のICカード1aの機能構成例を示すブロック図である。
図11に示すように、ICカード1aは、通信部40と、制御部50aと、APデータ記憶部81と、ファイル管理情報記憶部82と、最終データ情報記憶部83aと、完了情報記憶部84aとを備える。
なお、本実施形態のICカード1aの外観図及びハード構成は、図1及び図2に示す第1の実施形態と同様であるのでその説明を省略する。また、図11において、図3に示す構成と同一の構成については同一の符号を付し、その説明を省略する。
FIG. 11 is a block diagram illustrating a functional configuration example of the IC card 1a according to the second embodiment.
As shown in FIG. 11, the IC card 1a includes a communication unit 40, a control unit 50a, an AP data storage unit 81, a file management information storage unit 82, a final data information storage unit 83a, and a completion information storage unit 84a. And
Note that the external view and the hardware configuration of the IC card 1a of the present embodiment are the same as those of the first embodiment shown in FIGS. In FIG. 11, the same components as those shown in FIG. 3 are denoted by the same reference numerals, and description thereof will be omitted.

最終データ情報記憶部83aは、例えば、EEPROM8により構成され、アプリケーションごとに、最後に正常に実行されたDGI(データ識別情報)を記憶する。ここで、図12を参照して、本実施形態の最終データ情報記憶部83aのデータ例について説明する。   The final data information storage unit 83a is composed of, for example, the EEPROM 8, and stores the last normally executed DGI (data identification information) for each application. Here, an example of data in the final data information storage unit 83a of the present embodiment will be described with reference to FIG.

図12は、本実施形態の最終データ情報記憶部83aのデータ例を示す図である。
図12に示すように、最終データ情報記憶部83aは、「AP識別情報」と、「最終データ情報」とを対応付けて記憶する。ここで、「AP識別情報」は、アプリケーションを識別する識別情報であり、例えば、DF名やDFのファイルIDなどである。また、「最終データ情報」は、上述した書き込み処理が、最後に正常に実行されたDGIを示している。
図12に示す例では、「AP識別情報」が“XXXXXXXX”に対応する「最終データ情報」が“0x80XX”であることを示している。
FIG. 12 is a diagram illustrating an example of data in the final data information storage unit 83a according to the present embodiment.
As illustrated in FIG. 12, the final data information storage unit 83a stores “AP identification information” and “final data information” in association with each other. Here, the “AP identification information” is identification information for identifying an application, such as a DF name or a DF file ID. The “final data information” indicates the last DGI in which the above-described write processing was normally executed.
In the example shown in FIG. 12, "AP identification information" indicates that "final data information" corresponding to "XXXXXXXXX" is "0x80XX".

図11の説明に戻り、完了情報記憶部84aは、例えば、EEPROM8により構成され、アプリケーションごとに、完了情報を記憶する。ここで、図13を参照して、本実施形態の完了情報記憶部84aのデータ例について説明する。   Returning to the description of FIG. 11, the completion information storage unit 84a is configured by, for example, the EEPROM 8, and stores the completion information for each application. Here, an example of data in the completion information storage unit 84a of the present embodiment will be described with reference to FIG.

図13は、本実施形態の完了情報記憶部84aのデータ例を示す図である。
図13に示すように、完了情報記憶部84aは、「AP識別情報」と、「完了情報」とを対応付けて記憶する。ここで、「AP識別情報」は、図12と同様であり、アプリケーションを識別する識別情報である。また、「完了情報」は、上述した書き込みコマンドによって発行処理が完了したか否かを示す情報である。
FIG. 13 is a diagram illustrating an example of data in the completion information storage unit 84a according to the present embodiment.
As illustrated in FIG. 13, the completion information storage unit 84a stores “AP identification information” and “completion information” in association with each other. Here, “AP identification information” is the same as in FIG. 12, and is identification information for identifying an application. “Completion information” is information indicating whether or not the issuing process has been completed by the above-described write command.

図13に示す例では、「AP識別情報」が“XXXXXXXX”に対応する「完了情報」が“1”であり、発行処理が完了していることを示している。また、「AP識別情報」が“YYYYYYYY”に対応する「完了情報」が“0”であり、発行処理が完了していないことを示している。   In the example illustrated in FIG. 13, the “completion information” corresponding to the “AP identification information” corresponding to “XXXXXXXXX” is “1”, indicating that the issuing process has been completed. Further, the “completion information” corresponding to the “AP identification information” corresponding to “YYYYYYYY” is “0”, indicating that the issuing process has not been completed.

再び、図11の説明に戻り、制御部50aは、例えば、CPU5と、RAM7と、ROM6又はEEPROM8とにより実現され、ICカード1aを統括的に制御する。制御部50aは、ファイル管理部51と、コマンド処理部52aとを備える。   Returning to the description of FIG. 11 again, the control unit 50a is realized by, for example, the CPU 5, the RAM 7, the ROM 6, or the EEPROM 8, and controls the IC card 1a comprehensively. The control unit 50a includes a file management unit 51 and a command processing unit 52a.

コマンド処理部52aは、基本的な機能は、第1の実施形態のコマンド処理部52と同様である。コマンド処理部52aは、STORE DATAコマンド及びSELECTコマンドの最終データ情報記憶部83a及び完了情報記憶部84aに関する処理が、アプリケーションごとに実行する点を除いて、第1の実施形態と同様である。   The basic function of the command processing unit 52a is the same as that of the command processing unit 52 of the first embodiment. The command processing unit 52a is the same as that of the first embodiment except that the processing related to the final data information storage unit 83a and the completion information storage unit 84a of the STORE DATA command and the SELECT command is executed for each application.

次に、本実施形態のICカード1aの動作について説明する。本実施形態のICカード1aは、最終データ情報記憶部83a及び完了情報記憶部84aに関する処理を、アプリケーションごとに実行する点を除いて、図7及び図8に示す処理と同様である。   Next, the operation of the IC card 1a of the present embodiment will be described. The IC card 1a of the present embodiment is the same as the processing shown in FIGS. 7 and 8 except that the processing relating to the final data information storage unit 83a and the completion information storage unit 84a is executed for each application.

本実施形態では、図7のステップS106において、コマンド処理部52aは、AP識別情報と受信DGI(最終データ情報)とを対応付けて、最終データ情報記憶部83aに記憶させる。また、図7のステップS107において、コマンド処理部52aは、AP識別情報と完了情報とを対応付けて完了情報記憶部84aに記憶させる。   In the present embodiment, in step S106 of FIG. 7, the command processing unit 52a associates the AP identification information with the received DGI (final data information) and stores it in the final data information storage unit 83a. In step S107 in FIG. 7, the command processing unit 52a stores the AP identification information and the completion information in the completion information storage unit 84a in association with each other.

また、本実施形態では、図8のステップS206において、コマンド処理部52aは、SELECTコマンドで選択されたアプリケーションのAP識別情報に対応する最終データ情報を読み出して、FCIに含めてレスポンスで送信する。   In the present embodiment, in step S206 of FIG. 8, the command processing unit 52a reads out the final data information corresponding to the AP identification information of the application selected by the SELECT command, transmits the final data information in the FCI, and transmits it as a response.

以上説明したように、本実施形態では、最終データ情報記憶部83aは、アプリケーションを識別するAP識別情報と、アプリケーションの発行処理において、最後に正常に実行されたDGI(データ識別情報)とを対応付けて記憶する。また、コマンド処理部52aは、アプリケーションを選択するSELECTコマンド(選択要求)に応じて、完了情報が、発行処理が完了していないことを示す場合に、SELECTコマンドに含まれるアプリケーション識別情報に対応付けられたDGI(データ識別情報)を最終データ情報記憶部83aから取得し、取得したDGIを含むレスポンス(応答)を外部装置2に送信する処理を行う。
これにより、本実施形態によるICカード1aは、アプリケーションごとの発行処理が途中中断された場合に、アプリケーションごとに発行処理を再開することができる。
As described above, in the present embodiment, the final data information storage unit 83a associates the AP identification information for identifying the application with the DGI (data identification information) that was last normally executed in the application issuing process. Attach and remember. In response to a SELECT command (selection request) for selecting an application, when the completion information indicates that the issuing process has not been completed, the command processing unit 52a associates the completion information with the application identification information included in the SELECT command. The acquired DGI (data identification information) is acquired from the final data information storage unit 83a, and processing for transmitting a response (response) including the acquired DGI to the external device 2 is performed.
As a result, the IC card 1a according to the present embodiment can restart the issuance process for each application when the issuance process for each application is interrupted.

(第3の実施形態)
次に、図面を参照して、第3の実施形態のICカード1bについて説明する。
第3の実施形態では、最終データ情報記憶部83と完了情報記憶部84とを共通の記憶部にした場合の一例について説明する。
(Third embodiment)
Next, an IC card 1b according to a third embodiment will be described with reference to the drawings.
In the third embodiment, an example in which the final data information storage unit 83 and the completion information storage unit 84 are used as a common storage unit will be described.

図14は、第3の実施形態のICカード1bの機能構成例を示すブロック図である。
図14に示すように、ICカード1bは、通信部40と、制御部50bと、APデータ記憶部81と、ファイル管理情報記憶部82と、最終データ情報記憶部83bとを備える。
なお、本実施形態のICカード1bの外観図及びハード構成は、図1及び図2に示す第1の実施形態と同様であるのでその説明を省略する。また、図14において、図3に示す構成と同一の構成については同一の符号を付し、その説明を省略する。
FIG. 14 is a block diagram illustrating a functional configuration example of the IC card 1b according to the third embodiment.
As shown in FIG. 14, the IC card 1b includes a communication unit 40, a control unit 50b, an AP data storage unit 81, a file management information storage unit 82, and a final data information storage unit 83b.
The external view and the hardware configuration of the IC card 1b of the present embodiment are the same as those of the first embodiment shown in FIGS. In FIG. 14, the same components as those shown in FIG. 3 are denoted by the same reference numerals, and description thereof will be omitted.

最終データ情報記憶部83bは、例えば、EEPROM8により構成され、最後に正常に実行されたDGI(データ識別情報)を記憶するとともに、発行処理が完了している場合に、DGIの代わりに、例えば、“0x0000”などの発行処理が完了していることを示す情報(完了情報)を記憶する。   The final data information storage unit 83b is configured by, for example, the EEPROM 8, stores the last normally executed DGI (data identification information), and replaces the DGI when the issuance processing is completed. Information (completion information) indicating that the issuing process has been completed, such as “0x0000”, is stored.

制御部50bは、例えば、CPU5と、RAM7と、ROM6又はEEPROM8とにより実現され、ICカード1bを統括的に制御する。制御部50bは、ファイル管理部51と、コマンド処理部52bとを備える。   The control unit 50b is realized by, for example, the CPU 5, the RAM 7, the ROM 6, or the EEPROM 8, and controls the IC card 1b as a whole. The control unit 50b includes a file management unit 51 and a command processing unit 52b.

コマンド処理部52bは、基本的な機能は、第1の実施形態のコマンド処理部52と同様である。コマンド処理部52bは、STORE DATAコマンドの処理において、最終データ情報記憶部83bに、最後に正常に実行されたDGI(データ識別情報)を記憶させるとともに、LAST STORE DATAコマンドである場合に、最終データ情報記憶部83bに“0x0000”を記憶させる。   The basic function of the command processing unit 52b is the same as that of the command processing unit 52 of the first embodiment. In the processing of the STORE DATA command, the command processing unit 52b stores the last normally executed DGI (data identification information) in the final data information storage unit 83b, and outputs the last data when the command is the LAST STORE DATA command. “0x0000” is stored in the information storage unit 83b.

また、コマンド処理部52bは、SELECTコマンドの処理において、最終データ情報記憶部83bが記憶する情報が“0x0000”である場合に、発行処理が完了しているものと判定し、最終データ情報記憶部83bが記憶する情報が“0x0000”以外である場合に、当該情報を、最後に正常に実行されたDGIと判定する。コマンド処理部52bは、その他の処理は、第1の実施形態と同様である。   In the processing of the SELECT command, when the information stored in the final data information storage unit 83b is “0x0000”, the command processing unit 52b determines that the issuing process has been completed, and determines that the issuance processing has been completed. If the information stored in the 83b is other than “0x0000”, the information is determined to be the last normally executed DGI. Other processing of the command processing unit 52b is the same as that of the first embodiment.

次に、本実施形態のICカード1bの動作について説明する。
図15は、本実施形態のICカード1bのSTORE DATAコマンド処理の一例を示すフローチャートである。
この図において、ステップS501からステップS507までの処理は、上述した図7に示すステップS101からステップS107までの処理と同様であるため、ここではその説明を省略する。
Next, the operation of the IC card 1b of the present embodiment will be described.
FIG. 15 is a flowchart illustrating an example of the STORE DATA command processing of the IC card 1b of the present embodiment.
In this figure, the processing from step S501 to step S507 is the same as the processing from step S101 to step S107 shown in FIG. 7 described above, and a description thereof will be omitted here.

ステップS508において、ICカード1bのコマンド処理部52bは、“0x0000”を最終データ情報記憶部83bに記憶させる。ここでは、コマンド処理部52bは、発行処理が完了したことを示す完了情報として、“0x0000”を最終データ情報記憶部83bに記憶させる。   In step S508, the command processing unit 52b of the IC card 1b stores “0x0000” in the final data information storage unit 83b. Here, the command processing unit 52b stores “0x0000” in the final data information storage unit 83b as completion information indicating that the issuing process has been completed.

また、ステップS509及びステップS510の処理は、上述した図7に示すステップS209及びステップS210の処理と同様であるため、ここではその説明を省略する。   Further, the processing of steps S509 and S510 is the same as the processing of steps S209 and S210 shown in FIG. 7 described above, and a description thereof will be omitted here.

また、本実施形態のICカード1bのSELECTコマンド処理は、ステップS205の判定処理が異なる点を除いて、図8に示す処理と同様であるためここではその説明を省略する。
本実施形態では、ステップS205において、コマンド処理部52bは、最終データ情報記憶部83bに記憶させる情報が、“0x0000”であるか否かによって、発行処理が完了しているか否かを判定する。すなわち、コマンド処理部52bは、最終データ情報記憶部83bに記憶させる情報が、“0x0000”である場合に、発行処理が完了していると判定する。
Also, the SELECT command processing of the IC card 1b of the present embodiment is the same as the processing shown in FIG. 8 except that the determination processing in step S205 is different, and therefore the description thereof is omitted here.
In the present embodiment, in step S205, the command processing unit 52b determines whether or not the issuing process has been completed based on whether or not the information stored in the final data information storage unit 83b is “0x0000”. That is, when the information stored in the final data information storage unit 83b is “0x0000”, the command processing unit 52b determines that the issuing process has been completed.

以上説明したように、本実施形態のICカード1bでは、最終データ情報記憶部83bは、上述した最終データ情報記憶部83の機能と、完了情報記憶部84の機能とを共用する。すなわち、コマンド処理部52bは、最終データ情報記憶部83bに記憶させる情報に基づいて、発行処理が完了しているか否かを判定する。
これにより、本実施形態のICカード1bでは、完了情報記憶部84に必要なEEPROM8のメモリ領域を節約することができるため、EEPROM8のメモリ領域をより有効に利用することができる。
As described above, in the IC card 1b of the present embodiment, the final data information storage unit 83b shares the function of the above-described final data information storage unit 83 and the function of the completion information storage unit 84. That is, the command processing unit 52b determines whether or not the issuing process has been completed based on the information stored in the final data information storage unit 83b.
As a result, in the IC card 1b of the present embodiment, the memory area of the EEPROM 8 required for the completion information storage unit 84 can be saved, so that the memory area of the EEPROM 8 can be used more effectively.

(第4の実施形態)
次に、図面を参照して、上述したICカード1(1a、1b)を発行する発行装置20及びICカード発行システム200について説明する。
図16は、本実施形態のICカード発行システム200の構成例を示すブロック図である。
この図に示すように、ICカード発行システム200は、発行装置20とICカード1(1a、1b)とを備えている。
また、発行装置20は、通信部21と、発行情報記憶部22と、発行制御部23とを備えている。発行装置20は、例えば、発行者が発行工程(発行処理)に使用する装置である。
(Fourth embodiment)
Next, the issuing device 20 for issuing the above-described IC card 1 (1a, 1b) and the IC card issuing system 200 will be described with reference to the drawings.
FIG. 16 is a block diagram illustrating a configuration example of the IC card issuing system 200 according to the present embodiment.
As shown in this figure, the IC card issuing system 200 includes an issuing device 20 and an IC card 1 (1a, 1b).
The issuing device 20 includes a communication unit 21, an issuance information storage unit 22, and an issuance control unit 23. The issuing device 20 is, for example, a device used by an issuer in an issuing process (issuing process).

通信部21は、ICカード1(1a、1b)のコンタクト部3を介して、ICカード1(1a、1b)の通信部40と通信する。通信部21は、例えば、ICカード1(1a、1b)に情報を記憶させる書き込み要求(STORE DATAコマンド)などの各種コマンドをICカード1(1a、1b)に送信する。また、通信部21は、各種コマンドに応じた処理の実行結果であるレスポンスをICカード1(1a、1b)から受信する。   The communication unit 21 communicates with the communication unit 40 of the IC card 1 (1a, 1b) via the contact unit 3 of the IC card 1 (1a, 1b). The communication unit 21 transmits various commands such as a write request (STORE DATA command) for storing information in the IC card 1 (1a, 1b) to the IC card 1 (1a, 1b). In addition, the communication unit 21 receives, from the IC card 1 (1a, 1b), a response as an execution result of a process corresponding to various commands.

発行情報記憶部22は、ICカード1(1a)を発行する際に、ICカード1(1a、1b)に書き込む発行情報を複数記憶する。発行情報には、少なくともDGI(データ識別情報)と、当該DGIに対応する所定の領域(EF)に書き込むデータ(少なくともアプリケーションに対応したデータ)とを含んでいる。   The issuance information storage unit 22 stores a plurality of pieces of issuance information to be written to the IC card 1 (1a, 1b) when issuing the IC card 1 (1a). The issue information includes at least DGI (data identification information) and data (at least data corresponding to an application) to be written in a predetermined area (EF) corresponding to the DGI.

発行制御部23は、例えば、CPUなどを含むプロセッサであり、発行装置20を統括的に制御する。発行制御部23は、情報取得部231と、発行処理部232とを備えている。
情報取得部231(取得部の一例)は、発行情報記憶部22から発行情報を取得する。
The issuance control unit 23 is, for example, a processor including a CPU and the like, and controls the issuing device 20 as a whole. The issuance control unit 23 includes an information acquisition unit 231 and an issuance processing unit 232.
The information acquisition unit 231 (an example of an acquisition unit) acquires issue information from the issue information storage unit 22.

発行処理部232は、情報取得部231が取得した複数の発行情報を、所定の順序でSTORE DATAコマンド(書き込み要求)によりICカード1(1a、1b)に送信して、発行処理を実行する。また、発行処理部232は、発行処理の前に、最終データ情報記憶部83(83a、83b)が記憶するDGIをICカード1(1a、1b)から受信した場合に、所定の順序のうちの、受信したDGIに対応する発行情報に基づく順序位置から発行処理を開始する。   The issuance processing unit 232 transmits the plurality of pieces of issuance information acquired by the information acquisition unit 231 to the IC card 1 (1a, 1b) by a STORE DATA command (write request) in a predetermined order, and executes the issuance processing. The issuance processing unit 232, when receiving the DGI stored in the final data information storage unit 83 (83a, 83b) from the IC card 1 (1a, 1b) before the issuance process, , The issuance process is started from the order position based on the issuance information corresponding to the received DGI.

すなわち、発行処理部232は、発行処理の前に、SELECTコマンドを、通信部21を介して、ICカード1(1a、1b)に送信し、SELECTコマンドのレスポンスを、通信部21を介して、ICカード1(1a、1b)から受信する。発行処理部232は、当該レスポンスに“0xDF01”のTLV形式データD1によるDGIが含まれている場合に、受信したDGIに対応する発行情報の次の発行情報から発行処理を開始する。
なお、発行処理部232は、発行処理として、上述した図9及び図10に示す外部装置2と同様の処理を実行する。
That is, the issuance processing unit 232 transmits the SELECT command to the IC card 1 (1a, 1b) via the communication unit 21 and issues a response to the SELECT command via the communication unit 21 before the issuance process. Receive from IC card 1 (1a, 1b). When the response includes a DGI based on the TLV format data D1 of “0xDF01” in the response, the issuance processing unit 232 starts the issuance process from the issuance information next to the issuance information corresponding to the received DGI.
Note that the issuance processing unit 232 performs the same processing as that of the external device 2 illustrated in FIGS. 9 and 10 described above as the issuance processing.

次に図17を参照して、本実施形態のICカード発行システム200の動作について説明する。
図17は、本実施形態の発行装置20の動作の一例を示すフローチャートである。
図17に示すように、発行装置20の発行処理部232は、まず、複数の発行情報を発行情報記憶部22から取得する(ステップS601)。
Next, the operation of the IC card issuing system 200 of the present embodiment will be described with reference to FIG.
FIG. 17 is a flowchart illustrating an example of the operation of the issuing device 20 of the present embodiment.
As shown in FIG. 17, the issue processing unit 232 of the issue device 20 first acquires a plurality of pieces of issue information from the issue information storage unit 22 (Step S601).

次に、発行処理部232は、SELECTコマンドをICカード1(1a、1b)に送信する(ステップS602)。発行処理部232は、発行処理を行うアプリケーションを選択するSELECTコマンドを、通信部21を介して、ICカード1(1a、1b)に送信する。   Next, the issuance processing unit 232 transmits a SELECT command to the IC card 1 (1a, 1b) (Step S602). The issuance processing unit 232 transmits a SELECT command for selecting an application for which issuance processing is performed to the IC card 1 (1a, 1b) via the communication unit 21.

次に、発行処理部232は、SELECTコマンドのレスポンスを受信する(ステップS603)。発行処理部232は、通信部21を介して、FCIを含むSELECTコマンドのレスポンスを受信する。   Next, the issuance processing unit 232 receives a response to the SELECT command (Step S603). The issuance processing unit 232 receives, via the communication unit 21, a response to the SELECT command including the FCI.

次に、発行処理部232は、レスポンスに最終データ情報が含まれているか否かを判定する(ステップS604)。発行処理部232は、受信したレスポンスのFCIに、“0xDF01”のTLV形式データD1によるDGIが含まれているか否かを判定する。発行処理部232は、レスポンスに最終データ情報(TLV形式データD1のDGI)が含まれている場合(ステップS604:YES)に、処理をステップS605に進める。また、発行処理部232は、レスポンスに最終データ情報(TLV形式データD1のDGI)が含まれていない場合(ステップS604:NO)に、処理をステップS606に進める。   Next, the issuance processing unit 232 determines whether or not the final data information is included in the response (Step S604). The issuance processing unit 232 determines whether or not the FCI of the received response includes a DGI based on the TLV format data D1 of “0xDF01”. If the response includes final data information (DGI of the TLV format data D1) (step S604: YES), the issuance processing unit 232 advances the process to step S605. If the response does not include the final data information (DGI of the TLV format data D1) (step S604: NO), the issuance processing unit 232 advances the process to step S606.

ステップS605において、発行処理部232は、最終データ情報(受信DGI)に対応する発行情報の次の発行情報から発行処理を実行する。すなわち、発行処理部232は、最終データ情報(受信DGI)により、最終データ情報(受信DGI)まで発行処理が正常に実行されていると判定し、最終データ情報(受信DGI)の次の発行情報から発行処理を開始する。発行処理部232は、発行処理終了後に、処理を終了する。   In step S605, the issuance processing unit 232 performs the issuance process from the issuance information next to the issuance information corresponding to the final data information (reception DGI). That is, the issuance processing unit 232 determines from the final data information (reception DGI) that the issuance process has been performed normally up to the final data information (reception DGI), and issues the next issuance information after the final data information (reception DGI). To start the issuing process. The issuance processing unit 232 ends the processing after the issuance processing ends.

ステップS606において、発行処理部232は、複数の発行情報の最初から発行処理を実行する。発行処理部232は、発行処理終了後に、処理を終了する。   In step S606, the issuance processing unit 232 performs the issuance processing from the beginning of the plurality of pieces of issuance information. The issuance processing unit 232 ends the processing after the issuance processing ends.

以上説明したように、本実施形態による発行装置20は、情報取得部231(取得部)と、発行処理部232とを備える。情報取得部231は、少なくともアプリケーションに対応したデータと、DGI(データ識別情報)とを対応付けた発行情報を取得する。発行処理部232は、情報取得部231が取得した複数の発行情報を、所定の順序でSTORE DATAコマンド(書き込み要求)によりICカード1(1a、1b)に送信して、発行処理を実行する。また、発行処理部232は、発行処理の前に、最終データ情報記憶部83が記憶するデータ識別情報をICカード1(1a、1b)から受信した場合に、所定の順序のうちの、受信したDGI(データ識別情報)に対応する発行情報に基づく順序位置から発行処理を開始する。
これにより、本実施形態による発行装置20は、上述したICカード1(1a、1b)と同様の効果を奏し、発行処理が途中中断された場合に、発行処理を再開することができる。
As described above, the issuing device 20 according to the present embodiment includes the information acquisition unit 231 (acquisition unit) and the issuance processing unit 232. The information acquisition unit 231 acquires issuance information in which at least data corresponding to an application is associated with DGI (data identification information). The issuance processing unit 232 transmits the plurality of pieces of issuance information acquired by the information acquisition unit 231 to the IC card 1 (1a, 1b) by a STORE DATA command (write request) in a predetermined order, and executes the issuance processing. Further, when the issuance processing unit 232 receives the data identification information stored in the final data information storage unit 83 from the IC card 1 (1a, 1b) before the issuance processing, the issuance processing unit 232 receives the data identification information in a predetermined order. The issuing process starts from an order position based on the issuing information corresponding to the DGI (data identification information).
Thereby, the issuing device 20 according to the present embodiment has the same effect as the above-described IC card 1 (1a, 1b), and can restart the issuing process when the issuing process is interrupted halfway.

なお、上記の各実施形態において、書き込み要求の一例として、STORE DATAコマンドを用いる例を説明したが、例えば、WRITE BINARYコマンド、WRITE RECORDコマンドなどの他の書き込みコマンドを用いてもよい。   In the above embodiments, an example in which the STORE DATA command is used as an example of a write request has been described. However, for example, another write command such as a WRITE BINARY command or a WRITE RECORD command may be used.

また、上記の各実施形態において、LAST STORE DATAコマンドにより、完了情報記憶部84(84a)に、発行処理が完了したことを示す完了情報を記憶させる例を説明したが、これに限定されるものではない。例えば、発行処理が完了した際に、専用コマンドによって、完了情報記憶部84(84a)に、発行処理が完了したことを示す完了情報を記憶させるようにしてもよい。   Further, in each of the above embodiments, an example has been described in which the completion information indicating that the issuing process has been completed is stored in the completion information storage unit 84 (84a) by the LAST STORE DATA command. However, the present invention is not limited to this. is not. For example, when the issuing process is completed, the completion information indicating that the issuing process has been completed may be stored in the completion information storage unit 84 (84a) by a dedicated command.

また、上記の各実施形態において、データ識別情報の一例として、DGIを用いる例を説明したが、EFIDなどのファイルIDを用いるようにしてもよい。すなわち、最終データ情報記憶部83(83a、83b)には、最後に正常に実行されたEFIDを記憶するようにしてもよい。   Further, in each of the above-described embodiments, an example in which DGI is used as an example of data identification information has been described, but a file ID such as EFID may be used. That is, the final data information storage unit 83 (83a, 83b) may store the last normally executed EFID.

また、上記の各実施形態において、最終データ情報記憶部83(83a、83b)が記憶するDGIを、SELECTコマンドを用いて、ICカード1(1a、1b)の外部に送信させる例を説明したが、これに限定されるものではない。最終データ情報記憶部83(83a、83b)が記憶するDGIは、例えば、新たに追加された専用コマンドにより、外部に送信されるようにしてもよいし、他の既存のコマンドを用いるようにしてもよい。   In each of the above embodiments, an example has been described in which the DGI stored in the final data information storage unit 83 (83a, 83b) is transmitted to the outside of the IC card 1 (1a, 1b) using a SELECT command. However, the present invention is not limited to this. The DGI stored in the final data information storage unit 83 (83a, 83b) may be transmitted to the outside by a newly added dedicated command, for example, or by using another existing command. Is also good.

また、上記の各実施形態において、携帯可能電子装置の一例として、ICカード1(1a、1b)を用いる例を説明したが、これに限定されるものではない。携帯可能電子装置は、例えば、カード形状ではないICタグなどの電子装置であってもよい。   In each of the above embodiments, an example in which the IC card 1 (1a, 1b) is used as an example of a portable electronic device has been described, but the present invention is not limited to this. The portable electronic device may be, for example, an electronic device such as an IC tag that does not have a card shape.

また、上記の各実施形態において、ICカード1(1a、1b)は、コンタクト部3を介して外部装置2と通信する例を説明したが、コイルなどを用いたコンタクトレスインターフェースを介して外部装置2と通信するように構成してもよい。   Further, in each of the above-described embodiments, the example in which the IC card 1 (1a, 1b) communicates with the external device 2 via the contact unit 3 has been described, but the external device is connected via the contactless interface using a coil or the like. 2 may be configured to communicate.

また、上記の各実施形態において、ICカード1(1a、1b)は、書き換え可能な不揮発性メモリとして、EEPROM8を備える構成としたが、これに限定されるものではない。例えば、ICカード1(1a、1b)は、EEPROM8の代わりに、フラッシュメモリ、FeRAM(Ferroelectric Random Access Memory:強誘電体メモリ)などを備えてもよい。   Further, in each of the above embodiments, the IC card 1 (1a, 1b) includes the EEPROM 8 as a rewritable nonvolatile memory, but is not limited to this. For example, the IC card 1 (1a, 1b) may include a flash memory, a FeRAM (Ferroelectric Random Access Memory: ferroelectric memory) or the like instead of the EEPROM 8.

また、上記の第4の実施形態において、ICカード発行システム200は、発行装置20が発行情報記憶部22を備える例を説明したが、発行装置20の外部に発行情報記憶部22を備えるようにしてもよい。この場合、例えば、ネットワークを介して発行装置20と接続可能なサーバ装置などが、発行情報記憶部22を備えるようにしてもよい。   In the fourth embodiment, the IC card issuing system 200 has been described as an example in which the issuing device 20 includes the issuing information storage unit 22. However, the IC card issuing system 200 may include the issuing information storage unit 22 outside the issuing device 20. You may. In this case, for example, a server device or the like that can be connected to the issuing device 20 via a network may include the issuing information storage unit 22.

以上説明した少なくともひとつの実施形態によれば、APデータ記憶部81に記憶させるデータと、データを識別するデータ識別情報とを含む書き込みコマンドによって、データをAPデータ記憶部81に記憶させる書き込み処理が、最後に正常に実行されたデータ識別情報を記憶する最終データ情報記憶部83と、書き込みコマンドによって、アプリケーションに対応したデータをAPデータ記憶部81に記憶させる発行処理が完了したか否かを示す完了情報を記憶する完了情報記憶部84と、完了情報記憶部84が記憶する完了情報が、発行処理が完了していないことを示す場合に、最終データ情報記憶部83が記憶するデータ識別情報を外部装置2に送信する処理を行うコマンド処理部52とを持つことにより、発行処理が途中中断された場合に、発行処理を再開することができる。   According to at least one embodiment described above, a write process for storing data in the AP data storage unit 81 is performed by a write command including data to be stored in the AP data storage unit 81 and data identification information for identifying data. The last data information storage unit 83 that stores the last normally executed data identification information, and whether or not the issuance process of storing the data corresponding to the application in the AP data storage unit 81 by the write command is completed. When the completion information storage unit 84 that stores the completion information and the completion information that is stored in the completion information storage unit 84 indicate that the issuance process is not completed, the data identification information that is stored in the final data information storage unit 83 is stored. By having the command processing unit 52 for performing a process of transmitting to the external device 2, the issuing process is interrupted halfway. In the case was, it is possible to resume the issuing process.

上記実施形態は、以下のように表現することができる。
データを記憶するデータ記憶部と、
外部装置から受信した前記データ記憶部に記憶させるデータと、前記データを識別するデータ識別情報とを含む書き込み要求によって、前記データを前記データ記憶部に記憶させる書き込み処理が、最後に正常に実行された前記データ識別情報を記憶する最終データ情報記憶部と、
前記書き込み要求によって、アプリケーションに対応したデータを前記データ記憶部に記憶させる発行処理が完了したか否かを示す完了情報を記憶する完了情報記憶部と、
少なくともコンピュータが実行可能なプログラムに関する情報を記憶する記憶部と、
前記記憶部に記憶されたプログラムを実行するハードウェアプロセッサと、を備え、
前記ハードウェアプロセッサは、前記プログラムを実行することにより、
前記完了情報記憶部が記憶する前記完了情報が、前記発行処理が完了していないことを示す場合に、前記最終データ情報記憶部が記憶する前記データ識別情報を前記外部装置に送信する処理を行う
ように構成されている、携帯可能電子装置。
The above embodiment can be expressed as follows.
A data storage unit for storing data,
According to a write request including data to be stored in the data storage unit received from an external device and data identification information for identifying the data, a write process of storing the data in the data storage unit is finally normally performed. A final data information storage unit for storing the data identification information,
A completion information storage unit that stores completion information indicating whether or not an issuance process of storing data corresponding to an application in the data storage unit has been completed by the write request;
A storage unit that stores at least information on a program executable by the computer,
A hardware processor that executes a program stored in the storage unit,
The hardware processor executes the program,
When the completion information stored in the completion information storage unit indicates that the issuance process has not been completed, a process of transmitting the data identification information stored in the final data information storage unit to the external device is performed. A portable electronic device configured as follows.

なお、実施形態におけるICカード発行システム200及び発行装置20が備える各構成の機能を実現するためのプログラムをコンピュータ読み取り可能な記録媒体に記録して、この記録媒体に記録されたプログラムをコンピュータシステムに読み込ませ、実行することにより上述したICカード発行システム200及び発行装置20が備える各構成における処理を行ってもよい。ここで、「記録媒体に記録されたプログラムをコンピュータシステムに読み込ませ、実行する」とは、コンピュータシステムにプログラムをインストールすることを含む。ここでいう「コンピュータシステム」とは、OSや周辺機器等のハードウェアを含むものとする。
また、「コンピュータ読み取り可能な記録媒体」とは、フレキシブルディスク、光磁気ディスク、ROM、CD−ROM等の可搬媒体、コンピュータシステムに内蔵されるハードディスク等の記憶装置のことをいう。
A program for realizing the functions of the components included in the IC card issuing system 200 and the issuing device 20 according to the embodiment is recorded on a computer-readable recording medium, and the program recorded on the recording medium is stored in a computer system. By reading and executing, the above-described processing in each configuration included in the IC card issuing system 200 and the issuing device 20 may be performed. Here, "to make the computer system read and execute the program recorded on the recording medium" includes installing the program in the computer system. The “computer system” here includes an OS and hardware such as peripheral devices.
The “computer-readable recording medium” refers to a portable medium such as a flexible disk, a magneto-optical disk, a ROM, and a CD-ROM, and a storage device such as a hard disk built in a computer system.

本発明のいくつかの実施形態を説明したが、これらの実施形態は、例として提示したものであり、発明の範囲を限定することは意図していない。これら実施形態は、その他の様々な形態で実施されることが可能であり、発明の要旨を逸脱しない範囲で、種々の省略、置き換え、変更を行うことができる。これら実施形態やその変形は、発明の範囲や要旨に含まれると同様に、特許請求の範囲に記載された発明とその均等の範囲に含まれるものである。   Although several embodiments of the present invention have been described, these embodiments are provided by way of example and are not intended to limit the scope of the invention. These embodiments can be implemented in other various forms, and various omissions, replacements, and changes can be made without departing from the spirit of the invention. These embodiments and their modifications are included in the scope and gist of the invention, and are also included in the invention described in the claims and equivalents thereof.

1,1a,1b…ICカード、2…外部装置、3…コンタクト部、4…UART、5…CPU、6…ROM、7…RAM、8…EEPROM、10‥ICモジュール、20…発行装置、21,40…通信部、22…発行情報記憶部、23…発行制御部、50,50a,50b…制御部、51…ファイル管理部、52,52a,52b…コマンド処理部、81…APデータ記憶部、82…ファイル管理情報記憶部、83,83a,83b…最終データ情報記憶部、84…完了情報記憶部、100…ICチップ、200…ICカード発行システム、231…情報取得部、232…発行処理部、PT…カード基材   1, 1a, 1b IC card, 2 external device, 3 contact part, 4 UART, 5 CPU, 6 ROM, 7 RAM, 8 EEPROM, 10 IC module, 20 issuing device, 21 , 40 communication unit, 22 issue information storage unit, 23 issue control unit, 50, 50a, 50b control unit, 51 file management unit, 52, 52a, 52b command processing unit, 81 AP data storage unit , 82: File management information storage unit, 83, 83a, 83b: Final data information storage unit, 84: Completion information storage unit, 100: IC chip, 200: IC card issuing system, 231: Information acquisition unit, 232: Issuing process Part, PT ... card base material

Claims (8)

データを記憶するデータ記憶部と、
外部装置から受信したデータと、前記データを識別するデータ識別情報とを含んで、前記データ記憶部に書き込むよう要求する前記外部装置からのデータ書き込み要求によって、前記データを前記データ記憶部に記憶させる書き込み処理が、最後に正常に実行された前記データ識別情報を記憶する最終データ情報記憶部と、
前記書き込み要求によって、アプリケーションに対応したデータを前記データ記憶部に記憶させる発行処理が完了したか否かを示す完了情報を記憶する完了情報記憶部と、
前記完了情報記憶部が記憶する前記完了情報が、前記発行処理が完了していないことを示す場合に、前記最終データ情報記憶部が記憶する前記データ識別情報を前記外部装置に送信する処理を行う処理部と
を備える携帯可能電子装置。
A data storage unit for storing data,
Including the data received from the external device and the data identification information for identifying the data, storing the data in the data storage unit in response to a data write request from the external device that requests writing to the data storage unit A write process, a final data information storage unit that stores the data identification information that has been normally executed last,
A completion information storage unit that stores completion information indicating whether or not an issuance process of storing data corresponding to an application in the data storage unit has been completed by the write request;
When the completion information stored in the completion information storage unit indicates that the issuance process has not been completed, a process of transmitting the data identification information stored in the final data information storage unit to the external device is performed. A portable electronic device comprising: a processing unit.
前記処理部は、前記外部装置から受信した前記アプリケーションを選択する選択要求に応じて、前記完了情報が、前記発行処理が完了していないことを示す場合に、前記最終データ情報記憶部が記憶する前記データ識別情報を含む応答を前記外部装置に送信する処理を行う
請求項1に記載の携帯可能電子装置。
The processing unit stores the final data information storage unit when the completion information indicates that the issuing process has not been completed in response to a selection request for selecting the application received from the external device. The portable electronic device according to claim 1, performing a process of transmitting a response including the data identification information to the external device.
前記処理部は、前記完了情報が、前記発行処理が完了している場合に、前記最終データ情報記憶部が記憶する前記データ識別情報を含めない応答を前記外部装置に送信する処理を行う
請求項2に記載の携帯可能電子装置。
The processing unit performs a process of transmitting, to the external device, a response that does not include the data identification information stored in the final data information storage unit when the completion information indicates that the issuance process has been completed. 3. The portable electronic device according to 2.
前記最終データ情報記憶部は、前記アプリケーションを識別するアプリケーション識別情報と、前記アプリケーションの発行処理において、最後に正常に実行された前記データ識別情報とを対応付けて記憶し、
前記処理部は、前記アプリケーションを選択する選択要求に応じて、前記完了情報が、前記発行処理が完了していないことを示す場合に、前記選択要求に含まれる前記アプリケーション識別情報に対応付けられた前記データ識別情報を前記最終データ情報記憶部から取得し、取得した前記データ識別情報を含む応答を前記外部装置に送信する処理を行う
請求項2又は請求項3に記載の携帯可能電子装置。
The final data information storage unit stores the application identification information for identifying the application in association with the data identification information finally normally executed in the application issuing process,
The processing unit, in response to a selection request to select the application, when the completion information indicates that the issuance processing is not completed, the processing unit is associated with the application identification information included in the selection request The portable electronic device according to claim 2, wherein the data identification information is acquired from the final data information storage unit, and a process including transmitting the response including the acquired data identification information to the external device is performed.
前記処理部は、
前記書き込み要求に、前記データが前記発行処理の最後のデータであることを示す情報が含まれている場合に、前記発行処理が完了したことを示す情報を、前記完了情報として、前記完了情報記憶部に記憶させ、
前記書き込み要求に、前記データが前記発行処理の最後のデータであることを示す情報が含まれていない場合に、前記最終データ情報記憶部に、前記書き込み要求に含まれる前記データ識別情報を記憶させる
請求項1から請求項4のいずれか一項に記載の携帯可能電子装置。
The processing unit includes:
When the write request includes information indicating that the data is the last data of the issuance process, information indicating that the issuance process has been completed is stored as the completion information as the completion information. In the department
When the write request does not include information indicating that the data is the last data of the issuing process, the last data information storage unit stores the data identification information included in the write request. The portable electronic device according to claim 1.
前記処理部は、前記書き込み要求に、前記データが前記発行処理の最後のデータであることを示す情報が含まれている場合に、前記最終データ情報記憶部に記憶されている前記データ識別情報を削除する
請求項5に記載の携帯可能電子装置。
The processing unit, when the write request includes information indicating that the data is the last data of the issuing process, the data identification information stored in the final data information storage unit The portable electronic device according to claim 5.
データを記憶するデータ記憶部と、
外部装置から受信したデータと、前記データを識別するデータ識別情報とを含んで、前記データ記憶部に書き込むよう要求する前記外部装置からのデータ書き込み要求によって、前記データを前記データ記憶部に記憶させる書き込み処理が、最後に正常に実行された前記データ識別情報を記憶する最終データ情報記憶部と、
前記書き込み要求によって、アプリケーションに対応したデータを前記データ記憶部に記憶させる発行処理が完了したか否かを示す完了情報を記憶する完了情報記憶部と、
前記完了情報記憶部が記憶する前記完了情報が、前記発行処理が完了していないことを示す場合に、前記最終データ情報記憶部が記憶する前記データ識別情報を前記外部装置に送信する処理を行う処理部と
を備えるICモジュールと、
前記ICモジュールが埋め込まれたカード本体と
を備えるICカード。
A data storage unit for storing data,
Including the data received from the external device and the data identification information for identifying the data, storing the data in the data storage unit in response to a data write request from the external device that requests writing to the data storage unit A write process, a final data information storage unit that stores the data identification information that has been normally executed last,
A completion information storage unit that stores completion information indicating whether or not an issuance process of storing data corresponding to an application in the data storage unit has been completed by the write request;
When the completion information stored in the completion information storage unit indicates that the issuance process has not been completed, a process of transmitting the data identification information stored in the final data information storage unit to the external device is performed. An IC module comprising: a processing unit;
An IC card comprising: a card body in which the IC module is embedded.
請求項1から請求項6のいずれか一項に記載の携帯可能電子装置を発行する発行装置であって、
少なくとも前記アプリケーションに対応したデータと、前記データ識別情報とを対応付けた発行情報を取得する取得部と、
前記取得部が取得した複数の前記発行情報を、所定の順序で前記書き込み要求により前記携帯可能電子装置に送信して、前記発行処理を実行する発行処理部と
を備え、
前記発行処理部は、前記発行処理の前に、前記最終データ情報記憶部が記憶する前記データ識別情報を前記携帯可能電子装置から受信した場合に、前記所定の順序のうちの、受信した前記データ識別情報に対応する前記発行情報に基づく順序位置から前記発行処理を開始する
発行装置。
An issuing device that issues the portable electronic device according to any one of claims 1 to 6,
At least data corresponding to the application, an acquisition unit that acquires the issuance information that is associated with the data identification information,
An issuance processing unit that transmits the plurality of pieces of the issuance information acquired by the acquisition unit to the portable electronic device by the write request in a predetermined order, and executes the issuance processing,
The issuance processing unit, before the issuance process, when the data identification information stored in the final data information storage unit is received from the portable electronic device, the received data in the predetermined order, An issuing device that starts the issuing process from an order position based on the issuing information corresponding to identification information.
JP2018133423A 2018-07-13 2018-07-13 Portable electronic device, IC card, and issuing device Pending JP2020013212A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2018133423A JP2020013212A (en) 2018-07-13 2018-07-13 Portable electronic device, IC card, and issuing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018133423A JP2020013212A (en) 2018-07-13 2018-07-13 Portable electronic device, IC card, and issuing device

Publications (1)

Publication Number Publication Date
JP2020013212A true JP2020013212A (en) 2020-01-23

Family

ID=69170617

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018133423A Pending JP2020013212A (en) 2018-07-13 2018-07-13 Portable electronic device, IC card, and issuing device

Country Status (1)

Country Link
JP (1) JP2020013212A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114756440A (en) * 2022-03-31 2022-07-15 星汉智能科技股份有限公司 Data writing method, device and equipment of smart card and storage medium
JP7452750B1 (en) 2023-10-20 2024-03-19 大日本印刷株式会社 Electronic information storage medium, IC chip, IC card, public key verification method, and program

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114756440A (en) * 2022-03-31 2022-07-15 星汉智能科技股份有限公司 Data writing method, device and equipment of smart card and storage medium
CN114756440B (en) * 2022-03-31 2023-04-18 星汉智能科技股份有限公司 Data writing method, device and equipment of smart card and storage medium
JP7452750B1 (en) 2023-10-20 2024-03-19 大日本印刷株式会社 Electronic information storage medium, IC chip, IC card, public key verification method, and program

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
JP2020013212A (en) Portable electronic device, IC card, and issuing device
KR101783526B1 (en) Ic card, electronic device and portable electronic device
JP2014041552A (en) Ic card and portable electronic device
JP2008310596A (en) Portable electronic equipment and control method for potable electronic equipment
JP6499052B2 (en) IC card, IC module, and program
JP2010211516A (en) Portable electronic device and access control method in the same
JP7005934B2 (en) Electronic information storage medium, IC card, data transmission method, data writing method, data transmission program and data writing program
JP2011060136A (en) Portable electronic apparatus, and data management method in the same
JP7438432B1 (en) Electronic information storage medium, IC chip, IC card, record writing method, and program
JP6556489B2 (en) IC card, IC module, issuing device, issuing method, and issuing program
JP6370669B2 (en) IC card, portable electronic device, and IC card processing device
JP2012133656A (en) Portable electronic apparatus and ic card
JP6461759B2 (en) IC card and IC module
JP2019160189A (en) Portable electronic device and IC card
JP2019160190A (en) Portable electronic device and IC card
JP2019053557A (en) Portable electronic device and IC card
JP5038918B2 (en) Portable electronic device and method for controlling portable electronic device
JP6396124B2 (en) IC card, IC module, and IC card issuing method
JP6823289B2 (en) IC card and computer program
JP6039036B2 (en) IC card, portable electronic device, and control method of IC card
JP6015461B2 (en) Information recording medium, data read / write method, and data read / write program
JP2018152142A (en) IC card, portable electronic device, and IC card processing device
JP2009032249A (en) Portable electronic device, file management method for portable electronic device, and ic card