JP2014186378A - Ic card and portable electronic device - Google Patents
Ic card and portable electronic device Download PDFInfo
- 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
Links
Images
Landscapes
- Stored Programmes (AREA)
Abstract
【課題】アプリケーションが使用する十分な記憶領域を確保できない場合には、使用可能な記憶領域の空き容量に応じて各アプリケーションの動作を選択できるICカードおよび携帯可能電子装置を提供する。
【解決手段】第1の記憶手段は、アプリケーションに割り当てられる一時記憶領域を有する。第2の記憶手段は、第1の記憶手段においてアプリケーションに割り当て可能な一時記憶領域の定義情報を記憶する。算出手段は、通信部によりアプリケーションを指定するコマンドを受信した場合、定義情報により定義される一時記憶領域内の未使用領域の容量を算出する。判断手段は、算出手段により算出した未使用領域の容量に応じた前記アプリケーションに対する機能制限の有無を判断する。設定手段は、判断手段による判断結果に基づいてアプリケーションに対する機能制限の内容を示す機能制限情報を設定する。
【選択図】図2Provided 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.
本発明の実施形態では、アプリケーションが使用する十分な記憶領域を確保できない場合には、使用可能な記憶領域の空き容量に応じて各アプリケーションの動作を選択できる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カード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カード2は、外部装置としてのICカード処理装置1から与えられるコマンドを処理し、その処理結果をレスポンスとして出力する携帯可能電子装置である。また、ICカード処理装置1は、ICカード2に対して処理を要求するコマンドを供給し、ICカード2からの処理結果を示すレスポンスを受信する装置である。
The
まず、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
In the configuration example illustrated in FIG. 1, the IC
CPU11は、ICカード処理装置1全体の制御を司る。CPU11は、ROM12又は不揮発性メモリ14に記憶されている制御プログラムを実行することにより種々の処理を行う。例えば、CPU11は、カードリーダライタ15を介してICカード2とコマンド及びレスポンスの送受信を行う。
The CPU 11 controls the entire IC
ROM12は、予め制御用のプログラム及び制御データなどを記憶する不揮発性のメモリである。RAM13は、ワーキングメモリとして機能する揮発性のメモリである。RAM13は、CPU11の処理中のデータなどを一時的に格納する。例えば、RAM13は、カードリーダライタ15を介して外部の機器と送受信するデータを一時的に格納する。また、RAM13は、CPU11が実行するプログラムを一時的に格納する。
The
不揮発性メモリ14は、例えば、EEPROMなどの書き換え可能な不揮発性メモリにより構成する。不揮発性メモリ14は、例えば、制御用のプログラム、制御データ、アプリケーション、及びアプリケーションに用いられるデータなどを記憶する。
The
カードリーダライタ15は、ICカード2との通信を行うためのインターフェース装置である。カードリーダライタ15は、ICカード2の通信方式に応じたインターフェースにより構成される。たとえば、ICカード2が接触型のICカードである場合、カードリーダライタ15は、ICカード2のコンタクト部と物理的かつ電気的に接続するための接触部などにより構成される。
The card reader /
また、ICカード2が非接触型のICカードである場合、カードリーダライタ15は、ICカード2との無線通信を行うためのアンテナおよび通信制御部などにより構成される。カードリーダライタ15では、ICカード2に対する電源供給、クロック供給、リセット制御、データの送受信が行われるようになっている。このような機能によってカードリーダライタ15は、制御部10のCPU11による制御に基づいてICカード2の活性化(起動)、種々のコマンドの送信、及び送信したコマンドに対する応答(レスポンス)の受信などを行なう。
When the
操作部17は、ICカード処理装置1の操作者によって、種々の操作指示が入力される。操作部17は、操作者に入力された操作指示のデータをCPU11へ送信する。操作部17は、たとえば、キーボード、テンキー、及び、タッチパネルなどである。
Various operation instructions are input to the operation unit 17 by the operator of the IC
ディスプレイ18は、CPU11の制御により種々の情報を表示する表示装置である。ディスプレイ18は、たとえば、液晶表示装置である。
次に、ICカード2について説明する。
ICカード2は、ICカード処理装置1などの上位機器から電力などの供給を受けて活性化される(動作可能な状態になる)ようになっている。例えば、ICカード2が接触型の通信によりICカード処理装置1と接続される場合、つまり、ICカード2が接触型のICカードで構成される場合、ICカード2は、通信インターフェースとしてのコンタクト部を介してICカード処理装置1からの動作電源及び動作クロックの供給を受けて活性化される。
The
Next, the
The
また、ICカード2が非接触型の通信方式によりICカード処理装置1と接続される場合、つまり、ICカード2が非接触式のICカードで構成される場合、ICカード2は、通信インターフェースとしてのアンテナ及び変復調回路などを介してICカード処理装置1からの電波を受信し、その電波から図示しない電源部により動作電源及び動作クロックを生成して活性化するようになっている。
Further, when the
次に、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
FIG. 2 is a block diagram schematically showing a configuration example of the
The
図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
CPU21は、ICカード2全体の制御を司る制御部として機能する。CPU21は、ROM22あるいは不揮発性メモリ24に記憶されている制御プログラム及び制御データに基づいて種々の処理を行う。たとえば、CPU21は、ROM22に記憶されているプログラムを実行することにより、ICカード2の動作制御あるいはICカード2の運用形態に応じた種々の処理を行う。なお、各種の機能のうちの一部は、ハードウエア回路により実現されるものであっても良い。この場合、CPU21は、ハードウエア回路により実行される機能を制御する。
The
ROM22は、予め制御用のプログラム及び制御データなどを記憶する不揮発性のメモリである。ROM22は、製造段階で制御プログラム及び制御データなどを記憶した状態でICカード2に組み込まれる。即ち、ROM22に記憶される制御プログラム及び制御データは、予めICカード2の仕様に応じて組み込まれる。
The
RAM23は、揮発性のメモリである。RAM23は、CPU21の処理中のデータなどを一時的に格納する。たとえば、RAM23は、計算用バッファ、受信用バッファ、送信用バッファなどとして機能する。計算用バッファとしては、CPU21が実行する種々の演算処理の結果などを一時的に保持する。受信用バッファとしては、通信部25を介してICカード処理装置1から受信するコマンドを保持する。送信用バッファとしては、通信部25を介してICカード処理装置1へ送信するデータを保持する。
The
不揮発性メモリ24は、例えば、EEPROMあるいはフラッシュROMなどのデータの書き込み及び書換えが可能な不揮発性のメモリにより構成される。不揮発性メモリ24は、ICカード2の運用用途に応じて制御プログラム、アプリケーション、及び種々のデータを格納する。例えば、不揮発性メモリ24では、プログラムファイル及びデータファイルなどが作成される。作成された各ファイルは、制御プログラム及び種々のデータなどが書き込まれる。
The
UART25は、ICカード処理装置1のカードリーダライタ15との通信を行うためのインターフェースである。ICカード2が接触型のICカードとして実現される場合、UART25は、ICカード処理装置1のカードリーダライタ15と物理的かつ電気的に接触して信号の送受信を行うための通信制御部とコンタクト部とにより構成される。また、ICカード2が非接触型のICカードとして実現される場合、UART25は、ICカード処理装置1のカードリーダライタ15との無線通信を行うための変復調回路などの通信制御部とアンテナとにより構成される。
コプロセッサ26は、暗号化及び複合化を行うものである。
The
The
次に、不揮発性メモリ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
FIG. 3 is a diagram showing an example of a management structure of files stored in the
In the example shown in FIG. 3, the
図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
また、図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
次に、ICカード2の不揮発性メモリ24におけるデータ領域の構成について説明する。
図4は、ICカード2内の不揮発性メモリ24における記憶領域の構成例を示す図である。
図4に示す構成例において、不揮発性メモリ24は、システム領域51及びアプリケーション領域52などを有するデータメモリとして機能する。
Next, the configuration of the data area in the
FIG. 4 is a diagram illustrating a configuration example of a storage area in the
In the configuration example shown in FIG. 4, the
システム領域51は、ICカード2の基本的な動作を実行するためのデータが格納されている。システム領域51に格納されるデータは、ICカード2の仕様に応じて設定される情報であり、たとえば、フェーズ情報、ATR情報、及び、ファイル管理テーブルなどを含む情報である。フェーズ情報は、ICカード2の製造、発行、運用、運用終了などのICカード2のフェーズを示す。ATR情報は、ICカード2が活性化した後、外部装置に出力する初期応答を示す。ファイル管理テーブルは、ファイルの識別情報、先頭アドレスなどを示す情報を格納する。
The
システム領域51には、アプリケーションに対応するDFを管理する登録アプリケーションテーブル51aが設けられる。登録アプリケーションテーブル51aは、当該ICカード2に登録されているアプリケーションに対応するDFの識別情報(DF名(DF name))とDFの識別情報が示すDFのメモリ上の位置を示す情報(ポインタ)とを有する。
In the
また、システム領域51は、各アプリケーションがデータを一時的に記憶するために使用するRAM23上の一時記憶領域としてのトランジェントエリア(Transient Area)23a(図7参照)を定義する定義情報を記憶するTransient Area23aの定義情報記憶領域51bを有する。定義情報記憶領域51bには、RAM23におけるTransient Area23aの開始アドレスとTransient Area23aの終了アドレスとを記憶する。
The
アプリケーション領域52は、各アプリケーションが使用するファイルの定義情報領域およびデータ格納領域などを有する。不揮発性メモリ24に記憶する各ファイルは、定義情報領域に記憶されるファイル定義情報と定義情報領域のファイル定義情報で定義されるデータ格納領域のデータエリアに記憶されるデータ(ファイルデータ)とにより構成される。たとえば、ICカード2では、図3に示すように、アプリケーションのフォルダに相当するDF、および、データファイルに相当するEFを階層構造で管理する。この場合、DFは、アプリケーション領域52の定義情報領域に記憶されるDF定義情報で定義される。EFは、アプリケーション領域52の定義情報領域に記憶されるEF定義情報とそのEF定義情報で定義されるアプリケーション領域52のデータ格納領域におけるデータエリアとにより構成される。
The
次に、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
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
次に、不揮発性メモリ24のシステム領域51に設けられる登録アプリケーションテーブルについて説明する。
図6は、不揮発性メモリ24のシステム領域51に設けられる登録アプリケーションテーブル51aの構成例を示す図である。
図6に示す例において、登録アプリケーションテーブル51aは、当該ICカード2に登録されているアプリケーションのDF名(DF name)と、各アプリケーションのDFの位置を示すポインタとを記憶する。
Next, a registered application table provided in the
FIG. 6 is a diagram showing a configuration example of a registered application table 51 a provided in the
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カード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
次に、RAM23におけるメモリ領域について説明する。
図7は、RAM23におけるメモリ領域の構成を概略的に示す図である。
図7に示すように、揮発性メモリとしてのRAM23のメモリ領域の一部には、Transient Area23aが定義される。また、Transient Area23aにおいて使用されている領域を示す情報は、RAM23のメモリ領域におけるTransient Area23a以外に設けられた使用アドレス記憶領域23bに書き込まれる。
Next, the memory area in the
FIG. 7 is a diagram schematically showing the configuration of the memory area in the
As shown in FIG. 7, a Transient Area 23a is defined in a part of the memory area of the
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
たとえば、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
As described above, the start address of the transient area 23a and the end address of the transient area 23a are written in the
図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
次に、上記のような構成の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
FIG. 9 is a flowchart for explaining the flow of SELECT processing in the
The
受信したコマンドが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
受信したコマンドの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
また、受信したコマンドの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
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
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
また、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
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
次に、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
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
なお、上記の処理例では、機能を制限して当該アプリケーションが実行可能であるか否かを判断するものとしたが、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
上記のように、SELECTコマンドを受信した場合、ICカード2は、Transient Area23aの空き容量を算出する。ICカード2は、SELECTコマンドで指定されたアプリケーションが十分な記憶領域を確保できない場合、一部の機能が使用可能となる領域を確保できれば、不揮発性メモリ24に当該アプリケーションに対する機能制限を示す制限フラグをセットする。ICカード2は、SELECTコマンドで指定されたアプリケーションが後続のコマンドを受信した場合、制限フラグを読み込むことにより、機能を縮小して動作させる。
As described above, when the SELECT command is received, the
上記のような実施形態によれば、ICカード2では、RAMのTransient Area23a内に十分な記憶領域を確保できないアプリケーションであっても、機能を縮小して動作させることが可能となる。この結果として、アプリケーションの選択処理以降の処理がメモリ容量不足で完全に実行することができなくなることを軽減できる。
According to the embodiment as described above, the
本発明のいくつかの実施形態を説明したが、これらの実施形態は、例として提示したものであり、発明の範囲を限定することは意図していない。これら新規な実施形態は、その他の様々な形態で実施されることが可能であり、発明の要旨を逸脱しない範囲で、種々の省略、置き換え、変更を行うことができる。これら実施形態やその変形は、発明の範囲や要旨に含まれるとともに、特許請求の範囲に記載された発明とその均等の範囲に含まれる。 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乃至4の何れか1項に記載のICカード。 The first storage means is a volatile memory;
The IC card according to any one of claims 1 to 4.
前記請求項1乃至5の何れか1項に記載のICカード。 The second storage means is a nonvolatile memory;
The IC card according to any one of claims 1 to 5.
前記モジュールを具備する本体と、
を有する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.
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)
| 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 |
-
2013
- 2013-03-21 JP JP2013059010A patent/JP6071677B2/en not_active Expired - Fee Related
Patent Citations (3)
| 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 |