JP5832940B2 - IC card and portable electronic device - Google Patents
IC card and portable electronic device Download PDFInfo
- Publication number
- JP5832940B2 JP5832940B2 JP2012061127A JP2012061127A JP5832940B2 JP 5832940 B2 JP5832940 B2 JP 5832940B2 JP 2012061127 A JP2012061127 A JP 2012061127A JP 2012061127 A JP2012061127 A JP 2012061127A JP 5832940 B2 JP5832940 B2 JP 5832940B2
- Authority
- JP
- Japan
- Prior art keywords
- command
- data
- card
- management table
- data area
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Description
本発明の実施形態は、ICカード、及び携帯可能電子装置に関する。 Embodiments described herein relate generally to an IC card and a portable electronic device.
一般的に、携帯可能電子装置として用いられるICカードは、プラスチックなどで形成されたカード状の本体と本体に埋め込まれたICモジュールとを備えている。ICモジュールは、ICチップを有している。ICチップは、電源が無い状態でもデータを保持することができるEEPROM(Electrically Erasable Programmable Read−Only Memory)またはフラッシュROMなどの不揮発性メモリと、種々の演算を実行するCPUとを有している。 In general, an IC card used as a portable electronic device includes a card-like main body formed of plastic or the like and an IC module embedded in the main body. The IC module has an IC chip. The IC chip has a nonvolatile memory such as an EEPROM (Electrically Erasable Programmable Read-Only Memory) or a flash ROM that can hold data even in the absence of a power source, and a CPU that executes various operations.
ICカードは、ICカードを処理する処理装置からコマンドを受信した場合、受信したコマンドに応じてアプリケーションを実行する。これにより、ICカードは、種々の機能を実現することができる。 When receiving a command from a processing device that processes the IC card, the IC card executes an application in accordance with the received command. Thereby, the IC card can realize various functions.
ICカードは、リーダライタからの電源供給が途絶えた場合、シャットダウンされる。例えば、ICカードがコマンドの処理の途中でシャットダウンされた場合、ICカード内のデータメモリに不整合が生じる場合がある。 The IC card is shut down when the power supply from the reader / writer is interrupted. For example, if the IC card is shut down during command processing, inconsistency may occur in the data memory in the IC card.
例えば、ICカードは、バッファメモリに更新データを記憶し、一括更新を指示するコマンドを受信した場合に、バッファメモリの更新データをデータメモリに上書きすることにより、データメモリの不整合を防ぐ。 For example, the IC card stores update data in the buffer memory, and when a command for instructing batch update is received, the update data in the buffer memory is overwritten in the data memory to prevent inconsistency of the data memory.
上記のようなICカードは、上書き処理の途中で電源が遮断された場合、メモリの不整合が生じる可能性があるという課題がある。また、上記のようなICカードは、1つのデータ更新コマンドにつき書き込み処理を2度行う必要がある。この為、処理時間が長くなるという課題がある。 The IC card as described above has a problem that memory inconsistency may occur when the power is shut off during the overwriting process. Further, the IC card as described above needs to perform the writing process twice for one data update command. For this reason, there exists a subject that processing time becomes long.
そこで、より効率的に処理を実行するICカード、及び携帯可能電子装置を提供することを目的とする。 Therefore, it is an object to provide an IC card and a portable electronic device that execute processing more efficiently.
一実施形態に係るICカードは、外部機器から送信されたコマンドを受信する受信手段と、前記受信部により受信された前記コマンドに基づいて処理を実行するコマンド処理手段と、前記コマンド処理手段による処理結果に応じてレスポンスを前記外部機器に送信する送信手段と、二面化された実データを記憶するデータ領域を有する複数のファイルを備える第1の記憶手段と、前記データ領域の有効面を前記ファイル毎に示す二面化された管理テーブルを備える第2の記憶手段と、前記管理テーブルの有効面を示すフラグを記憶する第3の記憶手段と、を具備する。 An IC card according to an embodiment includes a receiving unit that receives a command transmitted from an external device, a command processing unit that executes a process based on the command received by the receiving unit, and a process performed by the command processing unit. A transmission means for transmitting a response to the external device according to the result, a first storage means comprising a plurality of files having a data area for storing the two-sided actual data, and an effective surface of the data area A second storage unit having a two-sided management table for each file; and a third storage unit for storing a flag indicating an effective surface of the management table.
以下、図面を参照しながら、一実施形態に係るICカード、及び携帯可能電子装置について詳細に説明する。 Hereinafter, an IC card and a portable electronic device according to an embodiment will be described in detail with reference to the drawings.
本実施形態に係る携帯可能電子装置(ICカード)20及びICカード20を処理する処理装置(端末装置)10は、例えば、接触通信、及び/または非接触通信の機能を備える。これにより、ICカード20及び端末装置10は、互いにデータの送受信を行うことができる。
The portable electronic device (IC card) 20 and the processing device (terminal device) 10 that processes the
図1は、一実施形態に係るICカード処理システム1の構成例を示す。
ICカード処理システム1は、ICカード20を処理する端末装置10と、ICカード20と、を備える。
FIG. 1 shows a configuration example of an IC card processing system 1 according to an embodiment.
The IC card processing system 1 includes a
端末装置10は、CPU11、ROM12、RAM13、不揮発性メモリ14、カードリーダライタ15、操作部17、ディスプレイ18、及び電源部19を備える。CPU11、ROM12、RAM13、不揮発性メモリ14、カードリーダライタ15、操作部17、及びディスプレイ18は、それぞれバスを介して互いに接続されている。
The
CPU11は、端末装置10全体の制御を司る制御部として機能する。CPU11は、ROM12又は不揮発性メモリ14に記憶されている制御プログラム及び制御データに基づいて種々の処理を行う。例えば、CPU11は、カードリーダライタ15を介してICカード20とコマンド及びレスポンスの送受信を行う。
The
ROM12は、予め制御用のプログラム及び制御データなどを記憶する不揮発性のメモリである。RAM13は、ワーキングメモリとして機能する揮発性のメモリである。RAM13は、CPU11の処理中のデータなどを一時的に格納する。例えば、RAM13は、カードリーダライタ15を介して外部の機器と送受信するデータを一時的に格納する。また、RAM13は、CPU11が実行するプログラムを一時的に格納する。
The
不揮発性メモリ14は、例えばEEPROM、FRAM(登録商標)などを備える。不揮発性メモリ14は、例えば、制御用のプログラム、制御データ、アプリケーション、及びアプリケーションに用いられるデータなどを記憶する。
The
カードリーダライタ15は、ICカード20と通信を行うためのインターフェース装置である。カードリーダライタ15は、接触通信、または非接触通信によりICカード20とデータの送受信を行う。
The card reader /
接触通信のインターフェースとして用いられる場合、カードリーダライタ15は、ICカード20が装着されるスロットと、ICカード20が備えるコンタクトパターンと接続される複数の接触端子を備える。
When used as an interface for contact communication, the card reader /
スロットにICカード20が装着される場合、カードリーダライタ15の複数の接触端子は、ICカード20のコンタクトパターンに接続される。これにより、端末装置10とICカード20とは電気的に接続される。カードリーダライタ15は、スロットに装着されるICカード20に対して、電力の供給、クロックの供給、リセット信号の入力、及びデータの送受信などを行う。
When the
また、非接触通信のインターフェースとして用いられる場合、カードリーダライタ15は、送受信するデータに対して信号処理を施す信号処理部と、所定の共振周波数を有するアンテナとを備える。
When used as an interface for non-contact communication, the card reader /
カードリーダライタ15は、例えば、信号処理部により、送受信するデータに対して符号化、復号、変調、及び復調などの信号処理を行なう。また、カードリーダライタ15は、符号化及び変調を施したデータをアンテナに供給する。アンテナは、供給されたデータに応じて磁界を発生させる。これにより、端末装置10は、通信可能範囲に存在するICカード20に対してデータを非接触で送信することができる。
For example, the card reader /
さらに、カードリーダライタ15のアンテナは、磁界を検知し、検知した磁界に応じて信号を生成する。これにより、カードリーダライタ15は、信号を非接触で受信することができる。信号処理部は、アンテナにより受信された信号に対して復調及び復号を行う。これにより、端末装置10は、ICカード20から送信された元のデータを取得することができる。
Further, the antenna of the card reader /
操作部17は、例えば操作キーなどを備え、操作者により入力される操作に基づいて、操作信号を生成する。操作部17は、生成した操作信号をCPUに入力する。これにより、CPU11は、操作者により入力された操作に基づいて処理を実行することができる。 The operation unit 17 includes, for example, operation keys and generates an operation signal based on an operation input by the operator. The operation unit 17 inputs the generated operation signal to the CPU. Thereby, CPU11 can perform a process based on operation inputted by an operator.
ディスプレイ18は、CPU11、または図示されないグラフィックコントローラなどの表示処理モジュールから入力される映像を表示するための信号に基づいて種々の情報を表示する。
The
電源部19は、端末装置10の各部に電力を供給する。電源部19は、例えば、商用電源より電力を受け取り、所定の電圧に変換し、端末装置10の各部に供給する。
The power supply unit 19 supplies power to each unit of the
図2は、一実施形態に係るICカード20の構成例を示す。
図2に示すように、ICカード20は、例えば、矩形状の本体21と、本体21内に内蔵されたICモジュール22とを備える。ICモジュール22は、ICチップ23と、通信部24とを備える。ICチップ23と通信部24とは、互いに接続された状態でICモジュール22内に形成されている。
FIG. 2 shows a configuration example of the
As shown in FIG. 2, the
なお、本体21は、少なくとも通信部24が配設されるICモジュール22を設置可能な形状であれば、矩形状に限らず如何なる形状であっても良い。
The
ICチップ23は、通信部24、CPU25、ROM26、RAM27、不揮発性メモリ28、電源部31、及びロジック部32などを備える。通信部24、CPU25、ROM26、RAM27、不揮発性メモリ28、電源部31、及びロジック部32は、バスを介して互いに接続されている。
The
通信部24は、端末装置(外部機器)10のカードリーダライタ15と通信を行うためのインターフェースである。通信部24は、接触通信、または非接触通信により、端末装置10とデータの送受信を行う。
The
接触通信のインターフェースとして用いられる場合、通信部24は、カードリーダライタ15の接触端子と接続されるコンタクトパターンを備える。コンタクトパターンは、導電性を有する金属などによりICモジュール22の表面に形成される接触端子である。即ち、コンタクトパターンは、端末装置10と接触可能に形成されている。
When used as an interface for contact communication, the
コンタクトパターンは、金属により形成される面が複数のエリアに区切られて形成される。区切られた各エリアは、それぞれ端子として機能する。通信部24は、コンタクトパターンを介してカードリーダライタ15とデータの送受信を行うことができる。
The contact pattern is formed by dividing a surface formed of metal into a plurality of areas. Each divided area functions as a terminal. The
また、非接触通信のインターフェースとして用いられる場合、通信部24は、信号処理部とアンテナとを備える。
When used as an interface for non-contact communication, the
信号処理部は、端末装置10に送信するデータに対して符号化、負荷変調などの信号処理を行う。例えば、信号処理部は、端末装置10に送信するデータの変調(増幅)を行う。信号処理部は、信号処理を施したデータをアンテナに供給する。
The signal processing unit performs signal processing such as encoding and load modulation on data to be transmitted to the
アンテナは、例えば、ICモジュール22内に所定の形状で配設される金属線により構成される。ICカード20は、端末装置10に送信するデータに応じてアンテナにより磁界を発生させる。これにより、ICカード20は、端末装置10に対してデータを送信することができる。また、ICカード20は、電磁誘導によりアンテナに発生する誘導電流に基づいて端末装置10から送信されるデータを認識する。
The antenna is constituted by, for example, a metal wire disposed in a predetermined shape in the
例えば、信号処理部は、アンテナに発生する誘導電流に対して復調、及び復号を行う。例えば、信号処理部は、アンテナにより受信する信号の解析を行う。これにより、通信部24は、2値の論理データを取得する。通信部24は、解析したデータをバスを介してCPU25に送信する。
For example, the signal processing unit demodulates and decodes the induced current generated in the antenna. For example, the signal processing unit analyzes a signal received by the antenna. As a result, the
CPU25は、ICカード20全体の制御を司る制御部として機能する。CPU25は、ROM26あるいは不揮発性メモリ28に記憶されている制御プログラム及び制御データに基づいて種々の処理を行う。例えば、端末装置10から受信したコマンドに応じて種々の処理を行い、処理結果としてのレスポンスなどのデータの生成を行なう。
The
ROM26は、予め制御用のプログラム及び制御データなどを記憶する不揮発性のメモリである。ROM26は、製造段階で制御プログラム及び制御データなどを記憶した状態でICカード20内に組み込まれる。即ち、ROM26に記憶される制御プログラム及び制御データは、予めICカード20の仕様に応じて組み込まれる。
The
RAM27は、ワーキングメモリとして機能する揮発性のメモリである。RAM27は、CPU25の処理中のデータなどを一時的に格納する。例えば、RAM27は、通信部24を介して端末装置10から受信したデータを一時的に格納する。またRAM27は、通信部24を介して端末装置10に送信するデータを一時的に格納する。またさらに、RAM27は、CPU25が実行するプログラムを一時的に格納する。
The
不揮発性メモリ28は、例えば、EEPROMあるいはフラッシュROMなどのデータの書き込み及び書換えが可能な不揮発性のメモリを備える。不揮発性メモリ28は、ICカード20の運用用途に応じて制御プログラム及び種々のデータを格納する。
The
たとえば、不揮発性メモリ28では、プログラムファイル及びデータファイルなどが創成される。創成された各ファイルには、制御プログラム及び種々のデータなどが書き込まれる。CPU25は、不揮発性メモリ28、または、ROM26に記憶されているプログラムを実行することにより、種々の処理を実現することができる。
For example, in the
電源部31は、端末装置10の各部に電力を供給する。ICカード20が接触通信を行う構成を備える場合、電源部31は、通信部24のコンタクトパターンを介してカードリーダライタ15から供給される電力をICカード20の各部に供給する。
The
また、ICカード20が非接触通信を行う構成を備える場合、カードリーダライタ15のアンテナから送信される電波、特にキャリア波に基づいて電力を生成する。さらに、電源部31は、動作クロックを生成する。電源部31は、発生させた電力及び動作クロックをICカード20の各部に電力を供給する。ICカード20の各部は、電力の供給を受けた場合、動作可能な状態になる。
In addition, when the
ロジック部32は、演算処理をハードウエアにより行う演算部である。例えば、ロジック部32は、端末装置10からのコマンドに基づいて、暗号化、復号、ハッシュ計算、及び乱数の生成などの処理を行う。例えば、端末装置10から相互認証コマンドを受信する場合、ロジック部32は、相互認証処理に係る演算処理を実行する。
The
ICカード20は、一次発行と二次発行とにより発行される。ICカード20を発行する発行装置は、一次発行において、ICカード20にコマンド(初期化コマンド)を送信することにより、ICカード20の不揮発性メモリ28の初期化を行う。これにより、端末装置10は、ICカード20の不揮発性メモリ28内にICカード20の使用目的、及び使用用途などに応じた鍵ファイルやデータファイル等を定義する。
The
発行装置は、例えば、ISO/IEC7816により規定されているファイル構造を不揮発性メモリ28内に創成する。上記の初期化が行われた不揮発性メモリ28は、Master File(MF)、Dedicated File(DF)、及びElementary File(EF)などを有する。
For example, the issuing device creates a file structure defined in ISO / IEC7816 in the
MFは、ファイル構造の根幹となるファイルである。DFは、MFの下位に創成される。DFは、アプリケーション及びアプリケーションに用いられるデータなどをグループ化して格納するファイルである。EFは、DFの下位に創成される。EFは、様々なデータを格納するためのファイルである。また、MFの直下にEFが置かれる場合もある。 The MF is a file that is the basis of the file structure. The DF is created below the MF. The DF is a file that stores applications and data used for the applications in groups. EF is created below DF. The EF is a file for storing various data. In some cases, an EF is placed directly under the MF.
EFには、Working Elementary File(WEF)とInternal Elementary File(IEF)などの種類がある。WEFは、作業用EFであり、個人情報などを格納する。IEFは、内部EFであり、例えば、セキュリティのための暗号鍵などのデータを記憶する。 There are various types of EFs, such as a Working Elementary File (WEF) and an Internal Elementary File (IEF). The WEF is a working EF and stores personal information and the like. The IEF is an internal EF and stores data such as an encryption key for security.
二次発行では、EFに例えば顧客データなどの個別データが格納される。これにより、ICカード20が運用可能な状態になる。即ち、CPU25は、不揮発性メモリ28、または、ROM26に記憶されているプログラムを実行することにより、種々の処理を実現することができる。
In the secondary issue, individual data such as customer data is stored in the EF. Thereby, the
例えば、図3に示されるように、不揮発性メモリ28は、MF及び複数のEFを記憶する記憶領域28aを有する。図3は、記憶領域28aが有するファイルの構成(ファイルツリー)の例を示す。なお、記憶領域28aは、MFと、MFの下位にEF1、EF2、及びEF3を有する構成であるとして説明する。
For example, as illustrated in FIG. 3, the
図4は、記憶領域28aの具体的な例を示す。
図4に示されたように、記憶領域28aは、システム共通情報、MFファイル管理情報、EF1のファイル管理情報、EF2のファイル管理情報、及びEF3のファイル管理情報を有する。また、記憶領域28aは、EF1、EF2、及びEF3の実データを記憶するためのデータ領域を備える。なお、各EFのデータ領域は、それぞれ二面化されている。即ち、各EFは、第1のデータ領域と第2のデータ領域とを備える。なお、EFの第1のデータ領域と第2のデータ領域とでアクティブな方をアクティブ面と称する。
FIG. 4 shows a specific example of the
As shown in FIG. 4, the
さらに、システム共通情報は、テーブル切り替えフラグ、管理テーブル1(第1の管理テーブル)、及び管理テーブル2(第2の管理テーブル)を備える。テーブル切り替えフラグは、管理テーブル1と管理テーブル2とでどちらが有効(アクティブ)な状態であるかを示す。また、管理テーブル1及び管理テーブル2は、各EF毎に第1のデータ領域と第2のデータ領域とでどちらが有効(アクティブ面)であるかを示す。 Further, the system common information includes a table switching flag, a management table 1 (first management table), and a management table 2 (second management table). The table switching flag indicates which of the management table 1 and the management table 2 is valid (active). The management table 1 and the management table 2 indicate which is valid (active surface) in the first data area and the second data area for each EF.
また、ICカード20のRAM27は、更新開始フラグを記憶する為の記憶領域を備える。更新開始フラグは、更新処理を実行中であるか否かを示すフラグである。
The
図5は、EF1のファイル管理情報、EF2のファイル管理情報、及びEF3のファイル管理情報の例を示す。
各EFの管理情報は、それぞれファイルID、ファイル種別、ファイルサイズ、第1のデータ領域のアドレス、及び第2のデータ領域のアドレスを有する。ファイルIDは、EF毎に付与される識別番号である。ファイル種別は、EFの種類を示す。ファイルサイズは、EFのデータ領域のサイズを示す。なお、この場合、ファイルサイズは、EFの第1のデータ領域、または第2のデータ領域のサイズを示す。第1のデータ領域のアドレスは、EFの第1のデータ領域の位置を示す。第2のデータ領域のアドレスは、EFの第2のデータ領域の位置を示す。
FIG. 5 shows an example of EF1 file management information, EF2 file management information, and EF3 file management information.
The management information of each EF has a file ID, file type, file size, first data area address, and second data area address. The file ID is an identification number assigned to each EF. The file type indicates the type of EF. The file size indicates the size of the data area of the EF. In this case, the file size indicates the size of the first data area or the second data area of the EF. The address of the first data area indicates the position of the first data area of the EF. The address of the second data area indicates the position of the second data area of the EF.
ICカード20のCPU25は、EFからデータの読み出しを行う場合、テーブル切り替えフラグが示すアクティブであることが示された管理テーブルを参照する。これにより、CPU25は、参照した管理テーブルの読み出し対象のEFの第1のデータ領域と第2のデータ領域とでどちらがアクティブ面であるかを認識する。CPU25は、EFの管理情報を参照し、アクティブ面のデータ領域のアドレスを読み出す。CPU25は、読み出したアドレスにアクセスすることにより、アクティブ面のデータを読み出すことができる。
When reading data from the EF, the
図6は、記憶領域28aに格納されているデータの遷移の具体的な例を示す。また、図7は、ICカード20の処理の例を示す。なお、ここでは、ICカード20がデータ更新コマンド1(第1のデータ更新コマンド)、データ更新コマンド2(第2のデータ更新コマンド)、一括更新コマンドの順でコマンドを受信する例を示す。なお、データ更新コマンドは、例えば、書き込みコマンド、上書きコマンド、追記コマンド、削除コマンドなどの、EFのデータ領域のデータが変更されるようなコマンドを示す。
FIG. 6 shows a specific example of the transition of data stored in the
図6に示されるように、処理開始前の記憶領域28aは、「更新開始フラグ=OFF」、「データ切り替えフラグ=管理テーブル1」となっている。また、管理テーブル1は、「EF1=データ領域1」、「EF2=データ領域2」、「EF3=データ領域3」となっている。また、管理テーブル2は、「EF1=データ領域1」、「EF2=データ領域1」、「EF3=データ領域2」となっている。
As shown in FIG. 6, the
また、EF1は、「データ領域1=0000 0000」、「データ領域2=FFFF FFFF」となっている。また、EF2は、「データ領域1=FF FFFF FFFF」、「データ領域2=FF FFFF FFFF」となっている。また、EF3は、「データ領域1=00 0000」、「データ領域2=FF FFFF」となっている。 EF1 is “data area 1 = 0000 0000” and “data area 2 = FFFF FFFF”. EF2 is “data area 1 = FF FFFF FFFF” and “data area 2 = FF FFFF FFFF”. EF3 is “data area 1 = 00 0000” and “data area 2 = FF FFFF”.
このようなデータを記憶領域28aが有する場合、アクティブな管理テーブルは、管理テーブル1である。また、EF1のアクティブ面は、「データ領域1=0000 0000」である。また、EF2のアクティブ面は、「データ領域2=FF FFFF FFFF」である。また、EF3のアクティブ面は、「データ領域1=00 0000」である。
When the
この状態で上記したようなデータ更新コマンドを受信した場合の処理を図7を用いて説明する。 Processing when the data update command as described above is received in this state will be described with reference to FIG.
ICカード20は、端末装置10から電源が供給された場合、活性化されてアイドル状態になる。まず、ICカード20のCPU25は、RAM27を初期化する(ステップS11)。即ち、この時点でRAM27内の更新開始フラグは、初期状態(OFF)になる。
When power is supplied from the
さらに、ICカード20は、ATR(Answer to Reset)を端末装置10に送信する(ステップS12)。さらに、ICカード20は、コマンドの受信を待つ状態になる(ステップS13)。
Furthermore, the
ICカード20は、コマンドを受信した場合、受信したコマンドが一括更新コマンドであるか否かを判断する(ステップS14)。即ち、CPU25は、受信したコマンドを解析し、受信したコマンドのコマンド種別(INS)が一括更新コマンドを示すか否か判断する。
When receiving the command, the
受信したコマンドが一括更新コマンドではない場合、CPU25は、受信したコマンドがデータ更新コマンドであるか否か判断する(ステップS15)。即ち、CPU25は、受信したコマンドのコマンド種別(INS)がデータ更新コマンドを示すか否か判断する。
If the received command is not a batch update command, the
受信したコマンドがデータ更新コマンドである場合、CPU25は、RAM27上の更新開始フラグがOFFであるか否か判断する(ステップS16)。更新開始フラグがOFFである場合、CPU25は、RAM27上の更新開始フラグをONに切り替える(ステップS17)。また、更新開始フラグがONである場合、CPU25は、ステップS19の処理に移行する。
If the received command is a data update command, the
さらに、CPU25は、管理テーブルをコピーする(ステップS18)。なお、CPU25は、アクティブな管理テーブルを無効側(パッシブ)の管理テーブルにコピーする。図6に示す例では、管理テーブル1がアクティブである。この場合、CPU25は、管理テーブル1を管理テーブル2にコピーする。これにより、CPU25は、管理テーブル2のEF1のアクティブ面をデータ領域1、EF2のアクティブ面をデータ領域2、EF3のアクティブ面をデータ領域1にそれぞれ書き換える。
Further, the
さらに、CPU25は、受信したデータ更新コマンドに応じたコマンド処理を実行する(ステップS19)。この場合、CPU25は、コマンドにより指定されたEFの非アクティブ面(パッシブ面)に対して、データ更新処理を実行する。
Further, the
なお、ICカード20が受信したデータ更新コマンド1は、EF1を「1111 1111」に書き換えるコマンドであるとして説明する。アクティブなデータ管理テーブルは、管理テーブル1である。また、EF1のアクティブ面は、データ領域1である。即ち、EF1のパッシブ面は、データ領域2である。この場合、CPU25は、EF1のパッシブ面であるデータ領域2を「1111 1111」に書き換える。
The data update command 1 received by the
CPU25は、コマンド処理が正常終了したか否か判断する(ステップS20)。正常終了した場合、CPU25は、パッシブ側の管理テーブルを更新する(ステップS21)。即ち、CPU25は、データ更新処理を行ったデータ領域をパッシブ面からアクティブ面に切り替える。即ち、CPU25は、パッシブの管理テーブルのデータ更新処理を行ったEFのパッシブ面をアクティブ面に切り替える。図6の例によると、CPU25は、管理テーブル2のEF1のアクティブ面をデータ領域1からデータ領域2に切り替える。
The
また、CPU25は、ステップS20でコマンド処理が正常終了しなかったと判断した場合,ステップS20からステップS22に移行する。
On the other hand, if the
CPU25は、コマンド処理の結果に応じてステータスワード(SW)を生成し、SWを含むレスポンスを生成し、端末装置10に送信し(ステップS22)、処理を終了する。この場合、ICカード20は、再びコマンドの受信を待つアイドル状態に移行する。
CPU25 produces | generates a status word (SW) according to the result of command processing, produces | generates the response containing SW, transmits to the terminal device 10 (step S22), and complete | finishes a process. In this case, the
またここで、EF2を「22 2222 2222」に書き換えるデータ更新コマンド2を受信した場合、CPU25は、上記のステップS17乃至22と同様の処理を行う。即ち、CPU25は、アクティブなデータ管理テーブルである管理テーブル1が示す
EF2のパッシブ面にデータを書き込む。これにより、CPU25は、EF2のデータ領域1を「22 2222 2222」に書き換える。さらに、CPU25は、管理テーブル2のEF2のアクティブ面をデータ領域2からデータ領域1に書き換える。
Here, when the data update command 2 for rewriting EF2 to “22 2222 2222” is received, the
また、ステップS14で、一括更新コマンドを受信したと判断した場合、CPU25は、RAM27上の更新開始フラグがONであるか否か判断する(ステップS23)。RAM27上の更新開始フラグがOFFである場合、CPU25は、ステップS22に移行し、処理を終了する。また、更新開始フラグがONである場合、更新開始フラグは、これまでにデータ更新処理が実行されたことを示す。CPU25は、データ更新処理の結果を全て反映させる処理を行う。
If it is determined in step S14 that the batch update command has been received, the
更新開始フラグがONである場合、CPU25は、テーブル切り替えフラグを更新する(ステップS24)。これにより、CPU25は、パッシブな管理テーブル情報をアクティブにする。即ち、CPU25は、管理テーブル2がアクティブになるようにテーブル切り替えフラグを切り替える。
When the update start flag is ON, the
さらに、CPU25は、RAM27上の更新開始フラグをOFFに切り替える(ステップS25)。CPU25は、処理結果に応じてレスポンスを端末装置10に送信し、処理を終了する。
Further, the
また、ステップS15で、受信したコマンドがデータ更新コマンドではないと判断した場合、CPU25は、受信したコマンドに応じた処理を実行し(ステップS26)、ステップS22に移行する。
If it is determined in step S15 that the received command is not a data update command, the
上記したような処理により、記憶領域28aは、図6の一番右側の列に示されるような状態になる。この場合、アクティブな管理テーブルは管理テーブル2である。また、管理テーブル2は、EF1のアクティブ面がデータ領域2、EF2のアクティブ面がデータ領域1、EF3のアクティブ面がデータ領域1であることを示す。
By the processing as described above, the
上記したように、ICカード20の不揮発性メモリは、二面化されたファイルと、二面化されたファイルのうちのアクティブな面を示す2つの管理テーブルと、2つの管理テーブルのうちのアクティブな管理テーブルを示すフラグ情報とを有する。ICカード20は、データ更新コマンドを受信した場合、二面化されたファイルの非アクティブ面にデータを書き込み、非アクティブな管理テーブルを更新する。さらに、ICカード20は、一括更新コマンドを受信した場合、アクティブな管理テーブルを切り替える。
As described above, the non-volatile memory of the
このような構成によると、例えば、データ更新コマンド1及び2を実行し、一括更新コマンドを受信する前に電源が遮断された場合、アクティブな管理テーブルは、処理前と同じ状態になる。即ち、ICカード20の不揮発性メモリ28の記憶領域28aのアクティブな情報は、処理前から書き換えられていないロールバック状態になる。この為、再起動時のメモリを修正する為の処理が不要である。
According to such a configuration, for example, when the data update commands 1 and 2 are executed and the power is turned off before receiving the batch update command, the active management table is in the same state as before the processing. That is, the active information in the
これにより、例えば、大量のEF間のデータの整合性の保証が必要な場合であっても、コミットバッファのサイズの制約などによらず、不揮発性メモリ28内のファイルの整合性を保証することができる。
Thereby, for example, even when it is necessary to guarantee the consistency of data between a large number of EFs, the consistency of the file in the
これにより、ICカード20は、一括更新前に書き換え前と書き換え後の両方のデータを保持することができる。この為、ICカード20は、不揮発性メモリ28に不整合が生じることを防ぐことができる。
Thereby, the
また、上記のような構成によると、ICカード20は、フラグ情報を切り替えることにより、一括更新処理を完了させることができる。これにより、一括更新処理中に電源遮断などが生じる可能性を抑えることができる。
Further, according to the above configuration, the
また、ICカード20は、データ更新コマンドに応じて書き込んだデータを処理後の不揮発性メモリ28のアクティブ面としてそのまま用いることができる。この為、書き込みデータの2度書きなどの必要が無い。この結果、処理時間を短縮することができる
この結果、より効率的に処理を実行するICカード、及び携帯可能電子装置を提供することができる。
Further, the
また、上記した実施形態において、データ更新コマンドがUPDATE BINARYコマンドなどのバイナリコマンドであるとする。ここで、データ更新処理の開始時にEFのデータ領域1とデータ領域2とでデータが一致しない場合、処理後のデータに不整合が生じる可能性がある。そこで、ICカード20は、図7のステップS15で、受信したコマンドがデータ更新コマンドであり、且つバイナリコマンドであると判断した場合、ステップS19でデータの更新を行う前に、アクティブ面のデータ領域のデータをパッシブ面のデータ領域にコピーする構成であってもよい。これにより、処理後にデータが不整合になることを防ぐことができる。
In the above-described embodiment, it is assumed that the data update command is a binary command such as an UPDATE BINARY command. Here, if data does not match between the data area 1 and the data area 2 of the EF at the start of the data update process, inconsistency may occur in the processed data. Therefore, when the
また、上記した実施形態では、ICカード20は、二面化されたEFのデータ領域を備える構成として説明したが、この構成に限定されない。ICカード20は、二面化されたDFのデータ領域、または、二面化されたMFのデータ領域を備える構成であってもよい。このような場合、ICカード20の不揮発性メモリ28の記憶領域28aは、DFまたはMFの実データを記憶する為のデータ領域1とデータ領域2とを備える。さらに、記憶領域28aは、このデータ領域1とデータ領域2とで有効面を示す管理テーブルを二面化された状態で備える。さらに、記憶領域28aは、管理テーブルの有効面を示すフラグをさらに具備する。
In the above-described embodiment, the
なお、上述の各実施の形態で説明した機能は、ハードウエアを用いて構成するに留まらず、ソフトウエアを用いて各機能を記載したプログラムをコンピュータに読み込ませて実現することもできる。また、各機能は、適宜ソフトウエア、ハードウエアのいずれかを選択して構成するものであっても良い。 It should be noted that the functions described in the above embodiments are not limited to being configured using hardware, but can be realized by causing a computer to read a program describing each function using software. Each function may be configured by appropriately selecting either software or hardware.
なお、本発明は上記実施形態そのままに限定されるものではなく、実施段階ではその要旨を逸脱しない範囲で構成要素を変形して具体化できる。また、上記実施形態に開示されている複数の構成要素の適宜な組み合せにより種々の発明を形成できる。例えば、実施形態に示される全構成要素から幾つかの構成要素を削除してもよい。更に、異なる実施形態に亘る構成要素を適宜組み合せてもよい。 Note that the present invention is not limited to the above-described embodiment as it is, and can be embodied by modifying the constituent elements without departing from the scope of the invention in the implementation stage. Further, various inventions can be formed by appropriately combining a plurality of constituent elements disclosed in the embodiment. For example, some components may be deleted from all the components shown in the embodiment. Furthermore, you may combine suitably the component covering different embodiment.
1…ICカード処理システム、10…端末装置、11…CPU、12…ROM、13…RAM、14…不揮発性メモリ、15…カードリーダライタ、17…操作部、18…ディスプレイ、19…電源部、20…ICカード、21…本体、22…ICモジュール、23…ICチップ、24…通信部、25…CPU、26…ROM、27…RAM、28…不揮発性メモリ、28a…記憶領域、31…電源部、32…ロジック部、
DESCRIPTION OF SYMBOLS 1 ... IC card processing system, 10 ... Terminal device, 11 ... CPU, 12 ... ROM, 13 ... RAM, 14 ... Non-volatile memory, 15 ... Card reader / writer, 17 ... Operation part, 18 ... Display, 19 ... Power supply part, DESCRIPTION OF
Claims (9)
前記受信手段により受信された前記コマンドに基づいて処理を実行するコマンド処理手段と、
前記コマンド処理手段による処理結果に応じてレスポンスを前記外部機器に送信する送信手段と、
二面化された実データを記憶するデータ領域を有する複数のファイルを備える第1の記憶手段と、
前記データ領域の有効面を前記ファイル毎に示す二面化された管理テーブルを備える第2の記憶手段と、
前記管理テーブルの有効面を示すフラグを記憶する第3の記憶手段と、
を具備するICカード。 Receiving means for receiving a command transmitted from an external device;
Command processing means for executing processing based on the command received by the receiving means ;
Transmission means for transmitting a response to the external device according to the processing result by the command processing means;
First storage means comprising a plurality of files having a data area for storing the two-sided real data;
A second storage means comprising a two-sided management table indicating the effective area of the data area for each file;
Third storage means for storing a flag indicating an effective surface of the management table;
IC card comprising:
前記コマンド処理手段は、前記更新開始フラグがOFFの状態で前記データ更新コマンドに応じたコマンド処理を開始した場合、前記更新開始フラグをONに切り替え、前記一括更新コマンドに応じたコマンド処理を完了した場合、前記更新開始フラグをOFFに切り替える、
請求項3に記載のICカード。 Comprising a fourth storage means for storing an update start flag;
When the command processing means starts command processing corresponding to the data update command with the update start flag being OFF, the command processing means switches the update start flag to ON and completes command processing corresponding to the batch update command. If the update start flag is switched off,
The IC card according to claim 3 .
前記ICモジュールが配設される本体と、
を具備する請求項1に記載のICカード。 An IC module comprising the receiving means, the command processing means, the transmitting means, the first storage means, the second storage means, and the third storage means ;
A main body on which the IC module is disposed;
The IC card according to claim 1, comprising:
前記受信手段により受信された前記コマンドに基づいて処理を実行するコマンド処理手段と、
前記コマンド処理手段による処理結果に応じてレスポンスを前記外部機器に送信する送信手段と、
二面化された実データを記憶するデータ領域を有する複数のファイルを備える第1の記憶手段と、
前記データ領域の有効面を前記ファイル毎に示す二面化された管理テーブルを備える第2の記憶手段と、
前記管理テーブルの有効面を示すフラグを記憶する第3の記憶手段と、
を具備する携帯可能電子装置。 Receiving means for receiving a command transmitted from an external device;
Command processing means for executing processing based on the command received by the receiving means ;
Transmission means for transmitting a response to the external device according to the processing result by the command processing means;
First storage means comprising a plurality of files having a data area for storing the two-sided real data;
A second storage means comprising a two-sided management table indicating the effective area of the data area for each file;
Third storage means for storing a flag indicating an effective surface of the management table;
A portable electronic device comprising:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012061127A JP5832940B2 (en) | 2012-03-16 | 2012-03-16 | IC card and portable electronic device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012061127A JP5832940B2 (en) | 2012-03-16 | 2012-03-16 | IC card and portable electronic device |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2013196197A JP2013196197A (en) | 2013-09-30 |
JP5832940B2 true JP5832940B2 (en) | 2015-12-16 |
Family
ID=49395108
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2012061127A Active JP5832940B2 (en) | 2012-03-16 | 2012-03-16 | IC card and portable electronic device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5832940B2 (en) |
-
2012
- 2012-03-16 JP JP2012061127A patent/JP5832940B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2013196197A (en) | 2013-09-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4896837B2 (en) | Portable electronic device and method for controlling portable electronic device | |
JP5795921B2 (en) | IC card, portable electronic device, and IC card control method | |
JP6279217B2 (en) | IC card, electronic device, and portable electronic device | |
JP5832940B2 (en) | IC card and portable electronic device | |
US20120234926A1 (en) | Portable electronic apparatus | |
JP2011022841A (en) | Processing system for portable electronic apparatus, portable electronic apparatus, and processing apparatus for portable electronic apparatus | |
JP5823109B2 (en) | Portable electronic device and method for controlling portable electronic device | |
JP5490044B2 (en) | Portable electronic device and method for controlling portable electronic device | |
JP5892818B2 (en) | Portable electronic device and control program for portable electronic device | |
JP5684051B2 (en) | Portable electronic device, IC card, and control method for portable electronic device | |
JP6092342B2 (en) | Non-contact portable electronic device and method for issuing non-contact portable electronic device | |
JP2014186385A (en) | Ic card and ic card control method | |
JP5957577B2 (en) | IC card, portable electronic device, and IC card control method | |
JP2006293706A (en) | Multi-application ic card with application updating function | |
JP5957347B2 (en) | IC card and portable electronic device | |
JP2013118473A (en) | Ic card, portable electronic device and control program of ic card | |
JP6160326B2 (en) | Information storage medium, information writing method, and writing program | |
JP2014032601A (en) | Ic card, portable electronic device, and ic card control program | |
JP5677195B2 (en) | Portable electronic device and method for controlling portable electronic device | |
JP2022178821A (en) | Secure element, and transaction control method and device | |
JP2008152411A (en) | Information processor, information processing method and program | |
JP2006302130A (en) | Ic card and program for ic card | |
JP5875772B2 (en) | Portable electronic device, control method for portable electronic device, and processing system for portable electronic device | |
JP2016153945A (en) | Electronic information storage medium, counter rewriting method and counter rewriting program | |
JP6717154B2 (en) | IC card |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
RD04 | Notification of resignation of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7424 Effective date: 20131205 |
|
RD04 | Notification of resignation of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7424 Effective date: 20131212 |
|
RD04 | Notification of resignation of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7424 Effective date: 20131219 |
|
RD04 | Notification of resignation of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7424 Effective date: 20131226 |
|
RD04 | Notification of resignation of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7424 Effective date: 20140109 |
|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20141017 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20150625 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20150707 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20150902 |
|
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: 20150929 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20151028 |
|
R151 | Written notification of patent or utility model registration |
Ref document number: 5832940 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
S111 | Request for change of ownership or part of ownership |
Free format text: JAPANESE INTERMEDIATE CODE: R313111 Free format text: JAPANESE INTERMEDIATE CODE: R313114 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |