[go: up one dir, main page]

JP2014186378A - Ic card and portable electronic device - Google Patents

Ic card and portable electronic device Download PDF

Info

Publication number
JP2014186378A
JP2014186378A JP2013059010A JP2013059010A JP2014186378A JP 2014186378 A JP2014186378 A JP 2014186378A JP 2013059010 A JP2013059010 A JP 2013059010A JP 2013059010 A JP2013059010 A JP 2013059010A JP 2014186378 A JP2014186378 A JP 2014186378A
Authority
JP
Japan
Prior art keywords
application
card
area
storage area
function restriction
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.)
Granted
Application number
JP2013059010A
Other languages
Japanese (ja)
Other versions
JP6071677B2 (en
Inventor
Daisuke Tange
大輔 丹下
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toshiba Corp
Original Assignee
Toshiba Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Toshiba Corp filed Critical Toshiba Corp
Priority to JP2013059010A priority Critical patent/JP6071677B2/en
Publication of JP2014186378A publication Critical patent/JP2014186378A/en
Application granted granted Critical
Publication of JP6071677B2 publication Critical patent/JP6071677B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

【課題】アプリケーションが使用する十分な記憶領域を確保できない場合には、使用可能な記憶領域の空き容量に応じて各アプリケーションの動作を選択できるICカードおよび携帯可能電子装置を提供する。
【解決手段】第1の記憶手段は、アプリケーションに割り当てられる一時記憶領域を有する。第2の記憶手段は、第1の記憶手段においてアプリケーションに割り当て可能な一時記憶領域の定義情報を記憶する。算出手段は、通信部によりアプリケーションを指定するコマンドを受信した場合、定義情報により定義される一時記憶領域内の未使用領域の容量を算出する。判断手段は、算出手段により算出した未使用領域の容量に応じた前記アプリケーションに対する機能制限の有無を判断する。設定手段は、判断手段による判断結果に基づいてアプリケーションに対する機能制限の内容を示す機能制限情報を設定する。
【選択図】図2
Provided are an IC card and a portable electronic device that can select the operation of each application according to the free capacity of the usable storage area when a sufficient storage area to be used by the application cannot be secured.
The first storage means has a temporary storage area allocated to an application. The second storage means stores definition information of a temporary storage area that can be allocated to an application in the first storage means. The calculation means calculates the capacity of the unused area in the temporary storage area defined by the definition information when receiving a command designating the application by the communication unit. The determining means determines whether or not there is a function restriction on the application according to the unused area capacity calculated by the calculating means. The setting means sets function restriction information indicating the contents of function restriction on the application based on the determination result by the determination means.
[Selection] Figure 2

Description

本発明の実施形態は、ICカードおよび携帯可能電子装置に関する。   Embodiments described herein relate generally to an IC card and a portable electronic device.

ICカードなどの携帯可能電子装置は、CPU、RAMおよび書き換え可能な不揮発性メモリなどを有し、外部装置からのコマンドを解釈及び実行して、その処理結果を外部装置に提示する。従来、ICカードは、実行するアプリケーションに割り当て可能なRAM上の記憶領域が予め定義されている。ICカードは、予め定義されている記憶領域内で、実行するアプリケーションが使用する領域を順次確保する。しかしながら、ICカードは、アプリケーションが使用する十分な記憶領域を確保できない場合には、当該アプリケーションが実行できなくなる。   A portable electronic device such as an IC card has a CPU, a RAM, a rewritable nonvolatile memory, and the like, interprets and executes a command from the external device, and presents the processing result to the external device. Conventionally, in an IC card, a storage area on a RAM that can be assigned to an application to be executed is defined in advance. The IC card sequentially secures an area used by an application to be executed within a predefined storage area. However, if the IC card cannot secure a sufficient storage area for use by the application, the application cannot be executed.

特開2000−348146号公報JP 2000-348146 A

本発明の実施形態では、アプリケーションが使用する十分な記憶領域を確保できない場合には、使用可能な記憶領域の空き容量に応じて各アプリケーションの動作を選択できるICカードおよび携帯可能電子装置を提供することを目的とする。   Embodiments of the present invention provide an IC card and a portable electronic device that can select the operation of each application according to the free capacity of the usable storage area when a sufficient storage area used by the application cannot be secured. For the purpose.

実施形態によれば、ICカードは、通信部と、第1の記憶手段と、第2の記憶手段と、算出手段と、判断手段と、設定手段とを有する。通信部は、外部装置と通信する。第1の記憶手段は、アプリケーションに割り当てられる一時記憶領域を有する。第2の記憶手段は、第1の記憶手段においてアプリケーションに割り当て可能な一時記憶領域の定義情報を記憶する。算出手段は、通信部によりアプリケーションを指定するコマンドを受信した場合、定義情報により定義される一時記憶領域内の未使用領域の容量を算出する。判断手段は、算出手段により算出した未使用領域の容量に応じた前記アプリケーションに対する機能制限の有無を判断する。設定手段は、判断手段による判断結果に基づいてアプリケーションに対する機能制限の内容を示す機能制限情報を設定する。   According to the embodiment, the IC card includes a communication unit, a first storage unit, a second storage unit, a calculation unit, a determination unit, and a setting unit. The communication unit communicates with an external device. The first storage means has a temporary storage area allocated to the application. The second storage means stores definition information of a temporary storage area that can be allocated to an application in the first storage means. The calculation means calculates the capacity of the unused area in the temporary storage area defined by the definition information when receiving a command designating the application by the communication unit. The determining means determines whether or not there is a function restriction on the application according to the unused area capacity calculated by the calculating means. The setting means sets function restriction information indicating the contents of function restriction on the application based on the determination result by the determination means.

図1は、実施形態に係るICカードとICカード処理装置とを有するICカードシステムの構成例を示す図である。FIG. 1 is a diagram illustrating a configuration example of an IC card system including an IC card and an IC card processing device according to the embodiment. 図2は、実施形態に係るICカードの構成例を示すブロック図である。FIG. 2 is a block diagram illustrating a configuration example of the IC card according to the embodiment. 図3は、実施形態に係るICカードの不揮発性メモリが記憶するファイルの管理構造の例を示す図である。FIG. 3 is a diagram illustrating an example of a management structure of files stored in the nonvolatile memory of the IC card according to the embodiment. 図4は、実施形態に係るICカード内の不揮発性メモリ24における記憶領域の構成例を示す図である。FIG. 4 is a diagram illustrating a configuration example of a storage area in the nonvolatile memory 24 in the IC card according to the embodiment. 図5は、実施形態に係るICカードに適用可能なコマンドフォーマットの例である。FIG. 5 is an example of a command format applicable to the IC card according to the embodiment. 図6は、実施形態に係るICカードの不揮発性メモリに格納される登録アプリケーションテーブルの構成例に示す図である。FIG. 6 is a diagram illustrating a configuration example of a registered application table stored in the nonvolatile memory of the IC card according to the embodiment. 図7は、実施形態に係るICカードのRAM23における記憶領域の構成例を示す図である。FIG. 7 is a diagram illustrating a configuration example of a storage area in the RAM 23 of the IC card according to the embodiment. 図8は、実施形態に係るICカードにおけるTransient Areaの空き容量を算出する算出処理の手順を示すフローチャートである。FIG. 8 is a flowchart illustrating a calculation process procedure for calculating the free space of the Transient Area in the IC card according to the embodiment. 図9は、実施形態に係るICカードがSELECTコマンドを受信した場合の処理の流れを説明するためのフローチャートである。FIG. 9 is a flowchart for explaining the flow of processing when the IC card according to the embodiment receives a SELECT command. 図10は、実施形態に係るICカードがSELECTメソッドの処理例を説明するためのフローチャートである。FIG. 10 is a flowchart for explaining a processing example of the SELECT method by the IC card according to the embodiment.

以下、実施形態について、図面を参照して説明する。
図1は、実施形態に係る携帯可能電子装置としてのICカード2と、ICカード2と通信を行う外部装置としてのICカード処理装置1の構成について説明するためのブロック図である。
Hereinafter, embodiments will be described with reference to the drawings.
FIG. 1 is a block diagram for explaining a configuration of an IC card 2 as a portable electronic device according to the embodiment and an IC card processing device 1 as an external device that communicates with the IC card 2.

ICカード2は、外部装置としてのICカード処理装置1から与えられるコマンドを処理し、その処理結果をレスポンスとして出力する携帯可能電子装置である。また、ICカード処理装置1は、ICカード2に対して処理を要求するコマンドを供給し、ICカード2からの処理結果を示すレスポンスを受信する装置である。   The IC card 2 is a portable electronic device that processes a command given from the IC card processing device 1 as an external device and outputs the processing result as a response. The IC card processing device 1 is a device that supplies a command requesting processing to the IC card 2 and receives a response indicating the processing result from the IC card 2.

まず、ICカード処理装置1の構成について説明する。
図1に示す構成例において、ICカード処理装置1は、制御部10、および、カードリーダライタ15、操作部17、および、ディスプレイ18を有する。また、制御部10は、CPU11、ROM12、RAM13、および、不揮発性メモリ14を有する。たとえば、制御部10は、パーソナルコンピュータ(PC)により構成されるようにしても良い。CPU11、ROM12、RAM13、不揮発性メモリ14、カードリーダライタ15、操作部17及びディスプレイ18は、それぞれバスを介して互いに接続される。
First, the configuration of the IC card processing apparatus 1 will be described.
In the configuration example illustrated in FIG. 1, the IC card processing device 1 includes a control unit 10, a card reader / writer 15, an operation unit 17, and a display 18. The control unit 10 includes a CPU 11, a ROM 12, a RAM 13, and a nonvolatile memory 14. For example, the control unit 10 may be configured by a personal computer (PC). The CPU 11, the ROM 12, the RAM 13, the nonvolatile memory 14, the card reader / writer 15, the operation unit 17 and the display 18 are connected to each other via a bus.

CPU11は、ICカード処理装置1全体の制御を司る。CPU11は、ROM12又は不揮発性メモリ14に記憶されている制御プログラムを実行することにより種々の処理を行う。例えば、CPU11は、カードリーダライタ15を介してICカード2とコマンド及びレスポンスの送受信を行う。   The CPU 11 controls the entire IC card processing apparatus 1. The CPU 11 performs various processes by executing a control program stored in the ROM 12 or the nonvolatile memory 14. For example, the CPU 11 transmits and receives commands and responses to and from the IC card 2 via the card reader / writer 15.

ROM12は、予め制御用のプログラム及び制御データなどを記憶する不揮発性のメモリである。RAM13は、ワーキングメモリとして機能する揮発性のメモリである。RAM13は、CPU11の処理中のデータなどを一時的に格納する。例えば、RAM13は、カードリーダライタ15を介して外部の機器と送受信するデータを一時的に格納する。また、RAM13は、CPU11が実行するプログラムを一時的に格納する。   The ROM 12 is a non-volatile memory that stores a control program and control data in advance. The RAM 13 is a volatile memory that functions as a working memory. The RAM 13 temporarily stores data being processed by the CPU 11. For example, the RAM 13 temporarily stores data to be transmitted / received to / from an external device via the card reader / writer 15. The RAM 13 temporarily stores a program executed by the CPU 11.

不揮発性メモリ14は、例えば、EEPROMなどの書き換え可能な不揮発性メモリにより構成する。不揮発性メモリ14は、例えば、制御用のプログラム、制御データ、アプリケーション、及びアプリケーションに用いられるデータなどを記憶する。   The nonvolatile memory 14 is configured by a rewritable nonvolatile memory such as an EEPROM, for example. The nonvolatile memory 14 stores, for example, a control program, control data, an application, and data used for the application.

カードリーダライタ15は、ICカード2との通信を行うためのインターフェース装置である。カードリーダライタ15は、ICカード2の通信方式に応じたインターフェースにより構成される。たとえば、ICカード2が接触型のICカードである場合、カードリーダライタ15は、ICカード2のコンタクト部と物理的かつ電気的に接続するための接触部などにより構成される。   The card reader / writer 15 is an interface device for performing communication with the IC card 2. The card reader / writer 15 is configured by an interface corresponding to the communication method of the IC card 2. For example, when the IC card 2 is a contact type IC card, the card reader / writer 15 is configured by a contact portion for physically and electrically connecting with a contact portion of the IC card 2.

また、ICカード2が非接触型のICカードである場合、カードリーダライタ15は、ICカード2との無線通信を行うためのアンテナおよび通信制御部などにより構成される。カードリーダライタ15では、ICカード2に対する電源供給、クロック供給、リセット制御、データの送受信が行われるようになっている。このような機能によってカードリーダライタ15は、制御部10のCPU11による制御に基づいてICカード2の活性化(起動)、種々のコマンドの送信、及び送信したコマンドに対する応答(レスポンス)の受信などを行なう。   When the IC card 2 is a non-contact type IC card, the card reader / writer 15 includes an antenna for performing wireless communication with the IC card 2 and a communication control unit. The card reader / writer 15 performs power supply, clock supply, reset control, and data transmission / reception with respect to the IC card 2. With such a function, the card reader / writer 15 activates (activates) the IC card 2, transmits various commands, and receives responses to the transmitted commands based on control by the CPU 11 of the control unit 10. Do.

操作部17は、ICカード処理装置1の操作者によって、種々の操作指示が入力される。操作部17は、操作者に入力された操作指示のデータをCPU11へ送信する。操作部17は、たとえば、キーボード、テンキー、及び、タッチパネルなどである。   Various operation instructions are input to the operation unit 17 by the operator of the IC card processing apparatus 1. The operation unit 17 transmits operation instruction data input to the operator to the CPU 11. The operation unit 17 is, for example, a keyboard, a numeric keypad, and a touch panel.

ディスプレイ18は、CPU11の制御により種々の情報を表示する表示装置である。ディスプレイ18は、たとえば、液晶表示装置である。
次に、ICカード2について説明する。
ICカード2は、ICカード処理装置1などの上位機器から電力などの供給を受けて活性化される(動作可能な状態になる)ようになっている。例えば、ICカード2が接触型の通信によりICカード処理装置1と接続される場合、つまり、ICカード2が接触型のICカードで構成される場合、ICカード2は、通信インターフェースとしてのコンタクト部を介してICカード処理装置1からの動作電源及び動作クロックの供給を受けて活性化される。
The display 18 is a display device that displays various information under the control of the CPU 11. The display 18 is, for example, a liquid crystal display device.
Next, the IC card 2 will be described.
The IC card 2 is activated (becomes operable) upon receiving power or the like from a host device such as the IC card processing device 1. For example, when the IC card 2 is connected to the IC card processing device 1 by contact-type communication, that is, when the IC card 2 is configured by a contact-type IC card, the IC card 2 is a contact unit as a communication interface. The IC card processor 1 is activated by receiving the operation power supply and the operation clock from the IC card processing apparatus 1 through the IC card.

また、ICカード2が非接触型の通信方式によりICカード処理装置1と接続される場合、つまり、ICカード2が非接触式のICカードで構成される場合、ICカード2は、通信インターフェースとしてのアンテナ及び変復調回路などを介してICカード処理装置1からの電波を受信し、その電波から図示しない電源部により動作電源及び動作クロックを生成して活性化するようになっている。   Further, when the IC card 2 is connected to the IC card processing device 1 by a non-contact type communication method, that is, when the IC card 2 is constituted by a non-contact type IC card, the IC card 2 is used as a communication interface. A radio wave is received from the IC card processing apparatus 1 via the antenna and modulation / demodulation circuit, and an operation power supply and an operation clock are generated from the radio wave by a power supply unit (not shown) and activated.

次に、ICカード2の構成例について説明する。
図2は、実施形態に係るICカード2の構成例を概略的に示すブロック図である。
ICカード2は、プラスチックなどで形成されたカード状の本体Cを有する。ICカード2は、本体C内にモジュールMが内蔵されている。モジュールMは、1つまたは複数のICチップCaと通信部としての外部インターフェース(通信インターフェース)とが接続された状態で一体的に形成され、ICカード2の本体C内に埋設されている。
Next, a configuration example of the IC card 2 will be described.
FIG. 2 is a block diagram schematically showing a configuration example of the IC card 2 according to the embodiment.
The IC card 2 has a card-like main body C formed of plastic or the like. The IC card 2 has a module M built in the main body C. The module M is integrally formed in a state where one or a plurality of IC chips Ca and an external interface (communication interface) as a communication unit are connected, and is embedded in the main body C of the IC card 2.

図2に示す構成例において、ICカード2は、CPU21、ROM22、RAM23、不揮発性メモリ(NVM)24、UART(通信部)25、および、コプロセッサ(co−processor)26を備えている。これらの各部は、データバスを介して互いに接続されている。また、CPU21、ROM22、RAM23、および不揮発性メモリ24は、1つ又は複数のICチップCaにより構成され、通信部25に接続された状態でモジュールMを構成している。   In the configuration example illustrated in FIG. 2, the IC card 2 includes a CPU 21, a ROM 22, a RAM 23, a nonvolatile memory (NVM) 24, a UART (communication unit) 25, and a co-processor (co-processor) 26. These units are connected to each other via a data bus. Further, the CPU 21, ROM 22, RAM 23, and nonvolatile memory 24 are configured by one or a plurality of IC chips Ca, and configure the module M in a state of being connected to the communication unit 25.

CPU21は、ICカード2全体の制御を司る制御部として機能する。CPU21は、ROM22あるいは不揮発性メモリ24に記憶されている制御プログラム及び制御データに基づいて種々の処理を行う。たとえば、CPU21は、ROM22に記憶されているプログラムを実行することにより、ICカード2の動作制御あるいはICカード2の運用形態に応じた種々の処理を行う。なお、各種の機能のうちの一部は、ハードウエア回路により実現されるものであっても良い。この場合、CPU21は、ハードウエア回路により実行される機能を制御する。   The CPU 21 functions as a control unit that controls the entire IC card 2. The CPU 21 performs various processes based on the control program and control data stored in the ROM 22 or the nonvolatile memory 24. For example, the CPU 21 executes various programs according to the operation control of the IC card 2 or the operation mode of the IC card 2 by executing a program stored in the ROM 22. Note that some of the various functions may be realized by a hardware circuit. In this case, the CPU 21 controls functions executed by the hardware circuit.

ROM22は、予め制御用のプログラム及び制御データなどを記憶する不揮発性のメモリである。ROM22は、製造段階で制御プログラム及び制御データなどを記憶した状態でICカード2に組み込まれる。即ち、ROM22に記憶される制御プログラム及び制御データは、予めICカード2の仕様に応じて組み込まれる。   The ROM 22 is a non-volatile memory that stores a control program and control data in advance. The ROM 22 is incorporated in the IC card 2 in a state where a control program, control data, and the like are stored at the manufacturing stage. That is, the control program and control data stored in the ROM 22 are incorporated in advance according to the specifications of the IC card 2.

RAM23は、揮発性のメモリである。RAM23は、CPU21の処理中のデータなどを一時的に格納する。たとえば、RAM23は、計算用バッファ、受信用バッファ、送信用バッファなどとして機能する。計算用バッファとしては、CPU21が実行する種々の演算処理の結果などを一時的に保持する。受信用バッファとしては、通信部25を介してICカード処理装置1から受信するコマンドを保持する。送信用バッファとしては、通信部25を介してICカード処理装置1へ送信するデータを保持する。   The RAM 23 is a volatile memory. The RAM 23 temporarily stores data being processed by the CPU 21. For example, the RAM 23 functions as a calculation buffer, a reception buffer, a transmission buffer, and the like. The calculation buffer temporarily holds the results of various arithmetic processes executed by the CPU 21. As a reception buffer, a command received from the IC card processing apparatus 1 via the communication unit 25 is held. As a transmission buffer, data to be transmitted to the IC card processing apparatus 1 via the communication unit 25 is held.

不揮発性メモリ24は、例えば、EEPROMあるいはフラッシュROMなどのデータの書き込み及び書換えが可能な不揮発性のメモリにより構成される。不揮発性メモリ24は、ICカード2の運用用途に応じて制御プログラム、アプリケーション、及び種々のデータを格納する。例えば、不揮発性メモリ24では、プログラムファイル及びデータファイルなどが作成される。作成された各ファイルは、制御プログラム及び種々のデータなどが書き込まれる。   The nonvolatile memory 24 is configured by a nonvolatile memory capable of writing and rewriting data, such as an EEPROM or a flash ROM. The non-volatile memory 24 stores a control program, an application, and various data according to the usage application of the IC card 2. For example, in the nonvolatile memory 24, a program file and a data file are created. Each created file is written with a control program and various data.

UART25は、ICカード処理装置1のカードリーダライタ15との通信を行うためのインターフェースである。ICカード2が接触型のICカードとして実現される場合、UART25は、ICカード処理装置1のカードリーダライタ15と物理的かつ電気的に接触して信号の送受信を行うための通信制御部とコンタクト部とにより構成される。また、ICカード2が非接触型のICカードとして実現される場合、UART25は、ICカード処理装置1のカードリーダライタ15との無線通信を行うための変復調回路などの通信制御部とアンテナとにより構成される。
コプロセッサ26は、暗号化及び複合化を行うものである。
The UART 25 is an interface for communicating with the card reader / writer 15 of the IC card processing apparatus 1. When the IC card 2 is realized as a contact-type IC card, the UART 25 is in contact with a communication control unit for transmitting and receiving signals in physical and electrical contact with the card reader / writer 15 of the IC card processing apparatus 1. Part. When the IC card 2 is realized as a non-contact type IC card, the UART 25 includes a communication control unit such as a modulation / demodulation circuit for performing wireless communication with the card reader / writer 15 of the IC card processing device 1 and an antenna. Composed.
The coprocessor 26 performs encryption and decryption.

次に、不揮発性メモリ24が記憶するファイルについて説明する。
図3は、不揮発性メモリ24が記憶するファイルの管理構造の例を示す図である。
図3に示す例では、不揮発性メモリ24には、MF(Master File)30、DF(Dedicated File)32、35、38、41、および、EF(Elementary File)33、34、36、37、39、40、42、43などの複数のファイルを記憶する。これらのファイルは、階層構造で管理される。また、各ファイルは、定義情報によって定義される。なお、図3に示すようなファイル構造およびファイル定義は、たとえば、ICカードの国際的な標準規格であるISO/IEC 7816−4などで規定されている。
Next, files stored in the nonvolatile memory 24 will be described.
FIG. 3 is a diagram showing an example of a management structure of files stored in the nonvolatile memory 24. As shown in FIG.
In the example shown in FIG. 3, the nonvolatile memory 24 includes an MF (Master File) 30, a DF (Dedicated File) 32, 35, 38, 41, and an EF (Elementary File) 33, 34, 36, 37, 39. , 40, 42, 43, etc. are stored. These files are managed in a hierarchical structure. Each file is defined by definition information. Note that the file structure and file definition shown in FIG. 3 are defined by, for example, ISO / IEC 7816-4, which is an international standard for IC cards.

図3に示す構成例において、最上階層のMF30の次の階層には、DF31(DF1(DF name:APL1))、DF35(DF2(DF name:APL2))、DF38(DF3(DF name:APL3))、DF41(DF4(DF name:APL4))が存在する。たとえば、1つのDFは、当該ICカード2が具備する1つのアプリケーション(アプレット)を実現するためのデータが格納される。複数のアプリケーションによって複数の機能を実現しているICカード2は、各アプリケーションに対応する複数のDFを不揮発性メモリ24内に設けるようにして良い。   In the configuration example shown in FIG. 3, DF 31 (DF 1 (DF name: APL 1)), DF 35 (DF 2 (DF name: APL 2)), DF 38 (DF 3 (DF name: APL 3)) are placed next to the MF 30 of the top layer. ), DF41 (DF4 (DF name: APL4)) exists. For example, one DF stores data for realizing one application (applet) included in the IC card 2. The IC card 2 realizing a plurality of functions by a plurality of applications may be provided with a plurality of DFs corresponding to each application in the nonvolatile memory 24.

また、図3に示す構成例において、DF32(DF1)の配下としての次の階層には、EF33(EF1−1)、および、EF34(EF1−1)が存在している。また、DF35(DF2)の配下としての次の階層には、EF36(EF2−1)、および、EF37(EF2−2)が存在している。また、DF38(DF3)の配下としての次の階層には、EF39(EF3−1)、および、EF40(EF3−2)が存在している。また、DF41(DF4)の配下としての次の階層には、EF42(EF3−1)、および、EF43(EF4−2)が存在している。   In the configuration example shown in FIG. 3, EF33 (EF1-1) and EF34 (EF1-1) exist in the next hierarchy under DF32 (DF1). Moreover, EF36 (EF2-1) and EF37 (EF2-2) exist in the next hierarchy under DF35 (DF2). Moreover, EF39 (EF3-1) and EF40 (EF3-2) exist in the next hierarchy under DF38 (DF3). Further, EF42 (EF3-1) and EF43 (EF4-2) exist in the next hierarchy under DF41 (DF4).

各EF33、34、36、37、39、40、42、43は、個々のアプリケーションで使われるデータを格納するデータファイルである。各EF33、34、36、37、39、40、42、43は、たとえば、ISO/IEC7816−4で規定されるEF(である。各EFは、それぞれのEF定義情報で定義される。各EFのEF定義情報は、各EFの種別(ファイル種別)を示すファイル種別情報が設定されている。つまり、各EFは、EF定義情報のファイル種別情報により種別が判別される。   Each of the EFs 33, 34, 36, 37, 39, 40, 42, and 43 is a data file that stores data used in each application. Each of the EFs 33, 34, 36, 37, 39, 40, 42, and 43 is, for example, EF (specified by ISO / IEC 7816-4. Each EF is defined by the respective EF definition information. In the EF definition information, file type information indicating the type (file type) of each EF is set, that is, each EF is identified by the file type information of the EF definition information.

次に、ICカード2の不揮発性メモリ24におけるデータ領域の構成について説明する。
図4は、ICカード2内の不揮発性メモリ24における記憶領域の構成例を示す図である。
図4に示す構成例において、不揮発性メモリ24は、システム領域51及びアプリケーション領域52などを有するデータメモリとして機能する。
Next, the configuration of the data area in the nonvolatile memory 24 of the IC card 2 will be described.
FIG. 4 is a diagram illustrating a configuration example of a storage area in the nonvolatile memory 24 in the IC card 2.
In the configuration example shown in FIG. 4, the nonvolatile memory 24 functions as a data memory having a system area 51 and an application area 52.

システム領域51は、ICカード2の基本的な動作を実行するためのデータが格納されている。システム領域51に格納されるデータは、ICカード2の仕様に応じて設定される情報であり、たとえば、フェーズ情報、ATR情報、及び、ファイル管理テーブルなどを含む情報である。フェーズ情報は、ICカード2の製造、発行、運用、運用終了などのICカード2のフェーズを示す。ATR情報は、ICカード2が活性化した後、外部装置に出力する初期応答を示す。ファイル管理テーブルは、ファイルの識別情報、先頭アドレスなどを示す情報を格納する。   The system area 51 stores data for executing basic operations of the IC card 2. The data stored in the system area 51 is information set according to the specifications of the IC card 2, and is information including, for example, phase information, ATR information, and a file management table. The phase information indicates the phase of the IC card 2 such as the manufacture, issue, operation, and end of operation of the IC card 2. The ATR information indicates an initial response output to the external device after the IC card 2 is activated. The file management table stores information indicating file identification information, head address, and the like.

システム領域51には、アプリケーションに対応するDFを管理する登録アプリケーションテーブル51aが設けられる。登録アプリケーションテーブル51aは、当該ICカード2に登録されているアプリケーションに対応するDFの識別情報(DF名(DF name))とDFの識別情報が示すDFのメモリ上の位置を示す情報(ポインタ)とを有する。   In the system area 51, a registered application table 51a for managing a DF corresponding to an application is provided. The registered application table 51a includes DF identification information (DF name (DF name)) corresponding to an application registered in the IC card 2 and information (pointer) indicating a position on the memory of the DF indicated by the DF identification information. And have.

また、システム領域51は、各アプリケーションがデータを一時的に記憶するために使用するRAM23上の一時記憶領域としてのトランジェントエリア(Transient Area)23a(図7参照)を定義する定義情報を記憶するTransient Area23aの定義情報記憶領域51bを有する。定義情報記憶領域51bには、RAM23におけるTransient Area23aの開始アドレスとTransient Area23aの終了アドレスとを記憶する。   The system area 51 stores definition information for defining a transient area 23a (see FIG. 7) as a temporary storage area on the RAM 23 used by each application to temporarily store data. The definition information storage area 51b of the Area 23a is included. The definition information storage area 51b stores the start address of the transient area 23a and the end address of the transient area 23a in the RAM 23.

アプリケーション領域52は、各アプリケーションが使用するファイルの定義情報領域およびデータ格納領域などを有する。不揮発性メモリ24に記憶する各ファイルは、定義情報領域に記憶されるファイル定義情報と定義情報領域のファイル定義情報で定義されるデータ格納領域のデータエリアに記憶されるデータ(ファイルデータ)とにより構成される。たとえば、ICカード2では、図3に示すように、アプリケーションのフォルダに相当するDF、および、データファイルに相当するEFを階層構造で管理する。この場合、DFは、アプリケーション領域52の定義情報領域に記憶されるDF定義情報で定義される。EFは、アプリケーション領域52の定義情報領域に記憶されるEF定義情報とそのEF定義情報で定義されるアプリケーション領域52のデータ格納領域におけるデータエリアとにより構成される。   The application area 52 includes a definition information area and a data storage area for files used by each application. Each file stored in the nonvolatile memory 24 includes file definition information stored in the definition information area and data (file data) stored in the data area of the data storage area defined by the file definition information in the definition information area. Composed. For example, in the IC card 2, as shown in FIG. 3, a DF corresponding to an application folder and an EF corresponding to a data file are managed in a hierarchical structure. In this case, the DF is defined by DF definition information stored in the definition information area of the application area 52. The EF includes EF definition information stored in the definition information area of the application area 52 and a data area in the data storage area of the application area 52 defined by the EF definition information.

次に、ICカード処理装置1がICカード2に処理を要求するコマンドについて説明する。
図5は、ISO/IEC7816−4で規定されるICカードのコマンドフォーマットの例である。
図5に示す構成例において、コマンドは、クラスバイト(CLA)、インストラクションバイト(INS)、パラメータバイト(P2、P2)、Lcフィールド、コマンドデータフィールド、および、Leフィールドにより構成する。
Next, a command for requesting processing from the IC card processing apparatus 1 to the IC card 2 will be described.
FIG. 5 shows an example of the command format of the IC card defined by ISO / IEC7816-4.
In the configuration example shown in FIG. 5, the command is composed of a class byte (CLA), an instruction byte (INS), a parameter byte (P2, P2), an Lc field, a command data field, and a Le field.

クラスバイト(CLA)は、コマンドの種別を示す。インストラクションバイト(INS)は、コマンドを示す。パラメータバイト(P2、P2)は、コマンドオプション指定を示す。Lcフィールドは、後続のコマンドデータフィールドの長さを示す。コマンドデータフィールドは、コマンド処理に使用するデータを示す。Leフィールドは、コマンドへの応答として返されるレスポンスデータの最大長を示す。   The class byte (CLA) indicates the type of command. The instruction byte (INS) indicates a command. The parameter bytes (P2, P2) indicate command option designation. The Lc field indicates the length of the subsequent command data field. The command data field indicates data used for command processing. The Le field indicates the maximum length of response data returned as a response to the command.

ICカード処理装置1からのコマンドを受信した場合、ICカード2の制御素子(CPU)21は、図4に示すフォーマットに従って受信したコマンドを解析し、受信したコマンドが要求する処理内容を認識し、コマンドが要求する処理を実行する。   When receiving a command from the IC card processing device 1, the control element (CPU) 21 of the IC card 2 analyzes the received command according to the format shown in FIG. 4, recognizes the processing content requested by the received command, Performs the processing requested by the command.

次に、不揮発性メモリ24のシステム領域51に設けられる登録アプリケーションテーブルについて説明する。
図6は、不揮発性メモリ24のシステム領域51に設けられる登録アプリケーションテーブル51aの構成例を示す図である。
図6に示す例において、登録アプリケーションテーブル51aは、当該ICカード2に登録されているアプリケーションのDF名(DF name)と、各アプリケーションのDFの位置を示すポインタとを記憶する。
Next, a registered application table provided in the system area 51 of the nonvolatile memory 24 will be described.
FIG. 6 is a diagram showing a configuration example of a registered application table 51 a provided in the system area 51 of the nonvolatile memory 24.
In the example shown in FIG. 6, the registered application table 51 a stores a DF name (DF name) of an application registered in the IC card 2 and a pointer indicating the DF position of each application.

ICカード2は、受信したコマンドのデータフィールドでDF Nameが指定された場合、指定された値と登録アプリケーションテーブル51aのDF Nameとを比較して一致するものを検索する。たとえば、コマンドのデータフィールドで指定された値がAPL1である場合、図6に示す登録アプリケーションテーブル51aを参照すれば、ICカード2は、指定されたDF Nameと一致するアプリケーション(DF)が存在し、そのDFの位置を示すポインタが「10000」であることを認識する。   When the DF Name is specified in the data field of the received command, the IC card 2 compares the specified value with the DF Name in the registered application table 51a and searches for a match. For example, if the value specified in the data field of the command is APL1, referring to the registered application table 51a shown in FIG. 6, the IC card 2 has an application (DF) that matches the specified DF Name. , It recognizes that the pointer indicating the position of the DF is “10000”.

次に、RAM23におけるメモリ領域について説明する。
図7は、RAM23におけるメモリ領域の構成を概略的に示す図である。
図7に示すように、揮発性メモリとしてのRAM23のメモリ領域の一部には、Transient Area23aが定義される。また、Transient Area23aにおいて使用されている領域を示す情報は、RAM23のメモリ領域におけるTransient Area23a以外に設けられた使用アドレス記憶領域23bに書き込まれる。
Next, the memory area in the RAM 23 will be described.
FIG. 7 is a diagram schematically showing the configuration of the memory area in the RAM 23.
As shown in FIG. 7, a Transient Area 23a is defined in a part of the memory area of the RAM 23 as a volatile memory. Information indicating the area used in the Transient Area 23a is written in a used address storage area 23b provided in the memory area of the RAM 23 other than the Transient Area 23a.

Transient Area23aは、上述しように、アプリケーションがデータを一時的に記憶するために使用可能な記憶領域である。Transient Area23aは、予めRAM23のメモリ領域中に定義される記憶領域である。アプリケーションがデータを一時的に記憶する領域を確保する必要が生じた場合、各アプリケーションの確保領域(各アプリケーションに対して確保するTransient Area内の領域)は、RAM23上のTransient Area23aの先頭アドレスから必要な容量分が順番に確保される。   As described above, the Transient Area 23a is a storage area that can be used by an application to temporarily store data. The Transient Area 23a is a storage area defined in advance in the memory area of the RAM 23. When it becomes necessary for the application to secure an area for temporarily storing data, the secure area for each application (the area in the Transient Area secured for each application) is required from the start address of the Transient Area 23a on the RAM 23. A sufficient capacity is secured in order.

たとえば、Transient Area23aを使用しているアプリケーションがなければ、最初のアプリケーション用の確保領域は、Transient Area23aの先頭アドレスから当該アプリケーションが必要な容量分の記憶領域が確保される。また、すでにTransient Area23aの一部を使用しているアプリケーションがある場合、次のアプリケーションには、Transient Area23a内において使用中の領域の最終アドレスに続くアドレス(未使用領域の先頭アドレス)から、当該アプリケーションが必要な容量分の記憶領域が確保される。また、Transient Area23aの一部を確保していたアプリケーションがデータを一時的に記憶する領域が不要になった場合(つまり、アプリケーションを終了する場合)、当該アプリケーションが確保していた記憶領域は解放される。   For example, if there is no application using the Transient Area 23a, a storage area for the capacity required by the application is secured from the start address of the Transit Area 23a as the secure area for the first application. If there is an application that already uses a part of the Transient Area 23a, the next application uses the application from the address following the last address of the area in use in the Transient Area 23a (the start address of the unused area). A storage area for the necessary capacity is secured. In addition, when an area that temporarily stores data in the Transient Area 23a becomes unnecessary (that is, when the application is terminated), the storage area reserved by the application is released. The

次に、RAM23におけるTransient Areaの空きメモリ容量を算出処理について説明する。
上述したように、Transient Area23aの開始アドレスおよびTransient Area23aの終了アドレスは、図4に示すように、不揮発性メモリ24のシステム領域51における定義領域51aに書き込まれる。また、Transient Area23a内でアプリケーションに確保した領域の最終アドレス(Transient Area23a内における使用中の記憶領域の最終アドレス)は、Transient Area23aの使用済みアドレスとして、図7に示す使用アドレス記憶領域23bに書き込まれる。したがって、ICカード2の制御素子21は、Transient Area23aの終了アドレスからTransient Area23a内の使用済みアドレスの差分を取ることにより、現時点でのTransient Area23aの空きメモリ容量を算出することが可能となる。
Next, the calculation process of the free memory capacity of the Transient Area in the RAM 23 will be described.
As described above, the start address of the transient area 23a and the end address of the transient area 23a are written in the definition area 51a in the system area 51 of the nonvolatile memory 24 as shown in FIG. Further, the final address of the area reserved for the application in the Transient Area 23a (the final address of the storage area in use in the Transient Area 23a) is written to the used address storage area 23b shown in FIG. 7 as the used address of the Transient Area 23a. . Therefore, the control element 21 of the IC card 2 can calculate the free memory capacity of the Transient Area 23a at the present time by taking the difference between the end address of the Transient Area 23a and the used address in the Transient Area 23a.

図8は、Transient Area23aの空きメモリ容量を算出する算出処理の手順を示すフローチャートである。
Transient Area23aの空きメモリ容量を算出する場合、制御素子21は、RAM23の使用アドレス記憶領域23bからるTransient Area23aの使用済みアドレス(例えば、「A」とする)を取得する(ステップS100)。次に、制御素子21は、不揮発性メモリ24のシステム領域51におけるTransient Area23aの定義情報記憶領域51bからTransient Area23aの終了アドレス(例えば、「B」とする)を取得する。取得したTransient Area23aの使用済みアドレス(A)とTransient Area23aの終了アドレス(B)の差分値(B−A)を算出し、その差分値からTransient Area23aの空きメモリ容量を判断する。
FIG. 8 is a flowchart showing the procedure of the calculation process for calculating the free memory capacity of the Transient Area 23a.
When calculating the free memory capacity of the Transient Area 23a, the control element 21 acquires the used address (for example, “A”) of the Transient Area 23a from the used address storage area 23b of the RAM 23 (step S100). Next, the control element 21 acquires the end address (for example, “B”) of the Transient Area 23 a from the definition information storage area 51 b of the Transient Area 23 a in the system area 51 of the nonvolatile memory 24. A difference value (B−A) between the used address (A) of the acquired transient area 23 a and the end address (B) of the transient area 23 a is calculated, and the free memory capacity of the transient area 23 a is determined from the difference value.

次に、上記のような構成のICカード2におけるSELECTコマンドに対するSELECT処理について説明する。
図9は、ICカード2におけるSELECT処理の流れを説明するためのフローチャートである。
ICカード処理装置1から供給される電力により活性化したICカード2は、ICカード処理装置1が送信するコマンドをUART25により受信する。UART25によりコマンドを受信すると、ICカード2の制御素子21は、図5に示すようなコマンドフォーマットに従って受信したコマンドを解析し、コマンドが要求する処理内容を認識する。ここでは、制御素子21は、受信したコマンドの「CLA」、「INS」がSELECTコマンドであるか否かをチェックする(ステップS103)。
Next, a SELECT process for the SELECT command in the IC card 2 configured as described above will be described.
FIG. 9 is a flowchart for explaining the flow of SELECT processing in the IC card 2.
The IC card 2 activated by the power supplied from the IC card processing apparatus 1 receives a command transmitted from the IC card processing apparatus 1 by the UART 25. When the command is received by the UART 25, the control element 21 of the IC card 2 analyzes the received command according to the command format as shown in FIG. 5, and recognizes the processing content requested by the command. Here, the control element 21 checks whether or not “CLA” and “INS” of the received command are SELECT commands (step S103).

受信したコマンドがSELECTコマンドでないと判断した場合(ステップS103、NO)、制御素子21は、受信したコマンドに応じた処理を実行する(ステップS105)。また、受信したコマンドがSELECTコマンドであると判断した場合(ステップS103、YES)、制御素子21は、登録アプリケーションテーブル51aに登録されている各DFのDF Nameを参照する(読み込む)(ステップS104)。登録アプリケーションテーブル51aに登録されているDF Nameを読み込むと、制御素子21は、登録アプリケーションテーブル51aに登録されているDF Nameが受信コマンドのデータフィールド(「Data」)のDF Nameと一致しているか否かを確認する(ステップS106)。   If it is determined that the received command is not a SELECT command (step S103, NO), the control element 21 executes processing according to the received command (step S105). If it is determined that the received command is a SELECT command (step S103, YES), the control element 21 refers to (reads) the DF Name of each DF registered in the registered application table 51a (step S104). . When the DF Name registered in the registered application table 51a is read, the control element 21 checks whether the DF Name registered in the registered application table 51a matches the DF Name in the data field (“Data”) of the received command. It is confirmed whether or not (step S106).

受信したコマンドのDF nameと登録アプリケーションテーブル51aに登録されているDF nameとが一致しない場合(ステップS106、NO)、制御素子21は、SELECTコマンドに対する処理がエラーとなったと判断する(ステップS108)。受信したSELECTコマンドに対する処理がエラーとなったと判断した場合、制御素子21は、当該SELECTコマンドが「異常終了」である旨の応答ステータスをUART25によりICカード処理装置1へ送信する(ステップS112)。   When the DF name of the received command does not match the DF name registered in the registered application table 51a (NO in step S106), the control element 21 determines that the process for the SELECT command has an error (step S108). . If it is determined that the processing for the received SELECT command has resulted in an error, the control element 21 transmits a response status indicating that the SELECT command is “abnormal termination” to the IC card processing device 1 by the UART 25 (step S112).

また、受信したコマンドのDF nameと登録アプリケーションテーブル51aに登録されているDF nameとが一致する場合(ステップS106、YES)、制御素子21は、Transient Area23aの空きメモリ容量を算出する算出処理を実行する(ステップS107)。   When the DF name of the received command matches the DF name registered in the registered application table 51a (step S106, YES), the control element 21 executes a calculation process for calculating the free memory capacity of the Transient Area 23a. (Step S107).

Transient Area23aの空きメモリ容量を算出すると、ICカード2の制御素子21は、受信したSELECTコマンドで指定されたアプリケーションに選択されたことを知らせるためにSELECTメソッドを呼ぶ。すなわち、制御素子21は、上記算出処理により算出したTransient Area23aの空き容量をSELECT メソッドの引数にセットし(ステップS109)、SELECT メソッドを実行する(ステップS110)。SELECTメソッドは、Transient Area23aの空き容量に応じてSELECTコマンドで指定されたアプリケーションの動作を判定する処理である。SELECTメソッドの処理手順については、後述するものとする。   When the free memory capacity of the Transient Area 23a is calculated, the control element 21 of the IC card 2 calls the SELECT method to notify the application designated by the received SELECT command that it has been selected. That is, the control element 21 sets the free capacity of the Transient Area 23a calculated by the above calculation process as an argument of the SELECT method (step S109), and executes the SELECT method (step S110). The SELECT method is a process for determining the operation of the application designated by the SELECT command according to the free space of the Transient Area 23a. The processing procedure of the SELECT method will be described later.

SELECTメソッドを実行すると、制御素子21は、SELECTメソッドの戻り値(実行結果)が正常応答であるか判断する(ステップS111)。SELECTメソッドの戻り値が正常応答であれば(ステップS111、YES)、制御素子21は、SELECTコマンドに対する応答として、当該SELECTコマンドが「正常終了」である旨の応答ステータスをUART25によりICカード処理装置1へ送信する(ステップS113)。この場合、制御素子21は、アプリケーションの機能制限の有無を示す不揮発性メモリ24(又はRAM23)に設けた制限フラグをアプリケーションの機能制限が無いことを示す値(たとえば、「0」)のままとする。   When the SELECT method is executed, the control element 21 determines whether the return value (execution result) of the SELECT method is a normal response (step S111). If the return value of the SELECT method is a normal response (step S111, YES), the control element 21 sends a response status indicating that the SELECT command is “normal end” as a response to the SELECT command by the UART 25 by the IC card processing device. 1 (step S113). In this case, the control element 21 keeps the limit flag provided in the non-volatile memory 24 (or RAM 23) indicating whether or not there is an application function restriction as a value (for example, “0”) indicating that there is no application function restriction. To do.

また、SELECTメソッドの戻り値が正常応答でなければ(ステップS111、NO)、制御素子21は、SELECTメソッドの戻り値が警告応答か判断する(ステップS114)。SELECTメソッドの戻り値が警告応答であれば(ステップS114、YES)、制御素子21は、アプリケーションの機能を制限することを示す値(たとえば、「1」)を不揮発性メモリ24(又はRAM23)に設けた制限フラグに書き込むことにより制限フラグをセットする(ステップS115)。制限フラグをセットすると、制御素子21は、SELECTコマンドに対する応答として、当該SELECTコマンドが「警告終了」である旨の応答ステータスをUART25によりICカード処理装置1へ送信する(ステップS116)。   If the return value of the SELECT method is not a normal response (step S111, NO), the control element 21 determines whether the return value of the SELECT method is a warning response (step S114). If the return value of the SELECT method is a warning response (step S114, YES), the control element 21 stores a value (for example, “1”) indicating that the function of the application is restricted in the nonvolatile memory 24 (or RAM 23). The restriction flag is set by writing to the provided restriction flag (step S115). When the restriction flag is set, the control element 21 transmits, as a response to the SELECT command, a response status indicating that the SELECT command is “warning end” to the IC card processing apparatus 1 by the UART 25 (step S116).

SELECTメソッドの戻り値が正常応答でも警告応答でもなければ(ステップS114、YES)、制御素子21は、SELECTコマンドに対する応答として、当該SELECTコマンドで指定されたアプリケーションが実行不可となる「異常終了」である旨の応答ステータスをUART25によりICカード処理装置1へ送信する(ステップS117)。   If the return value of the SELECT method is neither a normal response nor a warning response (YES in step S114), the control element 21 is “abnormal termination” in which the application specified by the SELECT command becomes unexecutable as a response to the SELECT command. A response status to that effect is transmitted to the IC card processing apparatus 1 by the UART 25 (step S117).

次に、SELECTメソッドの処理について説明する。
図9は、アプリケーションが実行するSELECTメソッドの処理の例を示すフローチャートである。
SELECTメソッドが呼ばれると、制御素子21は、引数に指定されている値(Transient Area23aの空き容量)がアプリケーション実行に十分か判断する(ステップS120)。Transient Area23aの空き容量が十分であると判断した場合(ステップS120、YES)、制御素子21は、SELECTメソッドの戻り値を正常応答とする(ステップS121)。
Next, processing of the SELECT method will be described.
FIG. 9 is a flowchart illustrating an example of a SELECT method process executed by the application.
When the SELECT method is called, the control element 21 determines whether the value specified in the argument (the free capacity of the Transient Area 23a) is sufficient for application execution (step S120). When it is determined that the free space of the Transient Area 23a is sufficient (step S120, YES), the control element 21 sets the return value of the SELECT method as a normal response (step S121).

Transient Area23aの空き容量がアプリケーション実行に不十分であると判断した場合(ステップS120、NO)、制御素子21は、アプリケーションの機能を制限して当該アプリケーションを実行可能であるか否かを判断する(ステップS122)。アプリケーションが機能を制限して実行可能であると判断した場合(ステップS122、YES)、制御素子21は、SELECTメソッドの戻り値を警告応答とする(ステップS123)。機能を制限してもアプリケーションの実行が不可能と判断した場合(ステップS122、YES)、制御素子21は、SELECTメソッドの戻り値を異常応答とする(ステップS124)。   When it is determined that the free space of the Transient Area 23a is insufficient for application execution (step S120, NO), the control element 21 determines whether or not the application can be executed by limiting the function of the application ( Step S122). When it is determined that the application can be executed with the function limited (step S122, YES), the control element 21 sets the return value of the SELECT method as a warning response (step S123). If it is determined that the application cannot be executed even if the function is restricted (step S122, YES), the control element 21 sets the return value of the SELECT method as an abnormal response (step S124).

なお、上記の処理例では、機能を制限して当該アプリケーションが実行可能であるか否かを判断するものとしたが、Transient Area23aの空き容量に応じて当該アプリケーションに対して複数段階(レベル)の機能制限を判断するようにしても良い。この場合、制御素子21は、制限フラグに代えて当該アプリケーションに対する機能制限のレベルを示す機能制限情報を不揮発性メモリ24又はRAM23に書き込むようにすれば良い。   In the above processing example, the function is limited to determine whether or not the application can be executed. However, there are multiple levels (levels) for the application according to the free capacity of the Transient Area 23a. The function restriction may be determined. In this case, the control element 21 may write function restriction information indicating the function restriction level for the application in the nonvolatile memory 24 or the RAM 23 instead of the restriction flag.

上記のように、SELECTコマンドを受信した場合、ICカード2は、Transient Area23aの空き容量を算出する。ICカード2は、SELECTコマンドで指定されたアプリケーションが十分な記憶領域を確保できない場合、一部の機能が使用可能となる領域を確保できれば、不揮発性メモリ24に当該アプリケーションに対する機能制限を示す制限フラグをセットする。ICカード2は、SELECTコマンドで指定されたアプリケーションが後続のコマンドを受信した場合、制限フラグを読み込むことにより、機能を縮小して動作させる。   As described above, when the SELECT command is received, the IC card 2 calculates the free capacity of the Transient Area 23a. When the application specified by the SELECT command cannot secure a sufficient storage area, the IC card 2 can set a restriction flag indicating a function restriction on the application in the nonvolatile memory 24 if an area where a part of the functions can be used is secured. Set. When the application specified by the SELECT command receives a subsequent command, the IC card 2 operates with a reduced function by reading a restriction flag.

上記のような実施形態によれば、ICカード2では、RAMのTransient Area23a内に十分な記憶領域を確保できないアプリケーションであっても、機能を縮小して動作させることが可能となる。この結果として、アプリケーションの選択処理以降の処理がメモリ容量不足で完全に実行することができなくなることを軽減できる。   According to the embodiment as described above, the IC card 2 can be operated with reduced functions even if the application cannot secure a sufficient storage area in the Transient Area 23a of the RAM. As a result, it is possible to reduce the case where the processing after the application selection processing cannot be executed completely due to insufficient memory capacity.

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

C…本体、M…モジュール、Ca…ICチップ、1…ICカード処理装置、2…ICカード、10…制御部、15…カードリーダライタ、17…操作部、18…ディスプレイ、21…制御素子(CPU、算出手段、判断手段、設定手段)、22…ROM、23…RAM(第1の記憶手段、揮発性メモリ)、23a…トランジェントエリア(一時記憶領域)、23b…使用アドレス記憶領域、24…不揮発性メモリ(第2の記憶手段)、25…UART(通信部)、51…システム領域、51a…登録アプリケーションテーブル、51b…定義情報記憶領域、52…アプリケーション領域。   C ... Main body, M ... Module, Ca ... IC chip, 1 ... IC card processing device, 2 ... IC card, 10 ... Control unit, 15 ... Card reader / writer, 17 ... Operation unit, 18 ... Display, 21 ... Control element ( CPU, calculation means, determination means, setting means), 22 ... ROM, 23 ... RAM (first storage means, volatile memory), 23a ... transient area (temporary storage area), 23b ... address storage area used, 24 ... Nonvolatile memory (second storage means), 25... UART (communication unit), 51... System area, 51 a... Registered application table, 51 b.

Claims (8)

外部装置と通信する通信部と、
アプリケーションに割り当てられる一時記憶領域を有する第1の記憶手段と、
前記第1の記憶手段においてアプリケーションに割り当て可能な一時記憶領域の定義情報を記憶する第2の記憶手段と、
前記通信部によりアプリケーションを指定するコマンドを受信した場合、前記定義情報により定義される一時記憶領域内の未使用領域の容量を算出する算出手段と、
前記算出手段により算出した未使用領域の容量に応じた前記アプリケーションに対する機能制限の有無を判断する判断手段と、
前記判断手段による判断結果に基づいて前記アプリケーションに対する機能制限の内容を示す機能制限情報を設定する設定手段と、
を有するICカード。
A communication unit that communicates with an external device;
First storage means having a temporary storage area allocated to the application;
Second storage means for storing definition information of a temporary storage area that can be assigned to an application in the first storage means;
A calculation means for calculating a capacity of an unused area in a temporary storage area defined by the definition information when a command specifying an application is received by the communication unit;
Determining means for determining whether or not there is a function restriction for the application according to the capacity of the unused area calculated by the calculating means;
Setting means for setting function restriction information indicating the contents of function restriction for the application based on the determination result by the determination means;
IC card having
前記判断手段は、前記未使用領域の容量に応じて、前記アプリケーションの全機能が実行可能、前記アプリケーションの一部の機能が実行可能、あるいは、前記アプリケーションの全機能が実行不可能の何れかを決定する、
前記請求項1に記載のICカード。
The determination means determines whether all functions of the application can be executed, some functions of the application can be executed, or all functions of the application cannot be executed, depending on the capacity of the unused area. decide,
The IC card according to claim 1.
前記設定手段は、前記アプリケーションの一部の機能が実行可能と判断した場合、前記機能制限情報としての制限フラグをセットする、
前記請求項2に記載のICカード。
The setting means sets a restriction flag as the function restriction information when it is determined that a part of the functions of the application is executable.
The IC card according to claim 2.
前記算出手段は、前記通信部によりアプリケーションを指定するセレクトコマンドを受信した場合、前記一時記憶領域内の未使用領域の容量を算出する、
前記請求項1乃至3の何れか1項に記載のICカード。
The calculation means calculates a capacity of an unused area in the temporary storage area when receiving a select command designating an application by the communication unit;
The IC card according to any one of claims 1 to 3.
前記第1の記憶手段は、揮発性メモリである、
前記請求項1乃至4の何れか1項に記載のICカード。
The first storage means is a volatile memory;
The IC card according to any one of claims 1 to 4.
前記第2の記憶手段は、不揮発性メモリである、
前記請求項1乃至5の何れか1項に記載のICカード。
The second storage means is a nonvolatile memory;
The IC card according to any one of claims 1 to 5.
外部装置と通信する通信部と、アプリケーションに割り当てられる一時記憶領域を有する第1の記憶手段と、前記第1の記憶手段においてアプリケーションに割り当て可能な一時記憶領域の定義情報を記憶する第2の記憶手段と、前記通信部によりアプリケーションを指定するコマンドを受信した場合、前記定義情報により定義される一時記憶領域内の未使用領域の容量を算出する算出手段と、前記算出手段により算出した未使用領域の容量に応じた前記アプリケーションに対する機能制限の有無を判断する判断手段と、前記判断手段による判断結果に基づいて前記アプリケーションに対する機能制限の内容を示す機能制限情報を設定する設定手段と、を備えるモジュールと、
前記モジュールを具備する本体と、
を有するICカード。
A communication unit that communicates with an external device, a first storage unit having a temporary storage area allocated to the application, and a second storage that stores definition information of the temporary storage area that can be allocated to the application in the first storage unit And means for calculating the capacity of the unused area in the temporary storage area defined by the definition information when the command specifying the application is received by the communication unit, and the unused area calculated by the calculating means A determination unit that determines whether or not there is a function restriction on the application according to the capacity of the application; and a setting unit that sets function restriction information indicating the content of the function restriction on the application based on a determination result by the determination unit. When,
A main body comprising the module;
IC card having
外部装置と通信する通信部と、
アプリケーションに割り当てられる一時記憶領域を有する第1の記憶手段と、
前記第1の記憶手段においてアプリケーションに割り当て可能な一時記憶領域の定義情報を記憶する第2の記憶手段と、
前記通信部によりアプリケーションを指定するコマンドを受信した場合、前記定義情報により定義される一時記憶領域内の未使用領域の容量を算出する算出手段と、
前記算出手段により算出した未使用領域の容量に応じた前記アプリケーションに対する機能制限の有無を判断する判断手段と、
前記判断手段による判断結果に基づいて前記アプリケーションに対する機能制限の内容を示す機能制限情報を設定する設定手段と、
を有する携帯可能電子装置。
A communication unit that communicates with an external device;
First storage means having a temporary storage area allocated to the application;
Second storage means for storing definition information of a temporary storage area that can be assigned to an application in the first storage means;
A calculation means for calculating a capacity of an unused area in a temporary storage area defined by the definition information when a command specifying an application is received by the communication unit;
Determining means for determining whether or not there is a function restriction for the application according to the capacity of the unused area calculated by the calculating means;
Setting means for setting function restriction information indicating the contents of function restriction for the application based on the determination result by the determination means;
A portable electronic device.
JP2013059010A 2013-03-21 2013-03-21 IC card, IC module, and portable electronic device Expired - Fee Related JP6071677B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013059010A JP6071677B2 (en) 2013-03-21 2013-03-21 IC card, IC module, and portable electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013059010A JP6071677B2 (en) 2013-03-21 2013-03-21 IC card, IC module, and portable electronic device

Publications (2)

Publication Number Publication Date
JP2014186378A true JP2014186378A (en) 2014-10-02
JP6071677B2 JP6071677B2 (en) 2017-02-01

Family

ID=51833934

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013059010A Expired - Fee Related JP6071677B2 (en) 2013-03-21 2013-03-21 IC card, IC module, and portable electronic device

Country Status (1)

Country Link
JP (1) JP6071677B2 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000066882A (en) * 1998-08-19 2000-03-03 Hitachi Ltd IC card and IC card program management method
JP2007206895A (en) * 2006-01-31 2007-08-16 Dainippon Printing Co Ltd IC card
JP2008186167A (en) * 2007-01-29 2008-08-14 Kyocera Corp Electronic device and control method in electronic device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000066882A (en) * 1998-08-19 2000-03-03 Hitachi Ltd IC card and IC card program management method
JP2007206895A (en) * 2006-01-31 2007-08-16 Dainippon Printing Co Ltd IC card
JP2008186167A (en) * 2007-01-29 2008-08-14 Kyocera Corp Electronic device and control method in electronic device

Also Published As

Publication number Publication date
JP6071677B2 (en) 2017-02-01

Similar Documents

Publication Publication Date Title
US9183400B2 (en) IC card and IC card control method
US8931705B2 (en) IC card, mobile electronic device and data processing method in IC card
US8645624B2 (en) Portable electronic device, smartcard and control method for portable electronic device
US10498671B2 (en) IC card, portable electronic apparatus, and IC card processing apparatus
KR101783526B1 (en) Ic card, electronic device and portable electronic device
JP2017126125A (en) IC card, portable electronic device and processing device
US20120234926A1 (en) Portable electronic apparatus
JP6071677B2 (en) IC card, IC module, and portable electronic device
JP2010211516A (en) Portable electronic device and access control method in the same
JP5957347B2 (en) IC card and portable electronic device
JP2012133656A (en) Portable electronic apparatus and ic card
US11868836B2 (en) IC card and control program for IC card
JP5932588B2 (en) IC card, portable electronic device, and IC card processing device
JP2014182639A (en) Ic card and portable electronic device
JP6039036B2 (en) IC card, portable electronic device, and control method of IC card
EP3144905B1 (en) Ic card and ic module
JP2025103789A (en) Portable electronic device and IC card
JP5728323B2 (en) IC card and portable electronic device
JP2014006631A (en) Ic card and portable electronic device
JP5038918B2 (en) Portable electronic device and method for controlling portable electronic device
JP2008242998A (en) IC card
JP2014063304A (en) Ic card and portable electronic equipment
JP2014127129A (en) Ic card and portable electronic device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20151006

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20160726

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20160816

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20161006

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20161206

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20161227

R151 Written notification of patent or utility model registration

Ref document number: 6071677

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313114

Free format text: JAPANESE INTERMEDIATE CODE: R313111

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees