JP5832940B2 - IC card and portable electronic device - Google Patents

IC card and portable electronic device Download PDF

Info

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
Application number
JP2012061127A
Other languages
Japanese (ja)
Other versions
JP2013196197A (en
Inventor
竹田 元
元 竹田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toshiba Corp
Original Assignee
Toshiba Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Toshiba Corp filed Critical Toshiba Corp
Priority to JP2012061127A priority Critical patent/JP5832940B2/en
Publication of JP2013196197A publication Critical patent/JP2013196197A/en
Application granted granted Critical
Publication of JP5832940B2 publication Critical patent/JP5832940B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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.

特開平7−93203号公報JP-A-7-93203

上記のような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.

図1は、一実施形態に係るICカード処理システムの構成例について説明するための図である。FIG. 1 is a diagram for explaining a configuration example of an IC card processing system according to an embodiment. 図2は、一実施形態に係るICカードの構成例について説明するための図である。FIG. 2 is a diagram for explaining a configuration example of an IC card according to an embodiment. 図3は、一実施形態に係るICカードの処理の例について説明するための図である。FIG. 3 is a diagram for explaining an example of processing of the IC card according to the embodiment. 図4は、一実施形態に係るICカードの処理の例について説明するための図である。FIG. 4 is a diagram for explaining an example of processing of an IC card according to an embodiment. 図5は、一実施形態に係るICカードの処理の例について説明するための図である。FIG. 5 is a diagram for explaining an example of processing of an IC card according to an embodiment. 図6は、一実施形態に係るICカードの処理の例について説明するための図である。FIG. 6 is a diagram for explaining an example of processing of the IC card according to the embodiment. 図7は、一実施形態に係るICカードの処理の例について説明するための図である。FIG. 7 is a diagram for explaining an example of processing of an IC card according to an embodiment.

以下、図面を参照しながら、一実施形態に係る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 IC card 20 according to the present embodiment have, for example, functions of contact communication and / or non-contact communication. Thereby, the IC card 20 and the terminal device 10 can transmit and receive data to and from each other.

図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 terminal device 10 that processes the IC card 20 and an IC card 20.

端末装置10は、CPU11、ROM12、RAM13、不揮発性メモリ14、カードリーダライタ15、操作部17、ディスプレイ18、及び電源部19を備える。CPU11、ROM12、RAM13、不揮発性メモリ14、カードリーダライタ15、操作部17、及びディスプレイ18は、それぞれバスを介して互いに接続されている。   The terminal device 10 includes a CPU 11, a ROM 12, a RAM 13, a nonvolatile memory 14, a card reader / writer 15, an operation unit 17, a display 18, and a power supply unit 19. 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は、端末装置10全体の制御を司る制御部として機能する。CPU11は、ROM12又は不揮発性メモリ14に記憶されている制御プログラム及び制御データに基づいて種々の処理を行う。例えば、CPU11は、カードリーダライタ15を介してICカード20とコマンド及びレスポンスの送受信を行う。   The CPU 11 functions as a control unit that controls the entire terminal device 10. The CPU 11 performs various processes based on the control program and control data 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 20 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、FRAM(登録商標)などを備える。不揮発性メモリ14は、例えば、制御用のプログラム、制御データ、アプリケーション、及びアプリケーションに用いられるデータなどを記憶する。   The nonvolatile memory 14 includes, for example, EEPROM, FRAM (registered trademark), and the like. The nonvolatile memory 14 stores, for example, a control program, control data, an application, and data used for the application.

カードリーダライタ15は、ICカード20と通信を行うためのインターフェース装置である。カードリーダライタ15は、接触通信、または非接触通信によりICカード20とデータの送受信を行う。   The card reader / writer 15 is an interface device for communicating with the IC card 20. The card reader / writer 15 transmits / receives data to / from the IC card 20 by contact communication or non-contact communication.

接触通信のインターフェースとして用いられる場合、カードリーダライタ15は、ICカード20が装着されるスロットと、ICカード20が備えるコンタクトパターンと接続される複数の接触端子を備える。   When used as an interface for contact communication, the card reader / writer 15 includes a slot in which the IC card 20 is mounted and a plurality of contact terminals connected to a contact pattern included in the IC card 20.

スロットにICカード20が装着される場合、カードリーダライタ15の複数の接触端子は、ICカード20のコンタクトパターンに接続される。これにより、端末装置10とICカード20とは電気的に接続される。カードリーダライタ15は、スロットに装着されるICカード20に対して、電力の供給、クロックの供給、リセット信号の入力、及びデータの送受信などを行う。   When the IC card 20 is mounted in the slot, the plurality of contact terminals of the card reader / writer 15 are connected to the contact pattern of the IC card 20. Thereby, the terminal device 10 and the IC card 20 are electrically connected. The card reader / writer 15 performs power supply, clock supply, reset signal input, data transmission / reception, and the like to the IC card 20 installed in the slot.

また、非接触通信のインターフェースとして用いられる場合、カードリーダライタ15は、送受信するデータに対して信号処理を施す信号処理部と、所定の共振周波数を有するアンテナとを備える。   When used as an interface for non-contact communication, the card reader / writer 15 includes a signal processing unit that performs signal processing on data to be transmitted and received, and an antenna having a predetermined resonance frequency.

カードリーダライタ15は、例えば、信号処理部により、送受信するデータに対して符号化、復号、変調、及び復調などの信号処理を行なう。また、カードリーダライタ15は、符号化及び変調を施したデータをアンテナに供給する。アンテナは、供給されたデータに応じて磁界を発生させる。これにより、端末装置10は、通信可能範囲に存在するICカード20に対してデータを非接触で送信することができる。   For example, the card reader / writer 15 performs signal processing such as encoding, decoding, modulation, and demodulation on data to be transmitted and received by a signal processing unit. The card reader / writer 15 supplies the encoded and modulated data to the antenna. The antenna generates a magnetic field according to the supplied data. Thereby, the terminal device 10 can transmit data to the IC card 20 existing in the communicable range in a non-contact manner.

さらに、カードリーダライタ15のアンテナは、磁界を検知し、検知した磁界に応じて信号を生成する。これにより、カードリーダライタ15は、信号を非接触で受信することができる。信号処理部は、アンテナにより受信された信号に対して復調及び復号を行う。これにより、端末装置10は、ICカード20から送信された元のデータを取得することができる。   Further, the antenna of the card reader / writer 15 detects a magnetic field and generates a signal according to the detected magnetic field. Thereby, the card reader / writer 15 can receive a signal in a non-contact manner. The signal processing unit demodulates and decodes the signal received by the antenna. Thereby, the terminal device 10 can acquire the original data transmitted from the IC card 20.

操作部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 display 18 displays various information based on signals for displaying video input from the CPU 11 or a display processing module such as a graphic controller (not shown).

電源部19は、端末装置10の各部に電力を供給する。電源部19は、例えば、商用電源より電力を受け取り、所定の電圧に変換し、端末装置10の各部に供給する。   The power supply unit 19 supplies power to each unit of the terminal device 10. For example, the power supply unit 19 receives power from a commercial power supply, converts the power into a predetermined voltage, and supplies the voltage to each unit of the terminal device 10.

図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 IC card 20 according to one embodiment.
As shown in FIG. 2, the IC card 20 includes, for example, a rectangular main body 21 and an IC module 22 built in the main body 21. The IC module 22 includes an IC chip 23 and a communication unit 24. The IC chip 23 and the communication unit 24 are formed in the IC module 22 while being connected to each other.

なお、本体21は、少なくとも通信部24が配設されるICモジュール22を設置可能な形状であれば、矩形状に限らず如何なる形状であっても良い。   The main body 21 is not limited to a rectangular shape, and may have any shape as long as the IC module 22 in which at least the communication unit 24 is disposed can be installed.

ICチップ23は、通信部24、CPU25、ROM26、RAM27、不揮発性メモリ28、電源部31、及びロジック部32などを備える。通信部24、CPU25、ROM26、RAM27、不揮発性メモリ28、電源部31、及びロジック部32は、バスを介して互いに接続されている。   The IC chip 23 includes a communication unit 24, a CPU 25, a ROM 26, a RAM 27, a nonvolatile memory 28, a power supply unit 31, a logic unit 32, and the like. The communication unit 24, the CPU 25, the ROM 26, the RAM 27, the nonvolatile memory 28, the power supply unit 31, and the logic unit 32 are connected to each other via a bus.

通信部24は、端末装置(外部機器)10のカードリーダライタ15と通信を行うためのインターフェースである。通信部24は、接触通信、または非接触通信により、端末装置10とデータの送受信を行う。   The communication unit 24 is an interface for communicating with the card reader / writer 15 of the terminal device (external device) 10. The communication unit 24 transmits / receives data to / from the terminal device 10 by contact communication or non-contact communication.

接触通信のインターフェースとして用いられる場合、通信部24は、カードリーダライタ15の接触端子と接続されるコンタクトパターンを備える。コンタクトパターンは、導電性を有する金属などによりICモジュール22の表面に形成される接触端子である。即ち、コンタクトパターンは、端末装置10と接触可能に形成されている。   When used as an interface for contact communication, the communication unit 24 includes a contact pattern connected to a contact terminal of the card reader / writer 15. The contact pattern is a contact terminal formed on the surface of the IC module 22 with a conductive metal or the like. That is, the contact pattern is formed so as to be in contact with the terminal device 10.

コンタクトパターンは、金属により形成される面が複数のエリアに区切られて形成される。区切られた各エリアは、それぞれ端子として機能する。通信部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 communication unit 24 can transmit / receive data to / from the card reader / writer 15 via the contact pattern.

また、非接触通信のインターフェースとして用いられる場合、通信部24は、信号処理部とアンテナとを備える。   When used as an interface for non-contact communication, the communication unit 24 includes a signal processing unit and an antenna.

信号処理部は、端末装置10に送信するデータに対して符号化、負荷変調などの信号処理を行う。例えば、信号処理部は、端末装置10に送信するデータの変調(増幅)を行う。信号処理部は、信号処理を施したデータをアンテナに供給する。   The signal processing unit performs signal processing such as encoding and load modulation on data to be transmitted to the terminal device 10. For example, the signal processing unit modulates (amplifies) data to be transmitted to the terminal device 10. The signal processing unit supplies the signal-processed data to the antenna.

アンテナは、例えば、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 IC module 22. The IC card 20 generates a magnetic field by an antenna according to data transmitted to the terminal device 10. Thereby, the IC card 20 can transmit data to the terminal device 10. Further, the IC card 20 recognizes data transmitted from the terminal device 10 based on an induced current generated in the antenna by electromagnetic induction.

例えば、信号処理部は、アンテナに発生する誘導電流に対して復調、及び復号を行う。例えば、信号処理部は、アンテナにより受信する信号の解析を行う。これにより、通信部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 communication unit 24 acquires binary logical data. The communication unit 24 transmits the analyzed data to the CPU 25 via the bus.

CPU25は、ICカード20全体の制御を司る制御部として機能する。CPU25は、ROM26あるいは不揮発性メモリ28に記憶されている制御プログラム及び制御データに基づいて種々の処理を行う。例えば、端末装置10から受信したコマンドに応じて種々の処理を行い、処理結果としてのレスポンスなどのデータの生成を行なう。   The CPU 25 functions as a control unit that controls the entire IC card 20. The CPU 25 performs various processes based on the control program and control data stored in the ROM 26 or the nonvolatile memory 28. For example, various processes are performed in accordance with commands received from the terminal device 10 and data such as responses as processing results is generated.

ROM26は、予め制御用のプログラム及び制御データなどを記憶する不揮発性のメモリである。ROM26は、製造段階で制御プログラム及び制御データなどを記憶した状態でICカード20内に組み込まれる。即ち、ROM26に記憶される制御プログラム及び制御データは、予めICカード20の仕様に応じて組み込まれる。   The ROM 26 is a non-volatile memory that stores a control program and control data in advance. The ROM 26 is incorporated in the IC card 20 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 26 are incorporated in advance according to the specifications of the IC card 20.

RAM27は、ワーキングメモリとして機能する揮発性のメモリである。RAM27は、CPU25の処理中のデータなどを一時的に格納する。例えば、RAM27は、通信部24を介して端末装置10から受信したデータを一時的に格納する。またRAM27は、通信部24を介して端末装置10に送信するデータを一時的に格納する。またさらに、RAM27は、CPU25が実行するプログラムを一時的に格納する。   The RAM 27 is a volatile memory that functions as a working memory. The RAM 27 temporarily stores data being processed by the CPU 25. For example, the RAM 27 temporarily stores data received from the terminal device 10 via the communication unit 24. The RAM 27 temporarily stores data to be transmitted to the terminal device 10 via the communication unit 24. Furthermore, the RAM 27 temporarily stores a program executed by the CPU 25.

不揮発性メモリ28は、例えば、EEPROMあるいはフラッシュROMなどのデータの書き込み及び書換えが可能な不揮発性のメモリを備える。不揮発性メモリ28は、ICカード20の運用用途に応じて制御プログラム及び種々のデータを格納する。   The non-volatile memory 28 includes a non-volatile memory capable of writing and rewriting data, such as an EEPROM or a flash ROM. The nonvolatile memory 28 stores a control program and various data according to the usage application of the IC card 20.

たとえば、不揮発性メモリ28では、プログラムファイル及びデータファイルなどが創成される。創成された各ファイルには、制御プログラム及び種々のデータなどが書き込まれる。CPU25は、不揮発性メモリ28、または、ROM26に記憶されているプログラムを実行することにより、種々の処理を実現することができる。   For example, in the nonvolatile memory 28, a program file and a data file are created. A control program and various data are written in each created file. The CPU 25 can implement various processes by executing programs stored in the nonvolatile memory 28 or the ROM 26.

電源部31は、端末装置10の各部に電力を供給する。ICカード20が接触通信を行う構成を備える場合、電源部31は、通信部24のコンタクトパターンを介してカードリーダライタ15から供給される電力をICカード20の各部に供給する。   The power supply unit 31 supplies power to each unit of the terminal device 10. When the IC card 20 has a configuration for performing contact communication, the power supply unit 31 supplies power supplied from the card reader / writer 15 to each unit of the IC card 20 via the contact pattern of the communication unit 24.

また、ICカード20が非接触通信を行う構成を備える場合、カードリーダライタ15のアンテナから送信される電波、特にキャリア波に基づいて電力を生成する。さらに、電源部31は、動作クロックを生成する。電源部31は、発生させた電力及び動作クロックをICカード20の各部に電力を供給する。ICカード20の各部は、電力の供給を受けた場合、動作可能な状態になる。   In addition, when the IC card 20 has a configuration for performing contactless communication, power is generated based on radio waves transmitted from the antenna of the card reader / writer 15, particularly carrier waves. Furthermore, the power supply unit 31 generates an operation clock. The power supply unit 31 supplies the generated power and operation clock to each unit of the IC card 20. Each unit of the IC card 20 becomes operable when supplied with power.

ロジック部32は、演算処理をハードウエアにより行う演算部である。例えば、ロジック部32は、端末装置10からのコマンドに基づいて、暗号化、復号、ハッシュ計算、及び乱数の生成などの処理を行う。例えば、端末装置10から相互認証コマンドを受信する場合、ロジック部32は、相互認証処理に係る演算処理を実行する。   The logic unit 32 is an arithmetic unit that performs arithmetic processing by hardware. For example, the logic unit 32 performs processes such as encryption, decryption, hash calculation, and random number generation based on a command from the terminal device 10. For example, when receiving a mutual authentication command from the terminal device 10, the logic unit 32 executes a calculation process related to the mutual authentication process.

ICカード20は、一次発行と二次発行とにより発行される。ICカード20を発行する発行装置は、一次発行において、ICカード20にコマンド(初期化コマンド)を送信することにより、ICカード20の不揮発性メモリ28の初期化を行う。これにより、端末装置10は、ICカード20の不揮発性メモリ28内にICカード20の使用目的、及び使用用途などに応じた鍵ファイルやデータファイル等を定義する。   The IC card 20 is issued by primary issue and secondary issue. An issuing device that issues the IC card 20 initializes the nonvolatile memory 28 of the IC card 20 by transmitting a command (initialization command) to the IC card 20 in the primary issue. Accordingly, the terminal device 10 defines a key file, a data file, and the like corresponding to the purpose of use and use of the IC card 20 in the nonvolatile memory 28 of the IC card 20.

発行装置は、例えば、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 nonvolatile memory 28. The nonvolatile memory 28 that has been initialized includes a master file (MF), a dedicated file (DF), and an elementary file (EF).

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 IC card 20 becomes operable. That is, the CPU 25 can implement various processes by executing programs stored in the nonvolatile memory 28 or the ROM 26.

例えば、図3に示されるように、不揮発性メモリ28は、MF及び複数のEFを記憶する記憶領域28aを有する。図3は、記憶領域28aが有するファイルの構成(ファイルツリー)の例を示す。なお、記憶領域28aは、MFと、MFの下位にEF1、EF2、及びEF3を有する構成であるとして説明する。   For example, as illustrated in FIG. 3, the nonvolatile memory 28 includes a storage area 28 a that stores an MF and a plurality of EFs. FIG. 3 shows an example of the configuration (file tree) of the files included in the storage area 28a. The storage area 28a will be described as having a configuration having MF and EF1, EF2, and EF3 below MF.

図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 storage area 28a.
As shown in FIG. 4, the storage area 28a includes system common information, MF file management information, EF1 file management information, EF2 file management information, and EF3 file management information. The storage area 28a includes a data area for storing actual data of EF1, EF2, and EF3. Each EF data area is divided into two planes. That is, each EF includes a first data area and a second data area. The active side of the EF first data area and the second data area is referred to as an active surface.

さらに、システム共通情報は、テーブル切り替えフラグ、管理テーブル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 RAM 27 of the IC card 20 includes a storage area for storing an update start flag. The update start flag is a flag indicating whether or not an update process is being executed.

図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 CPU 25 of the IC card 20 refers to the management table indicated as active indicated by the table switching flag. Thereby, the CPU 25 recognizes which is the active surface between the first data area and the second data area of the EF to be read out of the management table referred to. The CPU 25 refers to the management information of the EF and reads the address of the data area on the active surface. The CPU 25 can read the data on the active surface by accessing the read address.

図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 storage area 28a. FIG. 7 shows an example of processing of the IC card 20. In this example, the IC card 20 receives commands in the order of the data update command 1 (first data update command), the data update command 2 (second data update command), and the batch update command. The data update command indicates a command that changes data in the EF data area, such as a write command, an overwrite command, an additional write command, or a delete command.

図6に示されるように、処理開始前の記憶領域28aは、「更新開始フラグ=OFF」、「データ切り替えフラグ=管理テーブル1」となっている。また、管理テーブル1は、「EF1=データ領域1」、「EF2=データ領域2」、「EF3=データ領域3」となっている。また、管理テーブル2は、「EF1=データ領域1」、「EF2=データ領域1」、「EF3=データ領域2」となっている。   As shown in FIG. 6, the storage area 28a before the start of processing is “update start flag = OFF” and “data switching flag = management table 1”. Further, the management table 1 has “EF1 = data area 1”, “EF2 = data area 2”, and “EF3 = data area 3”. In addition, the management table 2 has “EF1 = data area 1”, “EF2 = data area 1”, and “EF3 = data area 2”.

また、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 storage area 28 a has such data, the active management table is the management table 1. The active surface of EF1 is “data area 1 = 0000 0000”. The active surface of EF2 is “data area 2 = FF FFFF FFFF”. The active surface of EF3 is “data area 1 = 00 0000”.

この状態で上記したようなデータ更新コマンドを受信した場合の処理を図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 terminal device 10, the IC card 20 is activated and enters an idle state. First, the CPU 25 of the IC card 20 initializes the RAM 27 (step S11). That is, at this time, the update start flag in the RAM 27 is in an initial state (OFF).

さらに、ICカード20は、ATR(Answer to Reset)を端末装置10に送信する(ステップS12)。さらに、ICカード20は、コマンドの受信を待つ状態になる(ステップS13)。   Furthermore, the IC card 20 transmits ATR (Answer to Reset) to the terminal device 10 (step S12). Further, the IC card 20 waits for reception of a command (step S13).

ICカード20は、コマンドを受信した場合、受信したコマンドが一括更新コマンドであるか否かを判断する(ステップS14)。即ち、CPU25は、受信したコマンドを解析し、受信したコマンドのコマンド種別(INS)が一括更新コマンドを示すか否か判断する。   When receiving the command, the IC card 20 determines whether or not the received command is a batch update command (step S14). That is, the CPU 25 analyzes the received command and determines whether or not the command type (INS) of the received command indicates a batch update command.

受信したコマンドが一括更新コマンドではない場合、CPU25は、受信したコマンドがデータ更新コマンドであるか否か判断する(ステップS15)。即ち、CPU25は、受信したコマンドのコマンド種別(INS)がデータ更新コマンドを示すか否か判断する。   If the received command is not a batch update command, the CPU 25 determines whether the received command is a data update command (step S15). That is, the CPU 25 determines whether or not the command type (INS) of the received command indicates a data update command.

受信したコマンドがデータ更新コマンドである場合、CPU25は、RAM27上の更新開始フラグがOFFであるか否か判断する(ステップS16)。更新開始フラグがOFFである場合、CPU25は、RAM27上の更新開始フラグをONに切り替える(ステップS17)。また、更新開始フラグがONである場合、CPU25は、ステップS19の処理に移行する。   If the received command is a data update command, the CPU 25 determines whether or not the update start flag on the RAM 27 is OFF (step S16). When the update start flag is OFF, the CPU 25 switches the update start flag on the RAM 27 to ON (step S17). If the update start flag is ON, the CPU 25 proceeds to the process of step S19.

さらに、CPU25は、管理テーブルをコピーする(ステップS18)。なお、CPU25は、アクティブな管理テーブルを無効側(パッシブ)の管理テーブルにコピーする。図6に示す例では、管理テーブル1がアクティブである。この場合、CPU25は、管理テーブル1を管理テーブル2にコピーする。これにより、CPU25は、管理テーブル2のEF1のアクティブ面をデータ領域1、EF2のアクティブ面をデータ領域2、EF3のアクティブ面をデータ領域1にそれぞれ書き換える。   Further, the CPU 25 copies the management table (step S18). The CPU 25 copies the active management table to the invalid side (passive) management table. In the example shown in FIG. 6, the management table 1 is active. In this case, the CPU 25 copies the management table 1 to the management table 2. Thereby, the CPU 25 rewrites the active surface of EF1 of the management table 2 to the data region 1, the active surface of EF2 to the data region 2, and the active surface of EF3 to the data region 1, respectively.

さらに、CPU25は、受信したデータ更新コマンドに応じたコマンド処理を実行する(ステップS19)。この場合、CPU25は、コマンドにより指定されたEFの非アクティブ面(パッシブ面)に対して、データ更新処理を実行する。   Further, the CPU 25 executes command processing according to the received data update command (step S19). In this case, the CPU 25 executes data update processing for the inactive surface (passive surface) of the EF designated by the command.

なお、ICカード20が受信したデータ更新コマンド1は、EF1を「1111 1111」に書き換えるコマンドであるとして説明する。アクティブなデータ管理テーブルは、管理テーブル1である。また、EF1のアクティブ面は、データ領域1である。即ち、EF1のパッシブ面は、データ領域2である。この場合、CPU25は、EF1のパッシブ面であるデータ領域2を「1111 1111」に書き換える。   The data update command 1 received by the IC card 20 will be described as a command for rewriting EF1 to “1111 1111”. The active data management table is the management table 1. The active surface of EF1 is the data area 1. That is, the passive surface of EF1 is the data area 2. In this case, the CPU 25 rewrites the data area 2 that is the passive surface of the EF 1 to “1111 1111”.

CPU25は、コマンド処理が正常終了したか否か判断する(ステップS20)。正常終了した場合、CPU25は、パッシブ側の管理テーブルを更新する(ステップS21)。即ち、CPU25は、データ更新処理を行ったデータ領域をパッシブ面からアクティブ面に切り替える。即ち、CPU25は、パッシブの管理テーブルのデータ更新処理を行ったEFのパッシブ面をアクティブ面に切り替える。図6の例によると、CPU25は、管理テーブル2のEF1のアクティブ面をデータ領域1からデータ領域2に切り替える。   The CPU 25 determines whether or not the command processing has been normally completed (step S20). When the process is normally completed, the CPU 25 updates the management table on the passive side (step S21). That is, the CPU 25 switches the data area where the data update process has been performed from the passive surface to the active surface. That is, the CPU 25 switches the passive surface of the EF that has been subjected to the data update process of the passive management table to the active surface. According to the example of FIG. 6, the CPU 25 switches the active surface of the EF 1 in the management table 2 from the data area 1 to the data area 2.

また、CPU25は、ステップS20でコマンド処理が正常終了しなかったと判断した場合,ステップS20からステップS22に移行する。   On the other hand, if the CPU 25 determines in step S20 that the command processing has not ended normally, the process proceeds from step S20 to step S22.

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 IC card 20 again shifts to an idle state where it waits for reception of a command.

またここで、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 CPU 25 performs the same processing as the above steps S17 to S22. That is, the CPU 25 writes data to the passive surface of the EF 2 indicated by the management table 1 that is an active data management table. As a result, the CPU 25 rewrites the data area 1 of the EF 2 to “22 2222 2222”. Further, the CPU 25 rewrites the active surface of the EF 2 in the management table 2 from the data area 2 to the data area 1.

また、ステップ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 CPU 25 determines whether or not the update start flag on the RAM 27 is ON (step S23). When the update start flag on the RAM 27 is OFF, the CPU 25 proceeds to step S22 and ends the process. When the update start flag is ON, the update start flag indicates that data update processing has been executed so far. The CPU 25 performs a process of reflecting all the results of the data update process.

更新開始フラグがONである場合、CPU25は、テーブル切り替えフラグを更新する(ステップS24)。これにより、CPU25は、パッシブな管理テーブル情報をアクティブにする。即ち、CPU25は、管理テーブル2がアクティブになるようにテーブル切り替えフラグを切り替える。   When the update start flag is ON, the CPU 25 updates the table switching flag (step S24). As a result, the CPU 25 activates the passive management table information. That is, the CPU 25 switches the table switching flag so that the management table 2 becomes active.

さらに、CPU25は、RAM27上の更新開始フラグをOFFに切り替える(ステップS25)。CPU25は、処理結果に応じてレスポンスを端末装置10に送信し、処理を終了する。   Further, the CPU 25 switches the update start flag on the RAM 27 to OFF (step S25). CPU25 transmits a response to terminal unit 10 according to a processing result, and ends processing.

また、ステップS15で、受信したコマンドがデータ更新コマンドではないと判断した場合、CPU25は、受信したコマンドに応じた処理を実行し(ステップS26)、ステップS22に移行する。   If it is determined in step S15 that the received command is not a data update command, the CPU 25 executes processing according to the received command (step S26), and proceeds to step S22.

上記したような処理により、記憶領域28aは、図6の一番右側の列に示されるような状態になる。この場合、アクティブな管理テーブルは管理テーブル2である。また、管理テーブル2は、EF1のアクティブ面がデータ領域2、EF2のアクティブ面がデータ領域1、EF3のアクティブ面がデータ領域1であることを示す。   By the processing as described above, the storage area 28a is in a state as shown in the rightmost column of FIG. In this case, the active management table is the management table 2. The management table 2 indicates that the active surface of EF1 is the data region 2, the active surface of EF2 is the data region 1, and the active surface of EF3 is the data region 1.

上記したように、ICカード20の不揮発性メモリは、二面化されたファイルと、二面化されたファイルのうちのアクティブな面を示す2つの管理テーブルと、2つの管理テーブルのうちのアクティブな管理テーブルを示すフラグ情報とを有する。ICカード20は、データ更新コマンドを受信した場合、二面化されたファイルの非アクティブ面にデータを書き込み、非アクティブな管理テーブルを更新する。さらに、ICカード20は、一括更新コマンドを受信した場合、アクティブな管理テーブルを切り替える。   As described above, the non-volatile memory of the IC card 20 includes the two-sided file, the two management tables indicating the active side of the two-sided file, and the active of the two management tables. And flag information indicating a management table. When the IC card 20 receives the data update command, the IC card 20 writes data to the inactive side of the doubled file and updates the inactive management table. Further, the IC card 20 switches the active management table when receiving the batch update command.

このような構成によると、例えば、データ更新コマンド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 storage area 28a of the non-volatile memory 28 of the IC card 20 is in a rollback state that has not been rewritten before processing. For this reason, the process for correcting the memory at the time of restart is unnecessary.

これにより、例えば、大量の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 nonvolatile memory 28 is ensured regardless of the restriction on the size of the commit buffer. Can do.

これにより、ICカード20は、一括更新前に書き換え前と書き換え後の両方のデータを保持することができる。この為、ICカード20は、不揮発性メモリ28に不整合が生じることを防ぐことができる。   Thereby, the IC card 20 can hold both data before and after rewriting before the batch update. For this reason, the IC card 20 can prevent inconsistency in the nonvolatile memory 28.

また、上記のような構成によると、ICカード20は、フラグ情報を切り替えることにより、一括更新処理を完了させることができる。これにより、一括更新処理中に電源遮断などが生じる可能性を抑えることができる。   Further, according to the above configuration, the IC card 20 can complete the batch update process by switching the flag information. As a result, it is possible to suppress the possibility of power interruption or the like during the batch update process.

また、ICカード20は、データ更新コマンドに応じて書き込んだデータを処理後の不揮発性メモリ28のアクティブ面としてそのまま用いることができる。この為、書き込みデータの2度書きなどの必要が無い。この結果、処理時間を短縮することができる
この結果、より効率的に処理を実行するICカード、及び携帯可能電子装置を提供することができる。
Further, the IC card 20 can use the data written according to the data update command as it is as the active surface of the non-volatile memory 28 after processing. For this reason, there is no need to write the write data twice. As a result, the processing time can be shortened. As a result, an IC card and a portable electronic device that perform processing more efficiently can be provided.

また、上記した実施形態において、データ更新コマンドが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 card 20 determines in step S15 in FIG. 7 that the received command is a data update command and a binary command, the data area of the active surface is updated before the data is updated in step S19. The data may be copied to the data area of the passive surface. This prevents data from becoming inconsistent after processing.

また、上記した実施形態では、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 IC card 20 has been described as a configuration including a two-sided EF data area. However, the present invention is not limited to this configuration. The IC card 20 may be configured to include a double-sided DF data area or a double-sided MF data area. In such a case, the storage area 28a of the nonvolatile memory 28 of the IC card 20 includes a data area 1 and a data area 2 for storing DF or MF actual data. Further, the storage area 28a is provided with a management table indicating the effective planes in the data area 1 and the data area 2 in a doubled state. Furthermore, the storage area 28a further includes a flag indicating an effective surface of the management table.

なお、上述の各実施の形態で説明した機能は、ハードウエアを用いて構成するに留まらず、ソフトウエアを用いて各機能を記載したプログラムをコンピュータに読み込ませて実現することもできる。また、各機能は、適宜ソフトウエア、ハードウエアのいずれかを選択して構成するものであっても良い。   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 SYMBOLS 20 ... IC card, 21 ... Main body, 22 ... IC module, 23 ... IC chip, 24 ... Communication part, 25 ... CPU, 26 ... ROM, 27 ... RAM, 28 ... Non-volatile memory, 28a ... Storage area, 31 ... Power supply Part, 32 ... logic part,

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:
前記コマンド処理手段は、前記受信手段によりデータ更新コマンドを受信した場合、前記フラグ及び前記管理テーブルに基づいて、前記データ領域の無効面及び前記管理テーブルの無効面を認識し、前記データ領域の無効面にコマンドに応じたデータを書き込み、前記管理テーブルの無効面を更新する、請求項1に記載のICカード。   When the command processing means receives a data update command by the receiving means, the command processing means recognizes the invalid side of the data area and the invalid side of the management table based on the flag and the management table, and invalidates the data area. The IC card according to claim 1, wherein data corresponding to a command is written to a surface to update an invalid surface of the management table. 前記コマンド処理手段は、前記受信手段により一括更新コマンドを受信した場合、前記管理テーブルの無効面を有効面に切り替える、請求項2に記載のICカード。   The IC card according to claim 2, wherein the command processing unit switches the invalid side of the management table to a valid side when receiving the batch update command by the receiving unit. 前記コマンド処理手段は、前記受信手段により受信したコマンドが、データ更新コマンドであり、且つバイナリコマンドである場合、前記データ領域の有効面のデータを無効面にコピーし、前記データ領域の無効面にコマンドに応じたデータを書き込む、請求項3に記載のICカード。   When the command received by the receiving means is a data update command and a binary command, the command processing means copies the data in the valid area of the data area to the invalid face, and sets the invalid area in the data area. The IC card according to claim 3, wherein data corresponding to the command is written. 更新開始フラグを記憶する第4の記憶手段を具備し、
前記コマンド処理手段は、前記更新開始フラグがOFFの状態で前記データ更新コマンドに応じたコマンド処理を開始した場合、前記更新開始フラグをONに切り替え、前記一括更新コマンドに応じたコマンド処理を完了した場合、前記更新開始フラグをOFFに切り替える、
請求項に記載の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 .
前記コマンド処理手段は、前記更新開始フラグをONに切り替えた場合、前記管理テーブルを有効面から無効面にコピーする、請求項5に記載のICカード。   6. The IC card according to claim 5, wherein the command processing means copies the management table from the valid surface to the invalid surface when the update start flag is switched to ON. 前記コマンド処理手段は、前記受信手段により読み出しコマンドを受信した場合、前記フラグ及び前記管理テーブルに基づいて、前記データ領域の有効面を認識し、前記データ領域の有効面のデータを読み出す、請求項1に記載のICカード。   The command processing means, when receiving a read command by the receiving means, recognizes an effective surface of the data area based on the flag and the management table, and reads data of an effective surface of the data area. 1. The IC card according to 1. 前記受信手段と、前記コマンド処理手段と、前記送信手段と、前記第1の記憶手段と、前記第2の記憶手段と、前記第3の記憶手段と、を備えるICモジュールと、
前記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:
JP2012061127A 2012-03-16 2012-03-16 IC card and portable electronic device Active JP5832940B2 (en)

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)

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