JP6904286B2 - Electronic information storage medium and IC card - Google Patents
Electronic information storage medium and IC card Download PDFInfo
- Publication number
- JP6904286B2 JP6904286B2 JP2018045654A JP2018045654A JP6904286B2 JP 6904286 B2 JP6904286 B2 JP 6904286B2 JP 2018045654 A JP2018045654 A JP 2018045654A JP 2018045654 A JP2018045654 A JP 2018045654A JP 6904286 B2 JP6904286 B2 JP 6904286B2
- Authority
- JP
- Japan
- Prior art keywords
- command
- cpu
- issue
- storage medium
- data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Landscapes
- Techniques For Improving Reliability Of Storages (AREA)
- Storage Device Security (AREA)
Description
IC(Integrated Circuit)チップ等の電子情報記憶媒体の技術分野に関する。 The present invention relates to a technical field of an electronic information storage medium such as an IC (Integrated Circuit) chip.
ICカード等に搭載されるICチップといった電子情報記憶媒体は、CPU、RAM、不揮発性メモリ等を備えている。電子情報記憶媒体のCPUは、カード発行機やリーダ・ライタなど、外部からコマンドを受信すると、当該コマンドに応じた処理を実行し、実行結果に関するSW(Status Word)をレスポンスとして送信する。そのため、電子情報記憶媒体の不揮発性メモリは、コマンドに応じた一連の処理をCPUが実行するための処理が記述されたプログラム(以下、「コマンド実行用プログラム」という場合がある)を記憶している。 An electronic information storage medium such as an IC chip mounted on an IC card or the like includes a CPU, RAM, a non-volatile memory, and the like. When the CPU of the electronic information storage medium receives a command from the outside such as a card issuing machine or a reader / writer, it executes a process according to the command and transmits a SW (Status Word) related to the execution result as a response. Therefore, the non-volatile memory of the electronic information storage medium stores a program (hereinafter, may be referred to as a "command execution program") in which a process for executing a series of processes according to a command by the CPU is described. There is.
電子情報記憶媒体に対して送信されるコマンドには複数の種類があり、例えば、特許文献1に記載されているように、検査コマンドや発行コマンドといった、電子情報記憶媒体の検査時や、電子情報記憶媒体の発行前にのみ使用されるコマンド(以下、「発行前コマンド」という場合がある)が含まれている。
There are a plurality of types of commands transmitted to the electronic information storage medium. For example, as described in
しかしながら、発行前コマンドについては、発行後(すなわち、製品出荷後の運用中)に使用されることがないため、発行前コマンドに対応するプログラムは、不揮発性メモリから削除されることなく、不揮発性メモリの記憶領域を無駄に使用したままとなる。 However, since the pre-issue command is not used after it is issued (that is, during operation after the product is shipped), the program corresponding to the pre-issue command is non-volatile without being deleted from the non-volatile memory. The memory storage area remains wasted.
一方で、発行前コマンドと、電子情報記憶媒体の発行後(電子情報記憶媒体の運用中)にのみ使用されるコマンド(以下、「発行後コマンド」という場合がある)とには、コマンド受信時に実行されるプログラムに含まれる一部の処理が共通するコマンドがある。 On the other hand, the pre-issue command and the command used only after the electronic information storage medium is issued (during the operation of the electronic information storage medium) (hereinafter, may be referred to as "post-issue command") are when the command is received. There is a command that has some common processing included in the executed program.
そこで、本発明は、発行前コマンドと発行後コマンドについて、コマンド受信時に実行されるプログラムを統合して共用化することにより、当該プログラムを記憶する記憶領域を節約することができる電子情報記憶媒体等を提供することを課題とする。 Therefore, the present invention relates to an electronic information storage medium or the like that can save a storage area for storing a pre-issue command and a post-issue command by integrating and sharing a program executed at the time of command reception. The challenge is to provide.
上記課題を解決するために、請求項1に記載の発明は、コマンドに対応するプログラムを記憶する記憶部と、外部から受信した前記コマンドに対応する前記プログラムを実行する実行部と、を備える電子情報記憶媒体であって、複数種類の前記コマンドには、前記電子情報記憶媒体の発行の前に受信する前記コマンドである発行前コマンド、及び、前記発行の後に受信するコマンドである発行後コマンドが含まれ、前記記憶部は、複数種類の前記コマンドのうち、前記電子情報記憶媒体に対して共通の処理を実行させる前記発行前コマンドと前記発行後コマンドからなる組に対応する所定のプログラムと、前記電子情報記憶媒体が発行前か発行後かを示す発行情報と、を記憶し、前記所定のプログラムは、前記組を構成する前記発行前コマンドを受信した場合と前記組を構成する前記発行後コマンドを受信した場合の双方で実行される前記共通の処理と、前記発行情報が前記発行前を示している場合に実行される処理であって、前記組を構成する前記発行前コマンドに応じて実行される処理と、前記発行情報が前記発行後を示している場合に実行される処理であって、前記組を構成する前記発行後コマンドに応じて実行される処理と、を含むことを特徴とする。
In order to solve the above problems, the invention according to
請求項2に記載の発明は、請求項1に記載の電子情報記憶媒体であって、前記組を構成する前記発行前コマンドのCLA部と前記組を構成する前記発行後コマンドのCLA部、及び、前記組を構成する前記発行前コマンドのINS部と前記組を構成する前記発行後コマンドのINS部にはそれぞれ共通の値が設定され、前記所定のプログラムは、前記組を構成する前記発行前コマンドのCLA部と前記組を構成する前記発行後コマンドのCLA部に設定された値について共通に実行される処理、及び、前記組を構成する前記発行前コマンドのINS部と前記組を構成する前記発行後コマンドのINS部に設定された値について共通に実行される処理と、を含むことを特徴とする。
The invention according to claim 2 is the electronic information storage medium according to
請求項3に記載の発明は、請求項1に記載の電子情報記憶媒体であって、前記組を構成する前記発行前コマンドのCLA部と前記組を構成する前記発行後コマンドのCLA部、又は、前記組を構成する前記発行前コマンドのINS部と前記組を構成する前記発行後コマンドのINS部の少なくとも何れか一方は異なる値が設定され、前記所定のプログラムは、前記組を構成する前記発行前コマンドを受信した場合と前記組を構成する前記発行後コマンドを受信した場合の双方で、前記記憶部に対して共通に実行される処理を含むことを特徴とする。
The invention according to claim 3 is the electronic information storage medium according to
請求項4に記載の発明は、請求項3に記載の電子情報記憶媒体であって、前記記憶部に対して共通に実行される処理は、前記記憶部にデータを書き込む処理、又は、前記記憶部のデータを読み出す処理であることを特徴とする。 The invention according to claim 4 is the electronic information storage medium according to claim 3, and the process commonly executed for the storage unit is a process for writing data to the storage unit or the storage unit. It is characterized in that it is a process of reading the data of a part.
請求項5に記載の発明は、請求項4に記載の電子情報記憶媒体であって、前記記憶部に対して共通に実行される処理は、前記組を構成する前記発行前コマンド及び前記組を構成する前記発行後コマンドにおけるData部に設定されているデータを前記記憶部に書き込む処理であることを特徴とする。
The invention according to claim 5 is the electronic information storage medium according to claim 4, and the processing commonly executed for the storage unit is the pre-issuance command and the set that constitute the set. It is characterized in that it is a process of writing the data set in the Data unit in the constituent post-issue command to the storage unit.
請求項6に記載の発明は、請求項1乃至5の何れか一項に記載の電子情報記憶媒体を備えるICカードである。
The invention according to claim 6 is an IC card including the electronic information storage medium according to any one of
本発明によれば、記憶部が、発行前コマンド及び発行後コマンドの双方に対応する所定のプログラムであって、発行前コマンドを受信した場合と発行後コマンドを受信した場合の双方で、共通に実行される処理を含む所定のプログラムを記憶し、実行部が、発行前コマンド及び発行後コマンドを受信した場合に所定のプログラムを実行する。すなわち、発行前コマンドと発行後コマンドについて、コマンド受信時に実行されるプログラムを統合して共用化することにより、当該プログラムを記憶する記憶領域を節約することができる。 According to the present invention, the storage unit is a predetermined program corresponding to both the pre-issue command and the post-issue command, and is common to both the case where the pre-issue command is received and the case where the post-issue command is received. A predetermined program including a process to be executed is stored, and when the execution unit receives a pre-issue command and a post-issue command, the predetermined program is executed. That is, the storage area for storing the pre-issue command and the post-issue command can be saved by integrating and sharing the program executed when the command is received.
以下、図面を参照して本発明の実施形態について詳細に説明する。以下に説明する実施形態は、ICチップ並びにICチップを搭載するICカードに対して本発明を適用した場合の実施の形態である。 Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. The embodiment described below is an embodiment when the present invention is applied to an IC chip and an IC card on which the IC chip is mounted.
[1.ICチップ1aの構成]
まず、図1を参照して、ICカード1に搭載されるICチップ1aの構成について説明する。図1は、ICカード1に搭載されるICチップ1aのハードウェア構成例を示す図である。本実施形態のICカード1は、接触によるデータ通信と非接触によるデータ通信の2つの通信機能を兼ね備えたデュアルインターフェース型ICカードである。但し、ICカード1の種類はデュアルインターフェース型ICカードに限定されず、キャッシュカードやクレジットカードと同じ大きさのプラスチック製カードにICチップ1aがエンベットされた接触型ICカードであってもよいし、また、アンテナコイルを内蔵し無線でリーダ・ライタとデータ通信する非接触型ICカードであってもよい。
[1. Configuration of IC chip 1a]
First, the configuration of the IC chip 1a mounted on the
図1に示すように、ICチップ1aは、CPU(Central Processing Unit)10、RAM(Random Access Memory)11、ROM(Read Only Memory)12、不揮発性メモリ13、及びI/O回路14を備えて構成される。CPU10は、ROM12又は不揮発性メモリ13に記憶された各種プログラムを実行するプロセッサ(コンピュータ)である。なお、I/O回路14は、外部機器2とのインターフェイスを担う。これにより、ICチップ1aは、リーダ・ライタを備える外部機器2との間で接触又は非接触で通信を行うことができる。接触式のICチップ1aの場合、I/O回路14には、例えば、C1〜C8の8個の端子が備えられている。例えば、C1端子は電源端子(ICチップ1aへ電源供給する端子)、C2端子はリセット端子、C3端子はクロック端子、C5端子はグランド端子、C7端子は外部機器2との間で通信を行うための端子である。一方、非接触式のICチップ1aの場合、I/O回路14には、例えば、アンテナ、及び変復調回路が備えられている。なお、外部機器2の例としては、ICカード発行機やサーバ装置が挙げられる。
As shown in FIG. 1, the IC chip 1a includes a CPU (Central Processing Unit) 10, a RAM (Random Access Memory) 11, a ROM (Read Only Memory) 12, a
不揮発性メモリ13には、例えばフラッシュメモリ又は「Electrically Erasable Programmable Read-Only Memory」などで構成され、OS及び各種アプリケーションや、これらが使用するデータを記憶する。なお、OSについては、その一部を不揮発性メモリ13が記憶し、その他の部分をROM12が記憶することとしてもよい。また、不揮発性メモリ13には、外部機器2からコマンドを受信した場合に、OSが当該コマンドに応じた処理を実行し、実行結果に関するSWをレスポンスとして送信するための処理を含むコマンド実行用プログラムが記憶されている。
The
[2.コマンドの種類]
CPU10は、外部機器2からコマンドを受信すると当該コマンドに応じたコマンド実行用プログラムを実行し、SWを応答として外部機器2に送信する。従来、コマンドには発行前コマンドと発行後コマンドがあり、発行前コマンドと発行後コマンドとで類似するコマンドがある。それらはそれぞれに対応するコマンド実行用プログラムに含まれる処理の一部が共通する。ここで、図2を用いて、それらの一例について説明する。
[2. Command type]
When the
図2に示すように、発行者を認証するための発行前コマンドであるVERIFY(IS)コマンドと、ユーザを認証するための発行後コマンドであるVERIFY(USR)コマンドは、それぞれ対応するコマンド実行用プログラムに含まれる一部の処理が共通する。また、不揮発性メモリ13へデータを書き込むための発行前コマンドであるSTORE DATAコマンドと、ファイルへデータを書き込むための発行後コマンドであるWRITE BINARYコマンドは、それぞれ対応するコマンド実行用プログラムに含まれる一部の処理が共通する。更に、正しくデータが書き込まれていることを確認することを目的としてデータを読み出すための発行前コマンドであるREAD DATAコマンドと、ファイルのデータを読み出すための発行後コマンドであるREAD BINARYコマンドは、それぞれ対応するコマンド実行用プログラムに含まれる一部の処理が共通する。
As shown in FIG. 2, the VERIFY (IS) command, which is a pre-issue command for authenticating the issuer, and the VERIFY (USR) command, which is a post-issue command for authenticating the user, are for executing the corresponding commands. Some processes included in the program are common. Further, the STORE DATA command, which is a pre-issuance command for writing data to the
[2.1.VERIFY(IS)コマンドとVERIFY(USR)コマンド]
[2.1.1.コマンドフォーマット]
次に、図3を用いて、VERIFY(IS)コマンドと、VERIFY(USR)コマンドのコマンドフォーマットについて説明する。なお、図3はVERIFY(IS)コマンドと、VERIFY(USR)コマンドのコマンドフォーマットの一例を示す図である。図3に示すように、VERIFY(IS)コマンドと、VERIFY(USR)コマンドのコマンドフォーマットは共通である。すなわち、何れのコマンドも、CLA部には「00h(固定)」、INS部には「10h(固定)」、P1部には「00h(固定)」、P2部には「00h(固定)」、Lc部には「01h」〜「10h」が設定され、Data部には認証に用いるPIN(VERIFY(IS)コマンドであれば発行者PIN(Personal Identification Number)、VERIFY(USR)コマンドであればユーザPIN)がそれぞれ設定される。
[2.1. VERIFY (IS) command and VERIFY (USR) command]
[2.1.1. Command format]
Next, the command formats of the VERIFY (IS) command and the VERIFY (USR) command will be described with reference to FIG. Note that FIG. 3 is a diagram showing an example of the command formats of the VERIFY (IS) command and the VERIFY (USR) command. As shown in FIG. 3, the command formats of the VERIFY (IS) command and the VERIFY (USR) command are common. That is, each command is "00h (fixed)" for the CLA part, "10h (fixed)" for the INS part, "00h (fixed)" for the P1 part, and "00h (fixed)" for the P2 part. , "01h" to "10h" are set in the Lc part, and the PIN (Personal Identification Number for VERIFY (IS) command is the issuer PIN (Personal Identification Number) for the Data part, and the VERIFY (USR) command is used for the Data part. User PIN) is set respectively.
[2.1.2.従来の処理フロー]
[2.1.2.1.VERIFY(IS)コマンド受信時]
次に、図4を用いて、VERIFY(IS)コマンドと、VERIFY(USR)コマンドを受信した場合に実行される従来のコマンド実行用プログラムの処理例について説明する。なお、図4(A)は、VERIFY(IS)コマンドに対応するコマンド実行用プログラムの従来処理例を示すフローチャートであり、図4(B)は、VERIFY(USR)コマンドに対応するコマンド実行用プログラムの従来処理例を示すフローチャートである。
[2.1.2. Conventional processing flow]
[2.1.2.1. When receiving a VERIFY (IS) command]
Next, a processing example of a VERIFY (IS) command and a conventional command execution program executed when a VERIFY (USR) command is received will be described with reference to FIG. Note that FIG. 4A is a flowchart showing a conventional processing example of a command execution program corresponding to the VERIFY (IS) command, and FIG. 4B is a command execution program corresponding to the VERIFY (USR) command. It is a flowchart which shows the conventional processing example of.
図4(A)に示すように、VERIFY(IS)コマンドを受信したICチップ1aのCPU10は、まず、CLA部にセットされている値をチェックする(ステップS101)。例えば、図3に示すコマンドフォーマットであれば「00h」がセットされているかをチェックする。
As shown in FIG. 4A, the
次いで、CPU10は、INS部にセットされている値をチェックする(ステップS102)。例えば、図3に示すコマンドフォーマットであれば「10h」がセットされているかをチェックする。
Next, the
次いで、Lc部にセットされている値とData部の長さとで整合性がとれているかチェックする(ステップS103)。 Next, it is checked whether the value set in the Lc portion and the length of the Data portion are consistent (step S103).
なお、図示しないが、CPU10は、ステップS101〜ステップS103の処理におけるチェックの結果、正常でないと判定した場合には、コマンドの送信元に異常を示すSW(「異常SW」)による応答をし(ステップS108)、当該フローチャートに示す処理を終了する。
Although not shown, when the
次に、CPU10は、Data部に設定されている発行者のPINに基づく認証を行う(ステップS104)。次いで、CPU10は、認証結果が一致か否かを判定する(ステップS105)。
Next, the
CPU10は、認証結果が一致であると判定した場合には(ステップS105:YES)、認証結果として発行者認証済みを設定し(ステップS106)、コマンドの送信元に正常を示すSW(「正常SW」)による応答をし(ステップS107)、当該フローチャートに示す処理を終了する。一方、CPU10は、認証結果が一致でないと判定した場合には(ステップS105:NO)、コマンドの送信元に異常SWによる応答をし(ステップS108)、当該フローチャートに示す処理を終了する。
When the
[2.1.2.2.VERIFY(USR)コマンド受信時]
一方、図4(B)に示すように、VERIFY(USR)コマンドを受信したICチップ1aのCPU10は、まず、CLA部にセットされている値をチェックする(ステップS111)。例えば、図3に示すコマンドフォーマットであれば「00h」がセットされているかをチェックする。
[2.1.2.2. When receiving a VERIFY (USR) command]
On the other hand, as shown in FIG. 4B, the
次いで、CPU10は、INS部にセットされている値をチェックする(ステップS112)。例えば、図3に示すコマンドフォーマットであれば「10h」がセットされているかをチェックする。
Next, the
次いで、Lc部にセットされている値とData部の長さとで整合性がとれているかチェックする(ステップS113)。 Next, it is checked whether the value set in the Lc portion and the length of the Data portion are consistent (step S113).
このように、ステップS111〜ステップS113の処理は、図4(A)のステップS101〜ステップS103の処理と同一の処理である。 As described above, the processes of steps S111 to S113 are the same as the processes of steps S101 to S103 of FIG. 4 (A).
次に、CPU10は、Data部に設定されているユーザのPINに基づく認証を行う(ステップS114)。次いで、CPU10は、認証結果が一致か否かを判定する(ステップS115)。
Next, the
CPU10は、認証結果が一致であると判定した場合には(ステップS115:YES)、認証結果としてユーザ認証済みを設定し(ステップS116)、コマンドの送信元に正常SWによる応答をし(ステップS117)、当該フローチャートに示す処理を終了する。一方、CPU10は、認証結果が一致でないと判定した場合には(ステップS115:NO)、コマンドの送信元に異常SWによる応答をし(ステップS118)、当該フローチャートに示す処理を終了する。
When the
このように、VERIFY(IS)コマンドと、VERIFY(USR)コマンドを受信した場合の従来の処理例を比較すると、ステップS101〜ステップS103(ステップS111〜ステップS113)の処理が共通する。これは、VERIFY(IS)コマンドと、VERIFY(USR)コマンドのコマンドフォーマットが共通することに基づく。そこで、本実施形態では、VERIFY(IS)コマンドに対応するコマンド実行用プログラムと、VERIFY(USR)コマンドに対応するコマンド実行用プログラムを共通化したコマンド実行用プログラムを作成して記憶させ、従来のVERIFY(IS)コマンドに対応するコマンド実行用プログラムと、VERIFY(USR)コマンドに対応するコマンド実行用プログラムを記憶させないことにより不揮発性メモリ13の記憶領域を節約する。
As described above, comparing the conventional processing examples when the VERIFY (IS) command and the VERIFY (USR) command are received, the processing of steps S101 to S103 (steps S111 to S113) is common. This is based on the fact that the VERIFY (IS) command and the VERIFY (USR) command have a common command format. Therefore, in the present embodiment, a command execution program in which a command execution program corresponding to the VERIFY (IS) command and a command execution program corresponding to the VERIFY (USR) command are shared is created and stored, and is stored in the conventional command execution program. The storage area of the
[2.1.3.本実施形態の処理フロー]
以下、図5を用いて、共通化したコマンド実行用プログラムによる処理例について説明する。なお、図5は、VERIFY(IS)コマンド及びVERIFY(USR)コマンドに対応するコマンド実行用プログラムの処理例を示すフローチャートである。
[2.1.3. Processing flow of this embodiment]
Hereinafter, a processing example by the common command execution program will be described with reference to FIG. Note that FIG. 5 is a flowchart showing a processing example of a command execution program corresponding to the VERIFY (IS) command and the VERIFY (USR) command.
図5に示すように、ICチップ1aのCPU10は、まず、CLA部にセットされている値をチェックする(ステップS121)。例えば、図3に示すコマンドフォーマットであれば「00h」がセットされているかをチェックする。
As shown in FIG. 5, the
次いで、CPU10は、INS部にセットされている値をチェックする(ステップS122)。例えば、図3に示すコマンドフォーマットであれば「10h」がセットされているかをチェックする。
Next, the
次いで、Lc部にセットされている値とDataの長さとで整合性がとれているかチェックする(ステップS123)。なお、図示しないが、CPU10は、ステップS121〜ステップS123の処理におけるチェックの結果、正常でないと判定した場合には、コマンドの送信元に異常SWによる応答をし(ステップS129)、当該フローチャートに示す処理を終了する。
Next, it is checked whether the value set in the Lc portion and the length of Data are consistent (step S123). Although not shown, if the
このように、ステップS121〜ステップS123の処理は、図4(A)のステップS101〜ステップS103(図4(B)のステップS111〜ステップS113)の処理と同一の処理である。 As described above, the processes of steps S121 to S123 are the same as the processes of steps S101 to S103 of FIG. 4 (A) (steps S111 to S113 of FIG. 4 (B)).
次に、CPU10は、発行フラグがオンであるか否かを判定する(ステップS124)。発行フラグは、ICカード1の発行前の状態であれば「オン」が設定され、ICカード1の発行後の状態であれば「オフ」が設定される。CPU10は、発行フラグがオンである(発行前である)と判定した場合には(ステップS124:YES)、Data部に設定されている発行者のPINに基づく認証を行う(ステップS125)。次いで、CPU10は、認証結果が一致か否かを判定する(ステップS126)。
Next, the
CPU10は、認証結果が一致であると判定した場合には(ステップS126:YES)、認証結果として発行者認証済みを設定し(ステップS127)、コマンドの送信元に正常SWによる応答をし(ステップS128)、当該フローチャートに示す処理を終了する。一方、CPU10は、認証結果が一致でないと判定した場合には(ステップS126:NO)、コマンドの送信元に異常SWによる応答をし(ステップS129)、当該フローチャートに示す処理を終了する。
When the
一方、CPU10は、発行フラグがオンでない(発行後である)と判定した場合には(ステップS124:NO)、Data部に設定されているユーザのPINに基づく認証を行う(ステップS130)。次いで、CPU10は、認証結果が一致か否かを判定する(ステップS131)。
On the other hand, when the
CPU10は、認証結果が一致であると判定した場合には(ステップS131:YES)、認証結果としてユーザ認証済みを設定し(ステップS132)、コマンドの送信元に正常SWによる応答をし(ステップS133)、当該フローチャートに示す処理を終了する。一方、CPU10は、認証結果が一致でないと判定した場合には(ステップS131:NO)、コマンドの送信元に異常SWによる応答をし(ステップS129)、当該フローチャートに示す処理を終了する。
When the
[2.2.STORE DATAコマンドとWRITE BINARYコマンド]
[2.2.1.コマンドフォーマット]
次に、図6を用いて、STORE DATAコマンドと、WRITE BINARYコマンドのコマンドフォーマットについて説明する。なお、図6(A)はSTORE DATAコマンドのコマンドフォーマットの一例を示す図であり、図6(B)はWRITE BINARYコマンドのコマンドフォーマットの一例を示す図である。図6(A)に示すように、STORE DATAコマンドのコマンドフォーマットは、CLA部には「00h(固定)」、INS部には「20h(固定)」、P1部には「00h(固定)」、P2部には「00h(固定)」、Lc部にはData部の長さが設定され、Data部にはデータの書き込み先である不揮発性メモリ13上のアドレス(4バイト)と、書き込むデータ(任意のデータ長)が設定される。
[2.2. STORE DATA command and WRITE BINARY command]
[2.2.1. Command format]
Next, the command formats of the STORE DATA command and the WRITE BINARY command will be described with reference to FIG. Note that FIG. 6A is a diagram showing an example of the command format of the STORE DATA command, and FIG. 6B is a diagram showing an example of the command format of the WRITE BINARY command. As shown in FIG. 6A, the command format of the STORE DATA command is "00h (fixed)" for the CLA part, "20h (fixed)" for the INS part, and "00h (fixed)" for the P1 part. , "00h (fixed)" is set in the P2 section, the length of the Data section is set in the Lc section, and the address (4 bytes) on the
一方、図6(B)に示すように、WRITE BINARYコマンドのコマンドフォーマットは、CLA部には「00h(固定)」、INS部には「30h(固定)」、P1部には「FID(File identifier)」、P2部には「FID」、Lc部にはData部の長さが設定され、Data部には書き込むデータ(任意のデータ長)が設定される。なお、P1部とP2部に設定されるFIDは、データの書き込み先である不揮発性メモリ13上のファイルを示す。
On the other hand, as shown in FIG. 6B, the command format of the WRITE BINARY command is "00h (fixed)" for the CLA part, "30h (fixed)" for the INS part, and "FID (File)" for the P1 part. "Identifier)", "FID" is set in the P2 part, the length of the Data part is set in the Lc part, and the data to be written (arbitrary data length) is set in the Data part. The FIDs set in the P1 part and the P2 part indicate a file on the
すなわち、STORE DATAコマンドには、データの書き込み先であるアドレスが設定されているため、CPU10は、当該アドレスの示す記憶領域にデータを直接書き込むことができる。一方、WRITE BINARYコマンドには、データの書き込み先であるファイルが設定されているため、CPU10は、当該ファイルに基づいてデータの書き込み先であるアドレスを特定してから、当該特定したアドレスの示す記憶領域にデータを書き込む必要がある。その一方で、STORE DATAコマンドもWRITE BINARYコマンドも、データの書き込み先が確定すると、その後はデータを書き込む点で共通する。
That is, since the address to which the data is written is set in the STORE DATA command, the
なお、図6の例では、STORE DATAコマンドとWRITE BINARYコマンドにおけるCLA部に共通して「00h」が設定されるが、異なる値が設定されることとしてもよい。この場合、STORE DATAコマンドとWRITE BINARYコマンドのINS部に共通の値が設定されることとしてもよい。 In the example of FIG. 6, "00h" is set in common for the CLA part in the STORE DATA command and the WRITE BINARY command, but different values may be set. In this case, a common value may be set in the INS part of the STORE DATA command and the WRITE BINARY command.
[2.2.2.従来の処理フロー]
[2.2.2.1.STORE DATAコマンド受信時]
次に、図7を用いて、STORE DATAコマンドと、WRITE BINARYコマンドを受信した場合に実行される従来のコマンド実行用プログラムの処理例について説明する。なお、図7(A)は、STORE DATAコマンドに対応するコマンド実行用プログラムの従来処理例を示すフローチャートであり、図7(B)は、WRITE BINARYに対応するコマンド実行用プログラムの従来処理例を示すフローチャートである。
[2.2.2. Conventional processing flow]
[2.2.2.1. When receiving STORE DATA command]
Next, a processing example of a conventional command execution program executed when a STORE DATA command and a WRITE BINARY command are received will be described with reference to FIG. 7. Note that FIG. 7 (A) is a flowchart showing a conventional processing example of a command execution program corresponding to the STORE DATA command, and FIG. 7 (B) is a conventional processing example of a command execution program corresponding to LIGHT BINARY. It is a flowchart which shows.
図7(A)に示すように、STORE DATAコマンドを受信したICチップ1aのCPU10は、まず、CLA部にセットされている値をチェックする(ステップS201)。例えば、図6(A)に示すコマンドフォーマットであれば「00h」がセットされているかをチェックする。
As shown in FIG. 7A, the
次いで、CPU10は、INS部にセットされている値をチェックする(ステップS202)。例えば、図6(A)に示すコマンドフォーマットであれば「20h」がセットされているかをチェックする。
Next, the
次いで、CPU10は、Lc部にセットされている値とData部の長さとで整合性がとれているかチェックする(ステップS203)。なお、図示しないが、CPU10は、ステップS201〜ステップS203の処理におけるチェックの結果、正常でないと判定した場合には、コマンドの送信元に異常SWによる応答をし(ステップS208)、当該フローチャートに示す処理を終了する。
Next, the
次に、CPU10は、Data部に設定されているアドレスを取得する(ステップS204)。
Next, the
次に、CPU10は、ステップS204の処理で取得したアドレスに、Data部に設定されているデータを書き込む(ステップS205)。次いで、CPU10は、書き込みは成功か否かを判定する(ステップS206)。
Next, the
CPU10は、書き込みが成功であると判定した場合には(ステップS206:YES)、コマンドの送信元に正常SWによる応答をし(ステップS207)、当該フローチャートに示す処理を終了する。一方、CPU10は、書き込みが成功でないと判定した場合には(ステップS206:NO)、コマンドの送信元に異常SWによる応答をし(ステップS208)、当該フローチャートに示す処理を終了する。
When the
[2.2.2.2.WRITE BINARYコマンド受信時]
一方、図7(B)に示すように、WRITE BINARYコマンドを受信したICチップ1aのCPU10は、まず、CLA部にセットされている値をチェックする(ステップS211)。例えば、図6(B)に示すコマンドフォーマットであれば「00h」がセットされているかをチェックする。
[2.2.2.2. When receiving the LIGHT BINARY command]
On the other hand, as shown in FIG. 7B, the
次いで、CPU10は、INS部にセットされている値をチェックする(ステップS212)。例えば、図6(B)に示すコマンドフォーマットであれば「30h」がセットされているかをチェックする。
Next, the
次いで、CPU10は、Lc部にセットされている値とData部の長さとで整合性がとれているかチェックする(ステップS213)。なお、図示しないが、CPU10は、ステップS211〜ステップS213の処理におけるチェックの結果、正常でないと判定した場合には、コマンドの送信元に異常SWによる応答をし(ステップS218)、当該フローチャートに示す処理を終了する。
Next, the
次に、CPU10は、P1部、P2部に設定されているFIDに基づいてデータの書き込み先のアドレスを取得する(ステップS214)。
Next, the
次に、CPU10は、ステップS214の処理で取得したアドレスに、Data部に設定されているデータを書き込む(ステップS215)。次いで、CPU10は、書き込みは成功か否かを判定する(ステップS216)。
Next, the
CPU10は、書き込みが成功であると判定した場合には(ステップS216:YES)、コマンドの送信元に正常SWによる応答をし(ステップS217)、当該フローチャートに示す処理を終了する。一方、CPU10は、書き込みが成功でないと判定した場合には(ステップS216:NO)、コマンドの送信元に異常SWによる応答をし(ステップS218)、当該フローチャートに示す処理を終了する。
When the
このように、STORE DATAコマンドと、WRITE BINARYコマンドを受信した場合の従来の処理例を比較すると、ステップS205〜ステップS208(ステップS215〜ステップS218)の処理が共通する。これは、STORE DATAコマンドと、WRITE BINARYコマンドの機能(不揮発性メモリ13にデータを書き込む機能)が共通することによる。そこで、本実施形態では、STORE DATAコマンドに対応するコマンド実行用プログラムと、WRITE BINARYコマンドに対応するコマンド実行用プログラムを共通化したコマンド実行用プログラムを作成して記憶させ、従来のSTORE DATAコマンドに対応するコマンド実行用プログラムと、WRITE BINARYコマンドに対応するコマンド実行用プログラムを記憶させないことにより不揮発性メモリ13の記憶領域を節約する。
As described above, comparing the conventional processing examples when the STORE DATA command and the LIGHT BINARY command are received, the processing of steps S205 to S208 (steps S215 to S218) is common. This is because the functions of the STORE DATA command and the WRITE BINARY command (the function of writing data to the non-volatile memory 13) are common. Therefore, in the present embodiment, a command execution program in which a command execution program corresponding to the STORE DATA command and a command execution program corresponding to the LIGHT BINARY command are shared is created and stored, and stored in the conventional STORE DATA command. The storage area of the
[2.2.3.本実施形態の処理フロー]
以下、図8を用いて、共通化したコマンド実行用プログラムによる処理例について説明する。なお、図8は、STORE DATAコマンド及びWRITE BINARYコマンドに対応するコマンド実行用プログラムの処理例を示すフローチャートである。
[2.22.3. Processing flow of this embodiment]
Hereinafter, a processing example by the common command execution program will be described with reference to FIG. Note that FIG. 8 is a flowchart showing a processing example of a command execution program corresponding to the STORE DATA command and the WRITE BINARY command.
図8に示すように、ICチップ1aのCPU10は、まず、受信したコマンドがSTORE DATAコマンドであるか否かを判定する(ステップS221)。CPU10は、受信したコマンドがSTORE DATAコマンドであると判定した場合には(ステップS221:YES)、次いで、CLA部にセットされている値をチェックする(ステップS222)。例えば、図6(A)に示すコマンドフォーマットであれば「00h」がセットされているかをチェックする。
As shown in FIG. 8, the
次いで、CPU10は、INS部にセットされている値をチェックする(ステップS223)。例えば、図6(A)に示すコマンドフォーマットであれば「20h」がセットされているかをチェックする。
Next, the
次いで、CPU10は、Lc部にセットされている値とData部の長さとで整合性がとれているかチェックする(ステップS224)。なお、図示しないが、CPU10は、ステップS222〜ステップS224の処理におけるチェックの結果、正常でないと判定した場合には、コマンドの送信元に異常SWによる応答をし(ステップS233)、当該フローチャートに示す処理を終了する。
Next, the
次に、CPU10は、Data部に設定されているアドレスを取得し(ステップS225)、ステップS230の処理に移行する。
Next, the
一方、CPU10は、受信したコマンドがSTORE DATAコマンドではないと判定した場合には(ステップS221:NO)、次いで、CLA部にセットされている値をチェックする(ステップS226)。例えば、図6(B)に示すコマンドフォーマットであれば「00h」がセットされているかをチェックする。
On the other hand, when the
次いで、CPU10は、INS部にセットされている値をチェックする(ステップS227)。例えば、図6(B)に示すコマンドフォーマットであれば「30h」がセットされているかをチェックする。
Next, the
次いで、CPU10は、Lc部にセットされている値とData部の長さとで整合性がとれているかチェックする(ステップS228)。なお、図示しないが、CPU10は、ステップS226〜ステップS227の処理におけるチェックの結果、正常でないと判定した場合には、コマンドの送信元に異常SWによる応答をし(ステップS233)、当該フローチャートに示す処理を終了する。
Next, the
次に、CPU10は、P1部、P2部に設定されているFIDに基づいてデータの書き込み先のアドレスを取得し(ステップS229)、ステップS230の処理に移行する。
Next, the
次に、CPU10は、ステップS225又はステップS229の処理で取得したアドレスに、Data部に設定されているデータを書き込む(ステップS230)。次いで、CPU10は、書き込みは成功か否かを判定する(ステップS231)。
Next, the
CPU10は、書き込みが成功であると判定した場合には(ステップS231:YES)、コマンドの送信元に正常SWによる応答をし(ステップS232)、当該フローチャートに示す処理を終了する。一方、CPU10は、書き込みが成功でないと判定した場合には(ステップS231:NO)、コマンドの送信元に異常SWによる応答をし(ステップS233)、当該フローチャートに示す処理を終了する。
When the
[2.3.READ DATAコマンドとREAD BINARYコマンド]
[2.3.1.コマンドフォーマット]
次に、図9を用いて、READ DATAコマンドと、READ BINARYコマンドのコマンドフォーマットについて説明する。なお、図9(A)はREAD DATAコマンドのコマンドフォーマットの一例を示す図であり、図9(B)はREAD BINARYコマンドのコマンドフォーマットの一例を示す図である。図9(A)に示すように、READ DATAコマンドのコマンドフォーマットは、CLA部には「00h(固定)」、INS部には「40h(固定)」、P1部には「00h(固定)」、P2部には「00h(固定)」、Lc部には「08h(固定)」、Data部には読み出すデータの不揮発性メモリ13上の開始アドレス(4バイト)と終了アドレス(4バイト)が設定される。
[2.3. READ DATA command and READ BINARY command]
[2.3.1. Command format]
Next, the command formats of the READ DATA command and the READ BINARY command will be described with reference to FIG. Note that FIG. 9A is a diagram showing an example of the command format of the READ DATA command, and FIG. 9B is a diagram showing an example of the command format of the READ BINARY command. As shown in FIG. 9A, the command format of the READ DATA command is "00h (fixed)" for the CLA part, "40h (fixed)" for the INS part, and "00h (fixed)" for the P1 part. , P2 part has "00h (fixed)", Lc part has "08h (fixed)", and Data part has a start address (4 bytes) and an end address (4 bytes) on the
一方、図9(B)に示すように、READ BINARYコマンドのコマンドフォーマットは、CLA部には「00h(固定)」、INS部には「50h(固定)」、P1部には「FID(File identifier)」、P2部には「FID」が設定される。なお、P1部とP2部に設定されるFIDは、読み出すデータを含む、不揮発性メモリ13上のファイルを示す。
On the other hand, as shown in FIG. 9B, the command format of the READ BINARY command is "00h (fixed)" in the CLA part, "50h (fixed)" in the INS part, and "FID (File)" in the P1 part. "Identifier)", "FID" is set in the P2 part. The FIDs set in the P1 part and the P2 part indicate a file on the
すなわち、READ DATAコマンドには、読み出すデータが記憶された領域を示すアドレスが設定されているため、CPU10は、当該アドレスの示す記憶領域からデータを読み出すことができる。一方、READ BINARYコマンドには、読み出すデータを含むファイルが設定されているため、CPU10は、当該ファイルに基づいて当該ファイルに含まれるデータの記憶領域を示すアドレスを特定してから、当該特定したアドレスの示す記憶領域に記憶されているデータを読み出す必要がある。その一方で、READ DATAコマンドもREAD BINARYコマンドも、読み出すデータが記憶されている記憶領域が特定されると、その後はデータを読み出す点で共通する。
That is, since the READ DATA command is set with an address indicating an area in which the data to be read is stored, the
なお、図9の例では、READ DATAコマンドとREAD BINARYコマンドにおけるCLA部に共通して「00h」が設定されるが、異なる値が設定されることとしてもよい。この場合、READ DATAコマンドとREAD BINARYコマンドのINS部に共通の値が設定されることとしてもよい。 In the example of FIG. 9, "00h" is set in common for the CLA part in the READ DATA command and the READ BINARY command, but different values may be set. In this case, a common value may be set in the INS part of the READ DATA command and the READ BINARY command.
[2.3.2.従来の処理フロー]
[2.3.2.1.READ DATAコマンド受信時]
次に、図10を用いて、READ DATAコマンドと、READ BINARYコマンドを受信した場合に実行される従来のコマンド実行用プログラムの処理例について説明する。なお、図10(A)は、READ DATAコマンドに対応するコマンド実行用プログラムの従来処理例を示すフローチャートであり、図10(B)は、READ BINARYに対応するコマンド実行用プログラムの従来処理例を示すフローチャートである。
[2.3.3. Conventional processing flow]
[2.3.2.1. When receiving the READ DATA command]
Next, a processing example of a conventional command execution program executed when a READ DATA command and a READ BINARY command are received will be described with reference to FIG. Note that FIG. 10A is a flowchart showing a conventional processing example of a command execution program corresponding to the READ DATA command, and FIG. 10B is a conventional processing example of a command execution program corresponding to the READ BINARY. It is a flowchart which shows.
図10(A)に示すように、READ DATAコマンドを受信したICチップ1aのCPU10は、まず、CLA部にセットされている値をチェックする(ステップS301)。例えば、図9(A)に示すコマンドフォーマットであれば「00h」がセットされているかをチェックする。
As shown in FIG. 10A, the
次いで、CPU10は、INS部にセットされている値をチェックする(ステップS302)。例えば、図9(A)に示すコマンドフォーマットであれば「40h」がセットされているかをチェックする。
Next, the
次いで、CPU10は、Lc部にセットされている値をチェックする(ステップS303)。例えば、図9(A)に示すコマンドフォーマットであれば「08h」がセットされているかをチェックする。なお、図示しないが、CPU10は、ステップS301〜ステップS303の処理におけるチェックの結果、正常でないと判定した場合には、コマンドの送信元に異常SWによる応答をし(ステップS308)、当該フローチャートに示す処理を終了する。
Next, the
次に、CPU10は、Data部に設定されている開始アドレスと終了アドレスを取得する(ステップS304)。
Next, the
次に、CPU10は、ステップS304の処理で取得した開始アドレスと終了アドレスで特定される記憶領域に記憶されているデータを取得する(ステップS305)。次いで、CPU10は、取得成功か否かを判定する(ステップS306)。
Next, the
CPU10は、取得成功であると判定した場合には(ステップS306:YES)、コマンドの送信元に、ステップS305の処理で取得したデータ及び正常SWによる応答をし(ステップS307)、当該フローチャートに示す処理を終了する。一方、CPU10は、取得成功でないと判定した場合には(ステップS306:NO)、コマンドの送信元に異常SWによる応答をし(ステップS308)、当該フローチャートに示す処理を終了する。
When the
[2.3.2.2.READ BINARYコマンド受信時]
一方、図10(B)に示すように、READ BINARYコマンドを受信したICチップ1aのCPU10は、まず、CLA部にセットされている値をチェックする(ステップS311)。例えば、図9(B)に示すコマンドフォーマットであれば「00h」がセットされているかをチェックする。
[2.3.2.2. When receiving the READ BINARY command]
On the other hand, as shown in FIG. 10B, the
次いで、CPU10は、INS部にセットされている値をチェックする(ステップS312)。例えば、図9(B)に示すコマンドフォーマットであれば「50h」がセットされているかをチェックする。なお、図示しないが、CPU10は、ステップS311〜ステップS312の処理におけるチェックの結果、正常でないと判定した場合には、コマンドの送信元に異常SWによる応答をし(ステップS317)、当該フローチャートに示す処理を終了する。
Next, the
次に、CPU10は、P1部、P2部に設定されているFIDに基づいて読み出すデータが記憶されている記憶領域を示す開始アドレス及び終了アドレスを取得する(ステップS313)。
Next, the
次に、CPU10は、ステップS313の処理で取得した開始アドレスと終了アドレスで特定される記憶領域に記憶されているデータを取得する(ステップS314)。次いで、CPU10は、取得成功か否かを判定する(ステップS315)。
Next, the
CPU10は、取得成功であると判定した場合には(ステップS315:YES)、コマンドの送信元に、ステップS314の処理で取得したデータ及び正常SWによる応答をし(ステップS316)、当該フローチャートに示す処理を終了する。一方、CPU10は、取得成功でないと判定した場合には(ステップS315:NO)、コマンドの送信元に異常SWによる応答をし(ステップS317)、当該フローチャートに示す処理を終了する。
When the
このように、READ DATAコマンドと、READ BINARYコマンドを受信した場合の従来の処理例を比較すると、ステップS305〜ステップS308(ステップS314〜ステップS317)の処理が共通する。これは、READ DATAコマンドと、READ BINARYコマンドの機能(不揮発性メモリ13にデータを読み出す機能)が共通することによる。そこで、本実施形態では、READ DATAコマンドに対応するコマンド実行用プログラムと、READ BINARYコマンドに対応するコマンド実行用プログラムを共通化したコマンド実行用プログラムを作成して記憶させ、従来のREAD DATAコマンドに対応するコマンド実行用プログラムと、READ BINARYコマンドに対応するコマンド実行用プログラムを記憶させないことにより不揮発性メモリ13の記憶領域を節約する。
As described above, comparing the conventional processing examples when the READ DATA command and the READ BINARY command are received, the processing of steps S305 to S308 (steps S314 to S317) is common. This is because the functions of the READ DATA command and the READ BINARY command (the function of reading data to the non-volatile memory 13) are common. Therefore, in the present embodiment, a command execution program in which a command execution program corresponding to the READ DATA command and a command execution program corresponding to the READ BINARY command are shared is created and stored, and stored in the conventional READ DATA command. The storage area of the
[2.3.3.本実施形態の処理フロー]
以下、図11を用いて、共通化したコマンド実行用プログラムによる処理例について説明する。なお、図11は、READ DATAコマンド及びREAD BINARYコマンドに対応するコマンド実行用プログラムの処理例を示すフローチャートである。
[2.3.3. Processing flow of this embodiment]
Hereinafter, a processing example by the common command execution program will be described with reference to FIG. Note that FIG. 11 is a flowchart showing a processing example of a command execution program corresponding to the READ DATA command and the READ BINARY command.
図11に示すように、ICチップ1aのCPU10は、まず、受信したコマンドがREAD DATAコマンドであるか否かを判定する(ステップS321)。CPU10は、受信したコマンドがREAD DATAコマンドであると判定した場合には(ステップS321:YES)、次いで、CLA部にセットされている値をチェックする(ステップS322)。例えば、図9(A)に示すコマンドフォーマットであれば「00h」がセットされているかをチェックする。
As shown in FIG. 11, the
次いで、CPU10は、INS部にセットされている値をチェックする(ステップS323)。例えば、図9(A)に示すコマンドフォーマットであれば「40h」がセットされているかをチェックする。
Next, the
次いで、CPU10は、Lc部にセットされている値をチェックする(ステップS324)。例えば、図9(A)に示すコマンドフォーマットであれば「08h」がセットされているかをチェックする。なお、図示しないが、CPU10は、ステップS322〜ステップS324の処理におけるチェックの結果、正常でないと判定した場合には、コマンドの送信元に異常SWによる応答をし(ステップS332)、当該フローチャートに示す処理を終了する。
Next, the
次に、CPU10は、Data部に設定されている開始アドレスと終了アドレスを取得し(ステップS325)、ステップS329の処理に移行する。
Next, the
一方、CPU10は、受信したコマンドがREAD DATAコマンドではないと判定した場合には(ステップS321:NO)、次いで、CLA部にセットされている値をチェックする(ステップS326)。例えば、図9(B)に示すコマンドフォーマットであれば「00h」がセットされているかをチェックする。
On the other hand, when the
次いで、CPU10は、INS部にセットされている値をチェックする(ステップS327)。例えば、図9(B)に示すコマンドフォーマットであれば「50h」がセットされているかをチェックする。なお、図示しないが、CPU10は、ステップS326〜ステップS327の処理におけるチェックの結果、正常でないと判定した場合には、コマンドの送信元に異常SWによる応答をし(ステップS332)、当該フローチャートに示す処理を終了する。
Next, the
次に、CPU10は、P1部、P2部に設定されているFIDに基づいて読み出すデータが記憶されている記憶領域を示す開始アドレス及び終了アドレスを取得し(ステップS328)、ステップS329の処理に移行する。
Next, the
次に、CPU10は、ステップS325又はステップS328の処理で取得した開始アドレスと終了アドレスで特定される記憶領域に記憶されているデータを取得する(ステップS329)。次いで、CPU10は、取得成功か否かを判定する(ステップS330)。
Next, the
CPU10は、取得成功であると判定した場合には(ステップS330:YES)、コマンドの送信元に、ステップS325又はステップS328の処理で取得したデータ及び正常SWによる応答をし(ステップS331)、当該フローチャートに示す処理を終了する。一方、CPU10は、取得成功でないと判定した場合には(ステップS330:NO)、コマンドの送信元に異常SWによる応答をし(ステップS332)、当該フローチャートに示す処理を終了する。
When the
以上のように、本実施形態のICチップ1a(「電子情報記憶媒体」の一例)は、コマンドに対応するプログラムを記憶する不揮発性メモリ13(「記憶部」の一例)と、外部機器2から受信したコマンドに対応するコマンド実行用プログラム(「プログラム」の一例)を実行するCPU10(「実行部」の一例)と、を備え、不揮発性メモリ13は、発行前コマンド、及び、発行後コマンドの双方に対応する共通化したコマンド実行用プログラム(「所定のコマンド実行用プログラム」の一例)を記憶し、共通化したコマンド実行用プログラムは、発行前コマンドを受信した場合と発行後コマンドを受信した場合の双方で、共通に実行される処理(例えば、図5のステップS121〜ステップS123の処理、図8のステップS230〜ステップS233の処理、図11のステップS329〜ステップS332の処理)を含む。
As described above, the IC chip 1a (an example of the "electronic information storage medium") of the present embodiment is derived from the non-volatile memory 13 (an example of the "storage unit") for storing the program corresponding to the command and the external device 2. The
したがって、本実施形態のICチップ1aによれば、不揮発性メモリ13が、発行前コマンド及び発行後コマンドの双方に対応する共通化したコマンド実行用プログラムであって、発行前コマンドを受信した場合と発行後コマンドを受信した場合の双方で、共通に実行される処理を含む共通化したコマンド実行用プログラムを記憶し、CPU10が、発行前コマンド及び発行後コマンドを受信した場合にコマンド実行用プログラムを実行する。すなわち、発行前コマンドと発行後コマンドについて、コマンド受信時に実行されるコマンド実行用プログラムを統合して共用化することにより、当該コマンド実行用プログラムを記憶する記憶領域を節約することができる。
Therefore, according to the IC chip 1a of the present embodiment, the
なお、図5を用いて説明した、共通化したコマンド実行用プログラムでは発行フラグ及び発行フラグを用いた判定(ステップS124)が追加される分だけソースコードのデータ量が増え、不揮発性メモリ13が記憶するデータ量は増えるが、コマンド実行用プログラムにおける処理(ステップS121〜ステップS123の処理)を統一することによるデータ削減量の方が大きい。特に、ステップS121〜ステップS123のチェック処理に係るソースコードのデータ量は多いため、当該チェック処理を共通化することによるデータ削減量の方が大きい。
In the common command execution program described with reference to FIG. 5, the amount of source code data is increased by the amount of the issuance flag and the determination using the issuance flag (step S124), and the
また、本実施形態のVERIFY(IS)コマンド(「発行前コマンド」の一例)のCLA部とVERIFY(USR)コマンド(「発行後コマンド」の一例)のCLA部、及び、VERIFY(IS)コマンドのINS部とVERIFY(USR)コマンドのINS部にはそれぞれ共通の値が設定され、共通化したコマンド実行用プログラムは、VERIFY(IS)コマンドのCLA部とVERIFY(USR)コマンドのCLA部に設定された値について共通に実行される処理(図5のステップS121の処理)、及び、VERIFY(IS)コマンドのINS部とVERIFY(USR)コマンドのINS部に設定された値について共通に実行される処理(図5のステップS122の処理)と、を含む。これにより、ステップS121及びステップS122で実行される処理を共用化することができ、コマンド実行用プログラムを記憶する記憶領域を節約することができる Further, the CLA part of the VERIFY (IS) command (an example of the "pre-issue command") of the present embodiment, the CLA part of the VERIFY (USR) command (an example of the "post-issue command"), and the VERIFY (IS) command. Common values are set in the INS part and the INS part of the VERIFY (USR) command, and the common command execution program is set in the CLA part of the VERIFY (IS) command and the CLA part of the VERIFY (USR) command. Processes that are commonly executed for the values (process in step S121 in FIG. 5) and processes that are commonly executed for the values set in the INS part of the VERIFY (IS) command and the INS part of the VERIFY (USR) command. (Processing in step S122 of FIG. 5) and. As a result, the processes executed in steps S121 and S122 can be shared, and the storage area for storing the command execution program can be saved.
更に、本実施形態のSTORE DATAコマンド(「発行前コマンド」の一例)のCLA部とWRITE BINARYコマンド(「発行後コマンド」の一例)のCLA部、又は、STORE DATAコマンドのINS部とWRITE BINARYコマンドのINS部の少なくとも何れか一方は異なる値が設定され、共通化したコマンド実行用プログラムは、STORE DATAコマンドを受信した場合とWRITE BINARYコマンドを受信した場合の双方で、不揮発性メモリ13に対して共通に実行される処理(図8のステップS230〜ステップS233の処理)を含む。これにより、不揮発性メモリ13に対して共通に実行される処理を共用化することができ、コマンド実行用プログラムを記憶する記憶領域を節約することができる。
Further, the CLA part of the STORE DATA command (an example of "pre-issuance command") and the CLA part of the WRITE command (an example of "post-issue command") of the present embodiment, or the INS part and WRITE BINARY command of the STORE DATA command. A different value is set for at least one of the INS parts of the above, and the common command execution program is for the
更にまた、STORE DATAコマンド及びWRITE BINARYコマンドに対応する共通化したコマンド実行用プログラムにおいて不揮発性メモリ13に対して共通に実行される処理は、不揮発性メモリ13にデータを書き込む処理であり、より具体的には、STORE DATAコマンド及びWRITE BINARYコマンドにおけるData部に設定されているデータを、不揮発性メモリ13に書き込む処理である。これにより、不揮発性メモリ13にデータを書き込む処理(図8のステップS230〜ステップS233の処理)を共用化することができ、コマンド実行用プログラムを記憶する記憶領域を節約することができる。
Furthermore, the process commonly executed for the
更にまた、本実施形態のREAD DATAコマンド(「発行前コマンド」の一例)のCLA部とREAD BINARYコマンド(「発行後コマンド」の一例)のCLA部、又は、READ DATAコマンドのINS部とREAD BINARYコマンドのINS部の少なくとも何れか一方は異なる値が設定され、共通化したコマンド実行用プログラムは、READ DATAコマンドを受信した場合とREAD BINARYコマンドを受信した場合の双方で、不揮発性メモリ13に対して共通に実行される処理(図11のステップS329〜ステップS332の処理)を含む。これにより、不揮発性メモリ13に対して共通に実行される処理(図11のステップS329〜ステップS332の処理)を共用化することができ、コマンド実行用プログラムを記憶する記憶領域を節約することができる。
Furthermore, the CLA part of the READ DATA command (an example of the "pre-issue command") and the CLA part of the READ BINARY command (an example of the "post-issue command") of the present embodiment, or the INS part and the READ BINARY of the READ DATA command. Different values are set for at least one of the INS parts of the command, and the common command execution program is for the
更にまた、READ DATAコマンド及びREAD BINARYコマンドに対応する共通化したコマンド実行用プログラムにおいて不揮発性メモリ13に対して共通に実行される処理は、不揮発性メモリ13のデータを読み出す処理(図11のステップS329〜ステップS332の処理)である。これにより、不揮発性メモリ13のデータを読み出す処理(図11のステップS329〜ステップS332の処理)を共用化することができ、コマンド実行用プログラムを記憶する記憶領域を節約することができる。
Furthermore, the process commonly executed for the
1 ICカード
1a ICチップ
10 CPU
11 RAM
12 ROM
13 不揮発性メモリ
14 I/O回路
2 外部機器
1 IC card
11 RAM
12 ROM
13 Non-volatile memory 14 I / O circuit 2 External device
Claims (6)
複数種類の前記コマンドには、前記電子情報記憶媒体の発行の前に受信する前記コマンドである発行前コマンド、及び、前記発行の後に受信するコマンドである発行後コマンドが含まれ、
前記記憶部は、
複数種類の前記コマンドのうち、前記電子情報記憶媒体に対して共通の処理を実行させる前記発行前コマンドと前記発行後コマンドからなる組に対応する所定のプログラムと、
前記電子情報記憶媒体が発行前か発行後かを示す発行情報と、
を記憶し、
前記所定のプログラムは、
前記組を構成する前記発行前コマンドを受信した場合と前記組を構成する前記発行後コマンドを受信した場合の双方で実行される前記共通の処理と、
前記発行情報が前記発行前を示している場合に実行される処理であって、前記組を構成する前記発行前コマンドに応じて実行される処理と、
前記発行情報が前記発行後を示している場合に実行される処理であって、前記組を構成する前記発行後コマンドに応じて実行される処理と、
を含むことを特徴とする電子情報記憶媒体。 An electronic information storage medium including a storage unit for storing a program corresponding to a command and an execution unit for executing the program corresponding to the command received from the outside.
The plurality of types of the commands include a pre-issuance command, which is a command received before the issuance of the electronic information storage medium, and a post-issue command, which is a command received after the issuance.
The storage unit
Among a plurality of types of said commands, a predetermined program corresponding to the set to be the pre-issuing command to perform common process to the electronic information storage medium from the after issuing the command,
Issuance information indicating whether the electronic information storage medium is before or after issuance, and
Remember,
The predetermined program
And said common processing which are executed in both the case of receiving the issued after the command to configure the set with the case of receiving the issued before command constituting the sets,
A process that is executed when the issue information indicates before the issue, and a process that is executed in response to the pre-issue command that constitutes the set.
A process that is executed when the issue information indicates the post-issue, and a process that is executed in response to the post-issue command that constitutes the set.
An electronic information storage medium comprising.
前記組を構成する前記発行前コマンドのCLA部と前記組を構成する前記発行後コマンドのCLA部、及び、前記組を構成する前記発行前コマンドのINS部と前記組を構成する前記発行後コマンドのINS部にはそれぞれ共通の値が設定され、
前記所定のプログラムは、前記組を構成する前記発行前コマンドのCLA部と前記組を構成する前記発行後コマンドのCLA部に設定された値について共通に実行される処理、及び、前記組を構成する前記発行前コマンドのINS部と前記組を構成する前記発行後コマンドのINS部に設定された値について共通に実行される処理と、を含むことを特徴とする電子情報記憶媒体。 The electronic information storage medium according to claim 1.
CLA portion of the issuing post commands that configure the set with CLA portion of said issued before command constituting the sets, and said after issuance command to configure the set with INS portion of said issued before command constituting the group Common values are set for each INS part of
The predetermined program constitutes a process commonly executed for a value set in the CLA part of the pre-issuance command constituting the set and the CLA part of the post-issuance command constituting the set, and the set. An electronic information storage medium comprising: a process commonly executed for a value set in the INS unit of the pre-issue command and the INS unit of the post-issue command constituting the set.
前記組を構成する前記発行前コマンドのCLA部と前記組を構成する前記発行後コマンドのCLA部、又は、前記組を構成する前記発行前コマンドのINS部と前記組を構成する前記発行後コマンドのINS部の少なくとも何れか一方は異なる値が設定され、
前記所定のプログラムは、前記組を構成する前記発行前コマンドを受信した場合と前記組を構成する前記発行後コマンドを受信した場合の双方で、前記記憶部に対して共通に実行される処理を含むことを特徴とする電子情報記憶媒体。 The electronic information storage medium according to claim 1.
CLA portion of the issuing post commands that configure the set with CLA portion of said issued before command constituting the group or the after issuance command to configure the set with INS portion of said issued before command constituting the group Different values are set for at least one of the INS parts of
The predetermined program performs processing that is commonly executed for the storage unit both when the pre-issuance command constituting the set is received and when the post-issue command constituting the set is received. An electronic information storage medium comprising.
前記記憶部に対して共通に実行される処理は、前記記憶部にデータを書き込む処理、又は、前記記憶部のデータを読み出す処理であることを特徴とする電子情報記憶媒体。 The electronic information storage medium according to claim 3.
An electronic information storage medium characterized in that a process commonly executed for the storage unit is a process of writing data to the storage unit or a process of reading data from the storage unit.
前記記憶部に対して共通に実行される処理は、前記組を構成する前記発行前コマンド及び前記組を構成する前記発行後コマンドにおけるData部に設定されているデータを前記記憶部に書き込む処理であることを特徴とする電子情報記憶媒体。 The electronic information storage medium according to claim 4.
It processing performed in common for the memory unit, the process of writing the data set in the Data part of the issuing post commands constituting the issue prior command and said set constituting the sets in the storage unit An electronic information storage medium characterized by being present.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2018045654A JP6904286B2 (en) | 2018-03-13 | 2018-03-13 | Electronic information storage medium and IC card |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2018045654A JP6904286B2 (en) | 2018-03-13 | 2018-03-13 | Electronic information storage medium and IC card |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2019159799A JP2019159799A (en) | 2019-09-19 |
| JP6904286B2 true JP6904286B2 (en) | 2021-07-14 |
Family
ID=67997043
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2018045654A Active JP6904286B2 (en) | 2018-03-13 | 2018-03-13 | Electronic information storage medium and IC card |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP6904286B2 (en) |
Family Cites Families (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP3231467B2 (en) * | 1993-03-24 | 2001-11-19 | 大日本印刷株式会社 | Information recording medium with built-in CPU |
| JP3195122B2 (en) * | 1993-04-26 | 2001-08-06 | 大日本印刷株式会社 | Check method of instruction format given to IC card |
| JPH07175619A (en) * | 1993-12-20 | 1995-07-14 | Fujitsu Ltd | Interactive data entry system |
| JP2002352205A (en) * | 2001-05-29 | 2002-12-06 | Toshiba Corp | Portable electronic device and access management method |
| JP4457573B2 (en) * | 2003-04-10 | 2010-04-28 | 凸版印刷株式会社 | IC card and program writing method |
| JP4527434B2 (en) * | 2004-04-16 | 2010-08-18 | 大日本印刷株式会社 | Portable information storage medium and program thereof |
| JP4774681B2 (en) * | 2004-05-18 | 2011-09-14 | 大日本印刷株式会社 | Multi-application IC card with common command application |
-
2018
- 2018-03-13 JP JP2018045654A patent/JP6904286B2/en active Active
Also Published As
| Publication number | Publication date |
|---|---|
| JP2019159799A (en) | 2019-09-19 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US9418224B2 (en) | Portable electronic device and control method of portable electronic device | |
| US9183400B2 (en) | IC card and IC card control method | |
| EP2296108A1 (en) | Portable electronic device and control method thereof | |
| JPH07507896A (en) | Reading data from smart card | |
| US20090177921A1 (en) | Portable electronic device and control method thereof | |
| JP6904286B2 (en) | Electronic information storage medium and IC card | |
| CN112527341B (en) | Vehicle system upgrading method, vehicle system and computer storage medium | |
| JP3923546B2 (en) | IC card | |
| US20120234926A1 (en) | Portable electronic apparatus | |
| JP2008310596A (en) | Portable electronic device and method for controlling portable electronic device | |
| JP5892818B2 (en) | Portable electronic device and control program for portable electronic device | |
| JP2004192447A (en) | IC card and IC card data management method | |
| US20040133800A1 (en) | Method of manufacturing smart cards | |
| JP2005011147A (en) | IC card and IC card program | |
| JP6984328B2 (en) | Electronic information storage medium, IC card, external device, data writing method and data writing program | |
| JP7005934B2 (en) | Electronic information storage medium, IC card, data transmission method, data writing method, data transmission program and data writing program | |
| JP7619138B2 (en) | Electronic information storage medium, processing method, and program | |
| JP7438432B1 (en) | Electronic information storage medium, IC chip, IC card, record writing method, and program | |
| JP7420179B1 (en) | Electronic information storage medium, IC card, issuance processing method, and program | |
| JP2024139134A (en) | Electronic information storage medium, IC chip, method for writing issuance data, and program | |
| CN101326552A (en) | Method of initializing and/or personalizing a portable data carrier | |
| JP2019168944A (en) | Electronic information storage medium, IC card, command group execution method, and command group execution program | |
| JP2014203248A (en) | Ic card, status word output method, and status word output processing program | |
| US9672390B2 (en) | IC card and command processing method for IC card | |
| JP2006302130A (en) | IC card and IC card program |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20201106 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20210216 |
|
| A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20210414 |
|
| 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: 20210525 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20210607 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 6904286 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |