JP4836707B2 - Portable electronic device and IC card - Google Patents

Portable electronic device and IC card Download PDF

Info

Publication number
JP4836707B2
JP4836707B2 JP2006224317A JP2006224317A JP4836707B2 JP 4836707 B2 JP4836707 B2 JP 4836707B2 JP 2006224317 A JP2006224317 A JP 2006224317A JP 2006224317 A JP2006224317 A JP 2006224317A JP 4836707 B2 JP4836707 B2 JP 4836707B2
Authority
JP
Japan
Prior art keywords
command
scenario
memory
processing
scenarios
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.)
Expired - Fee Related
Application number
JP2006224317A
Other languages
Japanese (ja)
Other versions
JP2008047040A (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 JP2006224317A priority Critical patent/JP4836707B2/en
Publication of JP2008047040A publication Critical patent/JP2008047040A/en
Application granted granted Critical
Publication of JP4836707B2 publication Critical patent/JP4836707B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、たとえば、書換え可能な不揮発性メモリおよびCPU(セントラル・プロセッシング・ユニット)などの制御素子を有するIC(集積回路)チップを内蔵し、外部から供給されるコマンドに基づき各種処理を実行してその処理結果を外部へ出力するICカードなどの携帯可能電子装置およびICカードに関する。   The present invention incorporates an IC (integrated circuit) chip having control elements such as a rewritable nonvolatile memory and a CPU (Central Processing Unit), and executes various processes based on commands supplied from the outside. The present invention relates to a portable electronic device such as an IC card that outputs the processing result to the outside and an IC card.

最近、携帯可能電子装置として、書換え可能な不揮発性メモリとしてのEEPROM、揮発性メモリとしてのRAM、これらのメモリに対してアクセス(データの読出しおよびまたは書込み等)を行なう制御素子としてのCPU、および、CPUの動作用プログラム等を格納したROMを有し、外部装置(カードリーダ・ライタ)から供給されるコマンド(命令)に対応した処理を実行して、その処理結果を外部装置へ出力する手段を備えたICチップを内蔵したICカードが産業各方面で利用されている。   Recently, as portable electronic devices, an EEPROM as a rewritable nonvolatile memory, a RAM as a volatile memory, a CPU as a control element for accessing (reading or writing data, etc.) these memories, and , Means having a ROM storing a CPU operation program and the like, executing processing corresponding to a command supplied from an external device (card reader / writer), and outputting the processing result to the external device IC cards with built-in IC chips are used in various industries.

一般に、この種のICカードは、外部装置(カードリーダ・ライタ)からの読出しコマンドを受信すると、対象となるデータを不揮発性メモリから検索し、該当したデータが存在する場合、当該データをその先頭からデータ長分、読出すようになっている。   In general, when this type of IC card receives a read command from an external device (card reader / writer), the target data is searched from a nonvolatile memory, and if the corresponding data exists, the data is read from the head. The data length is read from.

ところで、このようなICカードでは、複数のコマンドを順番通り、すなわち、あらかじめ定められたシナリオ通りに実行させることで1回の処理(たとえば、取引処理等)を完了する仕様が多数存在する(たとえば、特許文献1参照)。   By the way, in such an IC card, there are many specifications that complete a single process (for example, transaction processing) by executing a plurality of commands in order, that is, according to a predetermined scenario (for example, transaction processing) (for example, , See Patent Document 1).

しかし、シナリオはICカードの使用用途あるいは準拠仕様ごとに異なることが多い。また、ICカードは外部装置から送信されるコマンド単位にメモリの読出しや書込みなどを実行することが多く、シナリオが途中まで正常に実行されるが最終的に不正であると判断される場合でも、不揮発性メモリの内容が更新されてしまうこともある。
特開平11−282991号公報
However, the scenario often differs depending on the usage of the IC card or the compliant specification. In addition, the IC card often executes reading and writing of memory in units of commands transmitted from the external device, and even when the scenario is executed normally halfway but finally determined to be illegal, The contents of the nonvolatile memory may be updated.
Japanese Patent Laid-Open No. 11-282991

上記したように、シナリオはICカードの使用用途あるいは準拠仕様ごとに異なることが多く、また、ICカードは外部装置から送信されるコマンド単位にメモリ読出しや書込みなどを実行することが多く、シナリオが途中まで正常に実行されるが最終的に不正であると判断される場合でも、不揮発性メモリの内容が更新されてしまうこともあるという問題がある。   As described above, the scenario often differs depending on the usage or conformance specification of the IC card, and the IC card often executes memory reading and writing in units of commands transmitted from the external device. There is a problem that the contents of the non-volatile memory may be updated even when it is normally executed halfway but finally determined to be illegal.

そこで、本発明は、シナリオを柔軟に設定可能であり、かつ、不正シナリオの場合にはメモリの内容が更新されないような携帯可能電子装置およびICカードを提供することを目的とする。   Therefore, an object of the present invention is to provide a portable electronic device and an IC card in which a scenario can be set flexibly and the contents of the memory are not updated in the case of an illegal scenario.

本発明の携帯可能電子装置は、データを記憶するメモリと、外部から入力されるコマンドの実行順序を記載した複数のシナリオをあらかじめ記憶しているシナリオ記憶手段と、外部から入力される最初のコマンドにより前記複数のシナリオの中から参照するべきシナリオを識別する参照シナリオ識別手段と、この参照シナリオ識別手段により識別されたシナリオを参照することにより当該シナリオの実行順序通りにコマンド処理を実行する第1の処理手段と、この第1の処理手段によるコマンド処理が正常に実行され、最終コマンドが正常に実行された際、既に実行された複数のコマンドにより要求されたデータの書換えを前記メモリに対して実行する第2の処理手段とを具備している。   The portable electronic device of the present invention includes a memory for storing data, a scenario storage means for storing a plurality of scenarios describing the execution order of commands input from the outside, and a first command input from the outside A reference scenario identifying means for identifying a scenario to be referred to from among the plurality of scenarios, and a command process executed in the execution order of the scenario by referring to the scenario identified by the reference scenario identifying means. When the command processing by the first processing means and the command processing by the first processing means are executed normally and the final command is executed normally, the memory rewrites the data requested by the plurality of already executed commands. Second processing means to be executed.

また、本発明の携帯可能電子装置は、データを記憶するメモリと、外部から入力されるコマンドの実行順序を記載した複数のシナリオをあらかじめ記憶しているシナリオ記憶手段と、前記複数のシナリオに登録されているコマンドで、当該コマンドの処理が正常に終了した際に当該コマンドにより要求されたデータの書換えを前記メモリに反映するか否かを指定する書換え指定情報をあらかじめ記憶している書換え指定情報記憶手段と、外部から入力される最初のコマンドにより前記複数のシナリオの中から参照するべきシナリオを識別する参照シナリオ識別手段と、この参照シナリオ識別手段により識別されたシナリオを参照することにより当該シナリオの実行順序通りにコマンド処理を実行する第1の処理手段と、この第1の処理手段によるコマンド処理が正常に実行された際、当該コマンドが前記書換え指定情報により前記メモリに反映を許可されているか否かを判定し、許可されている場合は既に実行された複数のコマンドにより要求されたデータの書換えを前記メモリに対して実行する第3の処理手段とを具備している。   The portable electronic device of the present invention includes a memory for storing data, a scenario storage means for storing a plurality of scenarios describing the execution order of commands input from the outside, and registration in the plurality of scenarios. Rewrite designation information that pre-stores rewrite designation information that specifies whether or not the rewrite of data requested by the command is reflected in the memory when processing of the command is normally completed. A storage means, a reference scenario identifying means for identifying a scenario to be referred to from among the plurality of scenarios by a first command input from the outside, and the scenario identified by referring to the scenario identified by the reference scenario identifying means First processing means for executing command processing in accordance with the execution order of the When the command processing is normally executed, it is determined whether or not the command is permitted to be reflected in the memory by the rewrite designation information. If the command processing is permitted, it is requested by a plurality of commands that have already been executed. And third processing means for executing rewriting of the data on the memory.

また、本発明のICカードは、データを記憶するメモリと、外部から入力されるコマンドの実行順序を記載した複数のシナリオをあらかじめ記憶しているシナリオ記憶手段と、外部から入力される最初のコマンドにより前記複数のシナリオの中から参照するべきシナリオを識別する参照シナリオ識別手段と、この参照シナリオ識別手段により識別されたシナリオを参照することにより当該シナリオの実行順序通りにコマンド処理を実行する第1の処理手段と、この第1の処理手段によるコマンド処理が正常に実行され、最終コマンドが正常に実行された際、既に実行された複数のコマンドにより要求されたデータの書換えを前記メモリに対して実行する第2の処理手段とを有して構成されるICモジュールと、このICモジュールを収納したICカード本体とを具備している。   Further, the IC card of the present invention includes a memory for storing data, a scenario storage means for storing a plurality of scenarios describing the execution order of commands input from the outside, and a first command input from the outside A reference scenario identifying means for identifying a scenario to be referred to from among the plurality of scenarios, and a command process executed in the execution order of the scenario by referring to the scenario identified by the reference scenario identifying means. When the command processing by the first processing means and the command processing by the first processing means are executed normally and the final command is executed normally, the memory rewrites the data requested by the plurality of already executed commands. An IC module configured to have a second processing means to execute, and the IC module stored therein It is and a C card body.

また、本発明のICカードは、データを記憶するメモリと、外部から入力されるコマンドの実行順序を記載した複数のシナリオをあらかじめ記憶しているシナリオ記憶手段と、前記複数のシナリオに登録されているコマンドで、当該コマンドの処理が正常に終了した際に当該コマンドにより要求されたデータの書換えを前記メモリに反映するか否かを指定する書換え指定情報をあらかじめ記憶している書換え指定情報記憶手段と、外部から入力される最初のコマンドにより前記複数のシナリオの中から参照するべきシナリオを識別する参照シナリオ識別手段と、この参照シナリオ識別手段により識別されたシナリオを参照することにより当該シナリオの実行順序通りにコマンド処理を実行する第1の処理手段と、この第1の処理手段によるコマンド処理が正常に実行された際、当該コマンドが前記書換え指定情報により前記メモリに反映を許可されているか否かを判定し、許可されている場合は既に実行された複数のコマンドにより要求されたデータの書換えを前記メモリに対して実行する第3の処理手段とを有して構成されるICモジュールと、このICモジュールを収納したICカード本体とを具備している。   The IC card of the present invention includes a memory for storing data, a scenario storage means for storing a plurality of scenarios describing the execution order of commands input from the outside, and a plurality of scenarios registered in the plurality of scenarios. Rewrite designation information storage means for preliminarily storing rewrite designation information for designating whether or not the rewrite of data requested by the command is reflected in the memory when the processing of the command is normally completed A reference scenario identifying means for identifying a scenario to be referred to from among the plurality of scenarios by a first command input from the outside, and executing the scenario by referring to the scenario identified by the reference scenario identifying means A first processing means for executing command processing in order, and a command processing by the first processing means; When the command processing is normally executed, it is determined whether or not the command is permitted to be reflected in the memory by the rewrite designation information. If the command is permitted, the command has been requested by a plurality of commands already executed. And an IC module having a third processing means for executing data rewriting on the memory, and an IC card main body containing the IC module.

本発明によれば、シナリオを柔軟に設定可能であり、かつ、不正シナリオの場合にはメモリの内容が更新されないような携帯可能電子装置およびICカードを提供できる。   According to the present invention, it is possible to provide a portable electronic device and an IC card in which a scenario can be flexibly set and the contents of the memory are not updated in the case of an illegal scenario.

以下、本発明の実施の形態について図面を参照して説明する。
図1は、本発明の実施の形態に係る携帯可能電子装置としてのICカードを取扱うICカードシステムの構成例を示すものである。このICカードシステムは、ICカード11をカードリーダ・ライタ12を介してパーソナルコンピュータなどの端末装置13と接続可能にするとともに、端末装置13にキーボード14、CRTディスプレイ装置15、および、プリンタ16を接続して構成される。
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
FIG. 1 shows a configuration example of an IC card system that handles an IC card as a portable electronic device according to an embodiment of the present invention. In this IC card system, the IC card 11 can be connected to a terminal device 13 such as a personal computer via a card reader / writer 12, and a keyboard 14, a CRT display device 15 and a printer 16 are connected to the terminal device 13. Configured.

なお、図1のシステムを、たとえば、クレジットカードなどの決済システムに適用した場合はPOS端末装置や現金自動取引装置(ATM)となり、また、ポイントシステムに適用した場合はポイントの加算・減算を行なうポイント端末装置となる。   When the system shown in FIG. 1 is applied to a payment system such as a credit card, for example, it becomes a POS terminal device or an automatic cash transaction apparatus (ATM), and when applied to a point system, points are added or subtracted. It becomes a point terminal device.

図2は、ICカード11の構成を示すもので、制御素子としてのCPU101、記憶内容が書換え可能な記憶手段(メモリ)としてのデータメモリ102、ワーキングメモリ103、プログラムメモリ104、および、カードリーダ・ライタ12との電気的接触を得るためのコンタクト部105によって構成されている。そして、これらのうち、破線内の部分(CPU101、データメモリ102、ワーキングメモリ103、プログラムメモリ104)は1つ(あるいは複数)のICチップ106で構成され、さらに、このICチップ106とコンタクト部105とが一体的にICモジュール化されて、ICカード本体11a内に埋設されている。   FIG. 2 shows the configuration of the IC card 11, and includes a CPU 101 as a control element, a data memory 102 as a storage means (memory) whose contents can be rewritten, a working memory 103, a program memory 104, a card reader, The contact portion 105 is used to obtain electrical contact with the writer 12. Of these, the portion within the broken line (CPU 101, data memory 102, working memory 103, program memory 104) is composed of one (or a plurality) of IC chips 106, and further this IC chip 106 and contact portion 105. Are integrated into an IC module and embedded in the IC card main body 11a.

データメモリ102は、各種データの記憶に使用され、たとえば、EEPROMなどの記憶内容が書換え可能な不揮発性メモリで構成されている。本実施の形態の場合、データメモリ102には、当該ICカード11の所有者のデータ(たとえば、暗証番号等)や残高情報など、実際に運用時に使用されるデータが保存(記憶)される。また、後で詳細を説明する外部から入力されるコマンドの実行順序を記載した複数のシナリオも保存(記憶)される。   The data memory 102 is used for storing various types of data, and is composed of, for example, a nonvolatile memory such as an EEPROM that can be rewritten. In the case of the present embodiment, the data memory 102 stores (stores) data that is actually used during operation, such as data of the owner of the IC card 11 (for example, a personal identification number) and balance information. Further, a plurality of scenarios describing the execution order of commands input from the outside, which will be described in detail later, are also stored (stored).

ワーキングメモリ103は、CPU101が処理を行なう際の処理データなどを一時的に保持するための作業用メモリであり、たとえば、RAMなどで構成される。
プログラムメモリ104は、たとえば、マスクROMなどの記憶内容が書換え不可能な不揮発性メモリで構成されており、CPU101の制御プログラムなどを記憶するものである。
The working memory 103 is a working memory for temporarily storing processing data when the CPU 101 performs processing, and is configured by, for example, a RAM.
The program memory 104 is composed of, for example, a non-volatile memory that cannot be rewritten, such as a mask ROM, and stores a control program of the CPU 101 and the like.

図3は、第1の実施の形態に係るコマンドの実行順序を記載した複数のシナリオの構成例を示すものである。複数のシナリオ300は個々のシナリオ310により構成されており、個々のシナリオ310には実行されるべきコマンドのコマンド識別情報311(図中ではISO/IEC7816−4に記載のCLAバイトおよびINSバイト)が登録される。   FIG. 3 shows a configuration example of a plurality of scenarios describing the execution order of commands according to the first embodiment. The plurality of scenarios 300 are configured by individual scenarios 310, and each scenario 310 includes command identification information 311 (a CLA byte and an INS byte described in ISO / IEC7816-4 in the figure) of a command to be executed. be registered.

後述するように、第1コマンドで複数のシナリオ300の中からコマンド識別情報311を参照することで候補となる1つあるいは複数のシナリオ310が抽出されて、第2コマンド以降のコマンドで1つのシナリオ310が選択されることとなる。選択されたシナリオ310の通りに最終コマンドが実行された場合に、データメモリ102に対するデータの書換え処理が実施されることになる。   As will be described later, one or a plurality of scenarios 310 as candidates are extracted by referring to the command identification information 311 from among a plurality of scenarios 300 by the first command, and one scenario by the commands after the second command is extracted. 310 will be selected. When the final command is executed according to the selected scenario 310, the data rewriting process for the data memory 102 is performed.

図4は、第2の実施の形態に係るコマンドの実行順序を記載した複数のシナリオの構成例を示すものである。基本的な構成は第1の実施の形態(図3)と同様であるが、さらに、コマンド識別情報311と関連付けられて書換え指定情報312が登録されている点が第1の実施の形態と異なる。   FIG. 4 shows a configuration example of a plurality of scenarios describing the execution order of commands according to the second embodiment. The basic configuration is the same as that of the first embodiment (FIG. 3), but further differs from the first embodiment in that rewrite designation information 312 is registered in association with command identification information 311. .

書換え指定情報312は、コマンドにより要求されたデータの書換えをデータメモリ102に反映するか否かを指定する情報であり、図4の例では、「01」が書換え許可(反映)、「00」が書換え不許可(非反映)を示している。   The rewrite designation information 312 is information for designating whether or not data rewrite requested by the command is reflected in the data memory 102. In the example of FIG. 4, “01” is rewrite permission (reflection) and “00”. Indicates that rewriting is not permitted (not reflected).

基本的な動作も第1の実施の形態(図3)と同様に、コマンド識別情報311を参照することでシナリオ310の抽出、あるいは選択されたシナリオ310通りのコマンドが実行されているかの確認を行なうが、コマンド識別情報311の参照時に書換え指定情報312も一緒に参照することになる。   As with the first embodiment (FIG. 3), the basic operation is also to extract the scenario 310 by referring to the command identification information 311 or confirm whether the command according to the selected scenario 310 is executed. However, when the command identification information 311 is referred to, the rewrite designation information 312 is also referred to.

次に、このような構成において、第1の実施の形態に係るICカード11の動作例について図5に示すフローチャートを参照して説明する。なお、第1の実施の形態では図3のシナリオを用いるものとする。   Next, an example of the operation of the IC card 11 according to the first embodiment in such a configuration will be described with reference to the flowchart shown in FIG. Note that the scenario of FIG. 3 is used in the first embodiment.

カードリーダ・ライタ12から入力されるコマンドを受信すると(ステップS1)、CPU101は、受信したコマンドは第1コマンドであるか、あるいは、第2コマンド以降であるかの確認を行なう(ステップS2)。この確認の結果、受信したコマンドが第1コマンドの場合、CPU101は、当該コマンドが複数のシナリオ300内のシナリオ310と一致するものがあるか否かの確認を行なう(ステップS3)。この確認は、受信した第1コマンド内のCLAバイトおよびINSバイトとシナリオ310のコマンド識別情報311とを比較することにより行なわれる。   When a command input from the card reader / writer 12 is received (step S1), the CPU 101 checks whether the received command is the first command or after the second command (step S2). As a result of the confirmation, if the received command is the first command, the CPU 101 confirms whether there is a command that matches the scenario 310 in the plurality of scenarios 300 (step S3). This confirmation is performed by comparing the CLA byte and INS byte in the received first command with the command identification information 311 of the scenario 310.

ステップS3における確認の結果、受信したコマンドと一致するシナリオ310が存在しない場合、CPU101は処理終了として、カードリーダ・ライタ12に対し異常終了のレスポンスを送信する。   As a result of the confirmation in step S3, if there is no scenario 310 that matches the received command, the CPU 101 transmits an abnormal termination response to the card reader / writer 12 as the processing termination.

ステップS3における確認の結果、受信したコマンドと一致するシナリオ310が存在する場合、CPU101は、どのシナリオ310が一致したのかの履歴をワーキングメモリ103に保持する(ステップS4)。この場合のシナリオ310は1つあるいは複数個のシナリオ310となる。   As a result of the confirmation in step S3, when there is a scenario 310 that matches the received command, the CPU 101 holds a history of which scenario 310 matched in the working memory 103 (step S4). The scenario 310 in this case is one or a plurality of scenarios 310.

次に、CPU101は、受信したコマンドが書換えを指示する書換えコマンドであるか否かの確認を行なう(ステップS5)。この確認の結果、書込コマンドでない場合、CPU101は処理終了(各コマンド処理を実行)となる。   Next, the CPU 101 checks whether or not the received command is a rewrite command for instructing rewriting (step S5). If the result of this confirmation is that the command is not a write command, the CPU 101 terminates processing (executes each command processing).

ステップS5における確認の結果、書込みコマンドの場合、CPU101は、最終コマンドの実行時に書込むデータを保持するために、当該コマンド内の書込み対象データを含むコマンド情報をワーキングメモリ103内のバッファに格納(保持)する(ステップS6)。その後、CPU101は処理終了(各コマンド処理を実行)となる。   As a result of the confirmation in step S5, in the case of a write command, the CPU 101 stores command information including data to be written in the command in a buffer in the working memory 103 in order to hold data to be written when the final command is executed ( (Step S6). Thereafter, the CPU 101 ends the process (executes each command process).

ステップS2における確認の結果、受信したコマンドが第2コマンド以降である場合、CPU101は、前記ステップS3〜S4処理で候補となった1つあるいは複数のシナリオ310から、受信したコマンドと一致するものがあるか否かの確認を行なう(ステップS7)。この確認は、受信したコマンド内のCLAバイトおよびINSバイトとワーキングメモリ103に保持されている一致したシナリオ310のコマンド識別情報311とを比較することにより行なわれる。   As a result of the confirmation in step S2, when the received command is the second command or later, the CPU 101 matches the received command from one or a plurality of scenarios 310 that are candidates in the processing in steps S3 to S4. It is confirmed whether or not there is (step S7). This confirmation is performed by comparing the CLA byte and INS byte in the received command with the command identification information 311 of the matched scenario 310 held in the working memory 103.

ステップS7における確認の結果、受信したコマンドと一致するシナリオ310が存在しない場合、CPU101は処理終了として、カードリーダ・ライタ12に対し異常終了のレスポンスを送信する。   As a result of the confirmation in step S7, if there is no scenario 310 that matches the received command, the CPU 101 transmits an abnormal termination response to the card reader / writer 12 as the processing is terminated.

ステップS7における確認の結果、受信したコマンドと一致するシナリオ310が存在する場合、CPU101は、どのシナリオ310が一致したのかの履歴をワーキングメモリ103に保持する(ステップS8)。   As a result of the confirmation in step S7, if there is a scenario 310 that matches the received command, the CPU 101 holds a history of which scenario 310 matched in the working memory 103 (step S8).

次に、CPU101は、受信したコマンドが書換えを指示する書換えコマンドであるか否かの確認を行なう(ステップS9)。この確認の結果、書込みコマンドの場合、CPU101は、最終コマンドの実行時に書込むデータを保持するために、当該コマンド内の書込み対象データを含むコマンド情報をワーキングメモリ103内のバッファに格納し(ステップS10)、ステップS11に進む。
ステップS9における確認の結果、書込コマンドでない場合、CPU101は、ステップS10をジャンプしてステップS11に進む。
Next, the CPU 101 checks whether or not the received command is a rewrite command for instructing rewriting (step S9). As a result of this confirmation, in the case of a write command, the CPU 101 stores command information including data to be written in the command in a buffer in the working memory 103 in order to hold data to be written at the time of execution of the final command (step S10), the process proceeds to step S11.
If the result of the confirmation in step S9 is not a write command, the CPU 101 jumps to step S10 and proceeds to step S11.

ステップS11では、当該シナリオ310の処理が最終コマンドまで実行されているか、すなわち、当該コマンドがコマンド識別情報311により最終コマンドと認識されるかの確認を行なう。この確認の結果、当該コマンドが最終コマンドでない場合、CPU101は処理終了(各コマンド処理を実行)となる。   In step S11, it is confirmed whether the process of the scenario 310 has been executed up to the final command, that is, whether the command is recognized as the final command by the command identification information 311. As a result of the confirmation, if the command is not the final command, the CPU 101 ends the process (executes each command process).

ステップS11における確認の結果、当該コマンドが最終コマンドの場合、CPU101は、ワーキングメモリ103内のバッファに格納されているコマンド情報内の書込み対象データを、たとえばデータメモリ102の指定されたエリアに書込む処理を行なう(ステップS12)。その後、CPU101は処理終了として、カードリーダ・ライタ12に対し正常終了のレスポンスを送信する。   As a result of the confirmation in step S11, if the command is the final command, the CPU 101 writes the write target data in the command information stored in the buffer in the working memory 103, for example, in a specified area of the data memory 102. Processing is performed (step S12). After that, the CPU 101 transmits a normal end response to the card reader / writer 12 as the process ends.

このように、上記第1の実施の形態によれば、外部から入力されるコマンドの実行順序を記載した複数のシナリオをあらかじめ記憶しておき、外部から入力される最初のコマンドにより上記複数のシナリオの中から参照するべきシナリオを識別し、この識別されたシナリオを参照することにより当該シナリオの実行順序通りにコマンド処理を実行し、このコマンド処理が正常に実行され、最終コマンドが正常に実行された際、既に実行された複数のコマンドにより要求されたデータの書換えをメモリに対して実行することで、シナリオを柔軟に設定可能であり、かつ、不正シナリオの場合にはメモリの内容が更新されないようにすることが可能となる。   As described above, according to the first embodiment, a plurality of scenarios describing the execution order of commands input from the outside are stored in advance, and the plurality of scenarios are determined by the first command input from the outside. The scenario to be referred to is identified from among the scenarios, and by referring to the identified scenario, the command processing is executed according to the execution order of the scenario, the command processing is executed normally, and the final command is executed normally. In this case, the scenario can be flexibly set by rewriting the data requested by multiple commands already executed to the memory, and the contents of the memory are not updated in the case of an illegal scenario. It becomes possible to do so.

次に、第2の実施の形態に係るICカード11の動作例について図6に示すフローチャートを参照して説明する。なお、第2の実施の形態では図4のシナリオを用いるものとする。   Next, an operation example of the IC card 11 according to the second embodiment will be described with reference to a flowchart shown in FIG. Note that the scenario of FIG. 4 is used in the second embodiment.

カードリーダ・ライタ12から入力されるコマンドを受信すると(ステップS21)、CPU101は、受信したコマンドは第1コマンドであるか、あるいは、第2コマンド以降であるかの確認を行なう(ステップS22)。この確認の結果、受信したコマンドが第1コマンドの場合、CPU101は、当該コマンドが複数のシナリオ300内のシナリオ310と一致するものがあるか否かの確認を行なう(ステップS23)。この確認は、受信した第1コマンド内のCLAバイトおよびINSバイトとシナリオ310のコマンド識別情報311とを比較することにより行なわれる。   When a command input from the card reader / writer 12 is received (step S21), the CPU 101 checks whether the received command is the first command or after the second command (step S22). As a result of the confirmation, if the received command is the first command, the CPU 101 confirms whether there is a command that matches the scenario 310 in the plurality of scenarios 300 (step S23). This confirmation is performed by comparing the CLA byte and INS byte in the received first command with the command identification information 311 of the scenario 310.

ステップS23における確認の結果、受信したコマンドと一致するシナリオ310が存在しない場合、CPU101は処理終了として、カードリーダ・ライタ12に対し異常終了のレスポンスを送信する。   As a result of the confirmation in step S23, if there is no scenario 310 that matches the received command, the CPU 101 transmits an abnormal termination response to the card reader / writer 12 as the processing termination.

ステップS23における確認の結果、受信したコマンドと一致するシナリオ310が存在する場合、CPU101は、どのシナリオ310が一致したのかの履歴をワーキングメモリ103に保持する(ステップS24)。この場合のシナリオ310は1つあるいは複数個のシナリオ310となる。   As a result of the confirmation in step S23, if there is a scenario 310 that matches the received command, the CPU 101 holds a history of which scenario 310 matched in the working memory 103 (step S24). The scenario 310 in this case is one or a plurality of scenarios 310.

次に、CPU101は、受信したコマンドが書換えを指示する書換えコマンドであるか否かの確認を行なう(ステップS25)。この確認の結果、書込コマンドでない場合、CPU101は処理終了(各コマンド処理を実行)となる。   Next, the CPU 101 checks whether or not the received command is a rewrite command for instructing rewriting (step S25). If the result of this confirmation is that the command is not a write command, the CPU 101 terminates processing (executes each command processing).

ステップS25における確認の結果、書込みコマンドの場合、CPU101は、最終コマンドの実行時に書込むデータを保持するために、当該コマンド内の書込み対象データを含むコマンド情報をワーキングメモリ103内のバッファに格納(保持)する(ステップS6)。その後、CPU101は処理終了(各コマンド処理を実行)となる。   As a result of the confirmation in step S25, in the case of a write command, the CPU 101 stores command information including data to be written in the command in a buffer in the working memory 103 in order to hold data to be written when the final command is executed ( (Step S6). Thereafter, the CPU 101 ends the process (executes each command process).

ステップS22における確認の結果、受信したコマンドが第2コマンド以降である場合、CPU101は、前記ステップS23〜S24処理で候補となった1つあるいは複数のシナリオ310から、受信したコマンドと一致するものがあるか否かの確認を行なう(ステップS27)。この確認は、受信したコマンド内のCLAバイトおよびINSバイトとワーキングメモリ103に保持されている一致したシナリオ310のコマンド識別情報311とを比較することにより行なわれる。   As a result of the confirmation in step S22, when the received command is the second command or later, the CPU 101 matches the received command from one or a plurality of scenarios 310 that are candidates in the processing in steps S23 to S24. It is confirmed whether or not there is (step S27). This confirmation is performed by comparing the CLA byte and INS byte in the received command with the command identification information 311 of the matched scenario 310 held in the working memory 103.

ステップS27における確認の結果、受信したコマンドと一致するシナリオ310が存在しない場合、CPU101は処理終了として、カードリーダ・ライタ12に対し異常終了のレスポンスを送信する。   As a result of the confirmation in step S27, if there is no scenario 310 that matches the received command, the CPU 101 transmits an abnormal termination response to the card reader / writer 12 as the processing is terminated.

ステップS27における確認の結果、受信したコマンドと一致するシナリオ310が存在する場合、CPU101は、どのシナリオ310が一致したのかの履歴をワーキングメモリ103に保持する(ステップS28)。   As a result of the confirmation in step S27, when there is a scenario 310 that matches the received command, the CPU 101 holds a history of which scenario 310 matched in the working memory 103 (step S28).

次に、CPU101は、受信したコマンドが書換えを指示する書換えコマンドであるか否かの確認を行なう(ステップS29)。この確認の結果、書込みコマンドの場合、CPU101は、最終コマンドの実行時に書込むデータを保持するために、当該コマンド内の書込み対象データを含むコマンド情報をワーキングメモリ103内のバッファに格納し(ステップS30)、ステップS31に進む。
ステップS29における確認の結果、書込コマンドでない場合、CPU101は、ステップS30をジャンプしてステップS31に進む。
Next, the CPU 101 checks whether or not the received command is a rewrite command for instructing rewrite (step S29). As a result of this confirmation, in the case of a write command, the CPU 101 stores command information including data to be written in the command in a buffer in the working memory 103 in order to hold data to be written at the time of execution of the final command (step S30), the process proceeds to step S31.
If the result of the confirmation in step S29 is not a write command, the CPU 101 jumps to step S30 and proceeds to step S31.

ステップS31では、当該コマンドが書換え許可をされているか、すなわち、当該コマンドに対応する書換え指定情報312が書換え許可(「01」)に設定されているか否かの確認を行なう。この確認の結果、当該コマンドが書換え許可でない場合、CPU101は処理終了(各コマンド処理を実行)となる。   In step S31, it is confirmed whether or not the command is rewritten, that is, whether or not the rewrite designation information 312 corresponding to the command is set to rewrite permission ("01"). As a result of the confirmation, if the command is not permitted to be rewritten, the CPU 101 ends the process (executes each command process).

ステップS31における確認の結果、当該コマンドが書換え許可の場合、CPU101は、ワーキングメモリ103内のバッファに格納されているコマンド情報内の書込み対象データを、たとえばデータメモリ102の指定されたエリアに書込む処理を行なう(ステップS32)。その後、CPU101は処理終了(各コマンド処理を実行)となる。   As a result of the confirmation in step S31, when the command is permitted to be rewritten, the CPU 101 writes the data to be written in the command information stored in the buffer in the working memory 103, for example, in a specified area of the data memory 102. Processing is performed (step S32). Thereafter, the CPU 101 ends the process (executes each command process).

このように、上記第2の実施の形態によれば、外部から入力されるコマンドの実行順序を記載した複数のシナリオをあらかじめ記憶しておくとともに、複数のシナリオに登録されているコマンドで、当該コマンドの処理が正常に終了した際に当該コマンドにより要求されたデータの書換えをメモリに反映するか否かを指定する書換え指定情報をあらかじめ記憶しておき、外部から入力される最初のコマンドにより上記複数のシナリオの中から参照するべきシナリオを識別し、この識別されたシナリオを参照することにより当該シナリオの実行順序通りにコマンド処理を実行し、このコマンド処理が正常に実行された際、当該コマンドが上記書換え指定情報によりメモリに反映を許可されているか否かを判定し、許可されている場合は既に実行された複数のコマンドにより要求されたデータの書換えをメモリに対して実行することで、シナリオを柔軟に設定可能であり、かつ、不正シナリオの場合にはメモリの内容が更新されないようにすることが可能となる。   As described above, according to the second embodiment, a plurality of scenarios describing the execution order of commands input from the outside are stored in advance, and the commands registered in the plurality of scenarios are Rewrite designation information for designating whether or not the rewrite of data requested by the command is reflected in the memory when the command processing is normally completed is stored in advance. A scenario to be referred to is identified from a plurality of scenarios, command processing is executed in the execution order of the scenario by referring to the identified scenario, and when the command processing is executed normally, the command is executed. Determines whether or not reflection is permitted in the memory according to the above rewrite designation information. The scenario can be flexibly set by rewriting the data requested by multiple commands to the memory, and the contents of the memory are not updated in the case of an illegal scenario. It becomes possible.

なお、前記実施の形態では、携帯可能電子装置として接触式のICカードに適用した場合について説明したが、本発明はこれに限定されるものではなく、非接触式のICカードなどへの応用も可能であり、また、PDAと称される携帯端末装置や携帯電話機などであっても適用でき、さらに、携帯可能電子装置の形状もカード型に限らず、冊子型、ブロック型あるいはタグ型など、他の形状であってもよい。   In the above embodiment, the case where the present invention is applied to a contact type IC card as a portable electronic device has been described. However, the present invention is not limited to this and can be applied to a non-contact type IC card. It can also be applied to a portable terminal device or a mobile phone called PDA, and the shape of the portable electronic device is not limited to a card type, but a booklet type, a block type, a tag type, Other shapes may be used.

本発明の実施の形態に係るICカードを取扱うICカードシステムの構成例を示すブロック図。The block diagram which shows the structural example of the IC card system which handles the IC card which concerns on embodiment of this invention. ICカードの構成例を示すブロック図。The block diagram which shows the structural example of an IC card. 第1の実施の形態に係るコマンドの実行順序を記載した複数のシナリオの構成例を示す模式図。The schematic diagram which shows the structural example of the some scenario which described the execution order of the command which concerns on 1st Embodiment. 第2の実施の形態に係るコマンドの実行順序を記載した複数のシナリオの構成例を示す模式図。The schematic diagram which shows the structural example of the some scenario which described the execution order of the command which concerns on 2nd Embodiment. 第1の実施の形態に係るICカードの動作例について説明するフローチャート。The flowchart explaining the operation example of the IC card which concerns on 1st Embodiment. 第2の実施の形態に係るICカードの動作例について説明するフローチャート。The flowchart explaining the operation example of the IC card which concerns on 2nd Embodiment.

符号の説明Explanation of symbols

11…ICカード(携帯可能電子装置)、11a…ICカード本体、12…カードリーダ・ライタ、13…端末装置、15…CRT表示部、101…CPU(制御素子)、102…データメモリ(記憶手段、メモリ)、103…ワーキングメモリ、104…プログラムメモリ、105…コンタクト部、106…ICチップ、300…複数のシナリオ、310…個々のシナリオ、311…コマンド識別情報、312…書換え指定情報。   DESCRIPTION OF SYMBOLS 11 ... IC card (portable electronic device), 11a ... IC card main body, 12 ... Card reader / writer, 13 ... Terminal device, 15 ... CRT display part, 101 ... CPU (control element), 102 ... Data memory (storage means) , Memory), 103 ... working memory, 104 ... program memory, 105 ... contact part, 106 ... IC chip, 300 ... multiple scenarios, 310 ... individual scenarios, 311 ... command identification information, 312 ... rewrite designation information.

Claims (6)

データを記憶するメモリと、
外部から入力されるコマンドの実行順序を記載した複数のシナリオをあらかじめ記憶しているシナリオ記憶手段と、
外部から入力される最初のコマンドにより前記複数のシナリオの中から参照するべきシナリオを識別する参照シナリオ識別手段と、
この参照シナリオ識別手段により識別されたシナリオを参照することにより当該シナリオの実行順序通りにコマンド処理を実行する第1の処理手段と、
この第1の処理手段によるコマンド処理が正常に実行され、最終コマンドが正常に実行された際、既に実行された複数のコマンドにより要求されたデータの書換えを前記メモリに対して実行する第2の処理手段と、
を具備したことを特徴とする携帯可能電子装置。
A memory for storing data;
Scenario storage means for storing in advance a plurality of scenarios describing the execution order of commands input from the outside;
A reference scenario identifying means for identifying a scenario to be referred to from among the plurality of scenarios by a first command input from the outside;
First processing means for executing command processing in the execution order of the scenario by referring to the scenario identified by the reference scenario identifying means;
When the command processing by the first processing means is normally executed and the final command is normally executed, data rewriting requested by a plurality of already executed commands is executed on the memory. Processing means;
A portable electronic device comprising:
データを記憶するメモリと、
外部から入力されるコマンドの実行順序を記載した複数のシナリオをあらかじめ記憶しているシナリオ記憶手段と、
前記複数のシナリオに登録されているコマンドで、当該コマンドの処理が正常に終了した際に当該コマンドにより要求されたデータの書換えを前記メモリに反映するか否かを指定する書換え指定情報をあらかじめ記憶している書換え指定情報記憶手段と、
外部から入力される最初のコマンドにより前記複数のシナリオの中から参照するべきシナリオを識別する参照シナリオ識別手段と、
この参照シナリオ識別手段により識別されたシナリオを参照することにより当該シナリオの実行順序通りにコマンド処理を実行する第1の処理手段と、
この第1の処理手段によるコマンド処理が正常に実行された際、当該コマンドが前記書換え指定情報により前記メモリに反映を許可されているか否かを判定し、許可されている場合は既に実行された複数のコマンドにより要求されたデータの書換えを前記メモリに対して実行する第3の処理手段と、
を具備したことを特徴とする携帯可能電子装置。
A memory for storing data;
Scenario storage means for storing in advance a plurality of scenarios describing the execution order of commands input from the outside;
Rewrite specification information for specifying whether or not the rewrite of data requested by the command is reflected in the memory when the command processing is normally completed for the commands registered in the plurality of scenarios is stored in advance. Rewriting designation information storage means,
A reference scenario identifying means for identifying a scenario to be referred to from among the plurality of scenarios by a first command input from the outside;
First processing means for executing command processing in the execution order of the scenario by referring to the scenario identified by the reference scenario identifying means;
When the command processing by the first processing means is normally executed, it is determined whether or not the command is permitted to be reflected in the memory according to the rewrite designation information. Third processing means for rewriting data requested by a plurality of commands to the memory;
A portable electronic device comprising:
前記シナリオ記憶手段に記憶されている複数のシナリオは、認証が成立したことを条件に、外部から入力される特定のコマンドにより書き換えることが可能なことを特徴とする請求項1または請求項2記載の携帯可能電子装置。   3. The plurality of scenarios stored in the scenario storage means can be rewritten by a specific command input from the outside on the condition that authentication is established. Portable electronic device. データを記憶するメモリと、外部から入力されるコマンドの実行順序を記載した複数のシナリオをあらかじめ記憶しているシナリオ記憶手段と、外部から入力される最初のコマンドにより前記複数のシナリオの中から参照するべきシナリオを識別する参照シナリオ識別手段と、この参照シナリオ識別手段により識別されたシナリオを参照することにより当該シナリオの実行順序通りにコマンド処理を実行する第1の処理手段と、この第1の処理手段によるコマンド処理が正常に実行され、最終コマンドが正常に実行された際、既に実行された複数のコマンドにより要求されたデータの書換えを前記メモリに対して実行する第2の処理手段とを有して構成されるICモジュールと、
このICモジュールを収納したICカード本体と、
を具備したことを特徴とするICカード。
Memory for storing data, scenario storage means for storing in advance a plurality of scenarios describing the execution order of commands input from the outside, and reference from among the plurality of scenarios by the first command input from the outside A reference scenario identifying means for identifying a scenario to be performed, a first processing means for executing command processing in accordance with the execution order of the scenario by referring to the scenario identified by the reference scenario identifying means, and the first Second processing means for executing, on the memory, rewriting of data requested by a plurality of commands already executed when the command processing by the processing means is normally executed and the final command is normally executed; An IC module comprising:
An IC card body containing the IC module;
An IC card comprising:
データを記憶するメモリと、外部から入力されるコマンドの実行順序を記載した複数のシナリオをあらかじめ記憶しているシナリオ記憶手段と、前記複数のシナリオに登録されているコマンドで、当該コマンドの処理が正常に終了した際に当該コマンドにより要求されたデータの書換えを前記メモリに反映するか否かを指定する書換え指定情報をあらかじめ記憶している書換え指定情報記憶手段と、外部から入力される最初のコマンドにより前記複数のシナリオの中から参照するべきシナリオを識別する参照シナリオ識別手段と、この参照シナリオ識別手段により識別されたシナリオを参照することにより当該シナリオの実行順序通りにコマンド処理を実行する第1の処理手段と、この第1の処理手段によるコマンド処理が正常に実行された際、当該コマンドが前記書換え指定情報により前記メモリに反映を許可されているか否かを判定し、許可されている場合は既に実行された複数のコマンドにより要求されたデータの書換えを前記メモリに対して実行する第3の処理手段とを有して構成されるICモジュールと、
このICモジュールを収納したICカード本体と、
を具備したことを特徴とするICカード。
A memory for storing data, scenario storage means for storing a plurality of scenarios describing the execution order of commands input from the outside, and commands registered in the plurality of scenarios. Rewrite designation information storage means for storing in advance rewrite designation information for designating whether or not the rewrite of data requested by the command is reflected in the memory when it is normally completed, and the first input from the outside A reference scenario identifying means for identifying a scenario to be referred to from among the plurality of scenarios by a command, and executing command processing in accordance with the execution order of the scenario by referring to the scenario identified by the reference scenario identifying means. 1 processing means and the command processing by this first processing means was executed normally Determining whether or not the command is permitted to be reflected in the memory according to the rewrite designation information, and if permitted, rewriting data requested by a plurality of commands already executed to the memory. An IC module configured to have third processing means to execute;
An IC card body containing the IC module;
An IC card comprising:
前記シナリオ記憶手段に記憶されている複数のシナリオは、認証が成立したことを条件に、外部から入力される特定のコマンドにより書き換えることが可能なことを特徴とする請求項4または請求項5記載のICカード。   6. The plurality of scenarios stored in the scenario storage means can be rewritten by a specific command input from the outside on the condition that the authentication is established. IC card.
JP2006224317A 2006-08-21 2006-08-21 Portable electronic device and IC card Expired - Fee Related JP4836707B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006224317A JP4836707B2 (en) 2006-08-21 2006-08-21 Portable electronic device and IC card

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006224317A JP4836707B2 (en) 2006-08-21 2006-08-21 Portable electronic device and IC card

Publications (2)

Publication Number Publication Date
JP2008047040A JP2008047040A (en) 2008-02-28
JP4836707B2 true JP4836707B2 (en) 2011-12-14

Family

ID=39180687

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006224317A Expired - Fee Related JP4836707B2 (en) 2006-08-21 2006-08-21 Portable electronic device and IC card

Country Status (1)

Country Link
JP (1) JP4836707B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3023904B1 (en) * 2014-11-24 2021-01-27 IDEMIA France Implicit File creation in APDU scripts
CN108172443B (en) * 2018-02-11 2023-07-07 山东比特智能科技股份有限公司 Method, equipment and system for card insertion and power taking based on house card type identification

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11282991A (en) * 1998-03-30 1999-10-15 Dainippon Printing Co Ltd Ic card
JP2005266952A (en) * 2004-03-16 2005-09-29 Toshiba Corp Memory card control device, semiconductor memory card, card interface controller, and authentication method for semiconductor memory card

Also Published As

Publication number Publication date
JP2008047040A (en) 2008-02-28

Similar Documents

Publication Publication Date Title
US9183400B2 (en) IC card and IC card control method
US20120067947A1 (en) Ic card, mobile electronic device and data processing method in ic card
JP2008243045A (en) Portable electronic apparatus and ic card
JP4836707B2 (en) Portable electronic device and IC card
EP2128803A1 (en) Information storage medium and medium processing system
JP4868979B2 (en) Portable electronic device and IC card
JP2006293706A (en) Multi-application ic card with application updating function
US7346730B2 (en) Mobile electronic device
JP2003099740A (en) Portable electronic equipment and method of outputting initial response
JP4950730B2 (en) Portable electronic device, file access method and IC card in portable electronic device
JP4713878B2 (en) Portable electronic device
US8870079B2 (en) IC card, portable electronic device, IC card issuing apparatus, and command execution method
JP7005934B2 (en) Electronic information storage medium, IC card, data transmission method, data writing method, data transmission program and data writing program
JP7468757B1 (en) ELECTRONIC INFORMATION STORAGE MEDIUM, IC CHIP, IC CARD, RESPONSE TRANSMISSION METHOD, AND PROGRAM
JP4784138B2 (en) IC card and IC card program
JP2006268779A (en) Portable electronic device
JP6984328B2 (en) Electronic information storage medium, IC card, external device, data writing method and data writing program
JP7420179B1 (en) Electronic information storage medium, IC card, issuance processing method, and program
JP2004334745A (en) Ic card
JP4533665B2 (en) Portable electronic device
JP2008299416A (en) Portable electronic device, file access method in portable electronic device, and ic card
JP4734838B2 (en) Information recording medium, program, and command execution control method
JP5085055B2 (en) IC card and IC module
JP5728323B2 (en) IC card and portable electronic device
JP5075404B2 (en) Portable electronic device, file access method and IC card in portable electronic device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20090319

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20110728

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: 20110906

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20110927

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20141007

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20141007

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees