JP4620418B2 - Real-time command processing method, IC card, and embedded terminal - Google Patents

Real-time command processing method, IC card, and embedded terminal Download PDF

Info

Publication number
JP4620418B2
JP4620418B2 JP2004279213A JP2004279213A JP4620418B2 JP 4620418 B2 JP4620418 B2 JP 4620418B2 JP 2004279213 A JP2004279213 A JP 2004279213A JP 2004279213 A JP2004279213 A JP 2004279213A JP 4620418 B2 JP4620418 B2 JP 4620418B2
Authority
JP
Japan
Prior art keywords
command
real
processing
time
card
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
JP2004279213A
Other languages
Japanese (ja)
Other versions
JP2006092416A (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.)
Dai Nippon Printing Co Ltd
Original Assignee
Dai Nippon Printing Co Ltd
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 Dai Nippon Printing Co Ltd filed Critical Dai Nippon Printing Co Ltd
Priority to JP2004279213A priority Critical patent/JP4620418B2/en
Publication of JP2006092416A publication Critical patent/JP2006092416A/en
Application granted granted Critical
Publication of JP4620418B2 publication Critical patent/JP4620418B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Credit Cards Or The Like (AREA)

Description

本発明は、ICカードにおいて複数のコマンドを処理する技術に関する。   The present invention relates to a technique for processing a plurality of commands in an IC card.

近年、携帯電話における加入者識別モジュール(SIM、UIM)など、機器に組み込むためのICカードが普及しはじめている。   In recent years, IC cards for incorporation into devices such as subscriber identification modules (SIM, UIM) in mobile phones have begun to become widespread.

現状では、UIM等のICカードの規格については、ISO7816−4で定義されており、この規格に基づいた仕組みで運用がなされている(非特許文献1参照)。   At present, the standard of an IC card such as UIM is defined in ISO 7816-4, and is operated by a mechanism based on this standard (see Non-Patent Document 1).

ISO7816仕様ISO7816 specification

上記、ISO7816で定義されているAPDU(Application Protocol Data Unit)では、あるコマンドを受信すると、そのコマンドに対するレスポンスを介してからでないと、次のコマンドを受付けない。つまり、アプリケーションAからのコマンドを実行している途中にアプリケーションBからのコマンドを受信することはないという前提のもとに、コマンドが定義されている。   When an APDU (Application Protocol Data Unit) defined in ISO7816 receives a certain command, it does not accept the next command unless a response to that command is received. That is, the command is defined on the assumption that the command from the application B is not received during the execution of the command from the application A.

一方、UIMをPDAなどの機器に組み込み、無線LANにおけるセキュリティを確保するための認証仕様「WLAN-SIM VO.1」が業界団体WLAN Smart Card Consortiumで検討されている。今後は、情報家電やネットワークに接続される各種制御機器がこうしたUIMをセキュリティモジュールとして採用していく可能性が高い。そうなると、ICカードにおいても、多数のコマンドを処理する必要性に迫られることになる。しかし、上述のように、ICカードのコマンドは、ISO7816規格が広範に用いられているため、この規格を変更せずに対応することが望まれている。   On the other hand, an authentication specification “WLAN-SIM VO.1” for ensuring security in a wireless LAN by incorporating a UIM into a device such as a PDA is being examined by the industry group WLAN Smart Card Consortium. In the future, various home appliances and various control devices connected to the network are likely to adopt such UIMs as security modules. Then, even in the IC card, it becomes necessary to process a large number of commands. However, as described above, since the ISO 7816 standard is widely used for the command of the IC card, it is desired to correspond without changing the standard.

そこで、本発明は、従来の規格のコマンドを利用して、複数のコマンドの処理を行うことが可能なリアルタイムコマンドの作成・処理方法、および、ICカードおよび、その組み込み端末を提供することを課題とする。   SUMMARY OF THE INVENTION It is therefore an object of the present invention to provide a real-time command creation / processing method capable of processing a plurality of commands using a command of a conventional standard, an IC card, and an embedded terminal thereof. And

上記課題を解決するため、本発明では、元のコマンドの前にIDと優先度を付加してデータ部としてカプセル化すると共に、元のコマンドのヘッダ部分と同一の役割を果たす部分をカプセル化したデータ部の前に付加したコマンドであるリアルタイムコマンドを作成し、ICカード上において、処理待ちリストに記録された優先度に従って、コマンドの処理を行うにあたり、外部からコマンドを受信した際に、当該コマンドの処理を中断し、受信したコマンドがリアルタイムコマンドであるかどうか判別し、判別の結果、リアルタイムコマンドである場合に、カプセル化された元コマンドを抽出し、リアルタイムコマンドに記録された優先度と共に処理待ちリストに記録するようにしたことを特徴とする。
In order to solve the above problem, in the present invention, an ID and a priority are added before the original command to encapsulate it as a data part, and a part that plays the same role as the header part of the original command is encapsulated. Create a real-time command, which is a command added in front of the data part , and process the command according to the priority recorded in the processing waiting list on the IC card. If the received command is a real-time command, the original command encapsulated is extracted and processed together with the priority recorded in the real-time command. It is characterized in that it is recorded in a waiting list .

本発明によれば、ICカードにおいて標準的に利用される元コマンドをそのままカプセル化して、優先度およびIDの情報を加え、さらに元コマンドと同じヘッダを付加してリアルタイムコマンドとするようにしたので、従来の1つのコマンドの処理しか想定していない規格のコマンドを利用して、複数のコマンドの処理を行うことが可能となる。   According to the present invention, the original command normally used in the IC card is encapsulated as it is, the priority and ID information is added, and the same header as the original command is added to obtain a real-time command. It is possible to process a plurality of commands by using a command of a standard that assumes only one conventional command process.

以下、本発明の好適な実施形態について、図面を参照して詳細に説明する。
(ICカードの構成)
図1は、本発明に係るICカードの機能ブロック図である。図1において、1はICカード、2は通信I/F(インターフェイス)、3は通信検知手段、4はCPU、5は割込部、6は情報記憶領域、10は端末である。通信I/F2は、外部の端末(機器)と通信を行うためのインターフェイスであり、USB等の接触方式、アンテナを介した非接触方式等、種々の方式に対応してデータの送受信を行うものである。通信検知手段3は、外部の端末からデータを受信した場合に、それを検知し、CPU4に伝える機能を有している。CPU4は、ICカード1において、OSを実行し、データ処理を行う機能を有している。割込部5は、通信検知手段3からの指示に基づいて、CPU4が実行しているデータ処理に対して割込みを行う機能を有している。情報記憶領域6は、データ処理、通信等に必要な情報を記憶する領域であり、後述する処理待ちリストや送信バッファとしての領域も確保する。図1に示す通信検知手段3、CPU4に伝える機能を有している。CPU4、割込部5、情報記憶領域6、および通信I/F2の一部は、ICカード上に設けられたICチップ内において実現される。端末10は、入力用のキーボード、ボタン等を備えると共に、液晶ディスプレイ等の表示デバイスを備えた端末装置であり、ICカードの読み書き機能を備えたパソコンや携帯端末等で実現される。
DESCRIPTION OF EMBODIMENTS Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the drawings.
(Configuration of IC card)
FIG. 1 is a functional block diagram of an IC card according to the present invention. In FIG. 1, 1 is an IC card, 2 is a communication I / F (interface), 3 is communication detection means, 4 is a CPU, 5 is an interrupt unit, 6 is an information storage area, and 10 is a terminal. The communication I / F 2 is an interface for communicating with an external terminal (device), and transmits and receives data corresponding to various methods such as a contact method such as a USB and a non-contact method via an antenna. It is. The communication detection unit 3 has a function of detecting data transmitted from an external terminal and transmitting it to the CPU 4. The CPU 4 has a function of executing an OS and performing data processing in the IC card 1. The interrupt unit 5 has a function of interrupting data processing being executed by the CPU 4 based on an instruction from the communication detection unit 3. The information storage area 6 is an area for storing information necessary for data processing, communication, and the like, and secures a process waiting list and an area as a transmission buffer, which will be described later. It has the function to transmit to the communication detection means 3 and CPU4 shown in FIG. The CPU 4, the interrupt unit 5, the information storage area 6, and a part of the communication I / F 2 are realized in an IC chip provided on the IC card. The terminal 10 is a terminal device that includes an input keyboard, buttons, and the like, and a display device such as a liquid crystal display, and is realized by a personal computer or a mobile terminal that has an IC card read / write function.

(ICカードで利用されているコマンド)
ここで、ISO−7816part−4で規定されている、端末からICカードに送られるコマンドの形式について説明する。ISO−7816part−4規定のコマンドの形式を図2に示す。図2(a)に示すように、端末からICカードに送られるコマンドは、データ部の前に、CLA、INS、P1、P2、Lcで構成されるヘッダが付加されたものとなっている。CLA、INS、P1、P2、Lcはそれぞれ1バイトで記録される。ヘッダ内のCLAは、クラス(class)を意味し、そのコマンドがISOに準拠するか、セキュリティ機能を有しているか等のコマンドの分類を示すものである。INSは、コマンドを特定するものである。P1、P2は、コマンドに対するパラメータである。Lcは、データ部の長さである。例えば、VERIFYコマンドでパスワード「0A 0B 0C 0D」を送信する場合は、図2(b)に示すようになる。VERIFYコマンドとは、端末からパスワードなどを送り、ICカードの中のパスワードと照合し、その結果、続く処理を行うかどうか決めるために使用されるコマンドであり、「20」で表記される。なお、本明細書において、特に断りのない限り、コマンド中のデータは16進数で表記する。すなわち、2つの数字で1バイトとなる。
(Commands used in IC cards)
Here, the format of a command sent from the terminal to the IC card, which is defined in ISO-7816part-4, will be described. A command format defined in ISO-7816part-4 is shown in FIG. As shown in FIG. 2A, the command sent from the terminal to the IC card has a header composed of CLA, INS, P1, P2, and Lc added in front of the data portion. CLA, INS, P1, P2, and Lc are each recorded in 1 byte. CLA in the header means a class, and indicates a classification of a command such as whether the command conforms to ISO or has a security function. INS specifies a command. P1 and P2 are parameters for the command. Lc is the length of the data part. For example, when the password “0A 0B 0C 0D” is transmitted by the VERIFY command, it is as shown in FIG. The VERIFY command is a command used to send a password or the like from the terminal, collate it with the password in the IC card, and as a result, determine whether or not to perform subsequent processing, and is represented by “20”. In the present specification, unless otherwise specified, the data in the command is expressed in hexadecimal. That is, two numbers form one byte.

続いて、本発明に係るリアルタイムコマンドの作成方法について具体的に説明していく。端末内でリアルタイムコマンドを作成する場合、まず、ISO7816準拠のコマンドを作成し、これを元コマンドとする。この元コマンドは、上述のように、図2(a)に示したような構成となっている。端末は、さらに、図2(c)に示すような構成のリアルタイムコマンドを作成する。すなわち、データ部には、先頭の1バイトにID、次の1バイトに優先度パラメータを格納し、データ部の3バイト目以降に元のコマンドをそっくり格納する。さらに、ヘッダには、元コマンドのヘッダと同一の役割を果たすヘッダを付加する。ただし、リアルタイムコマンドにおいては、CLAの値は「D0」、INSの値は「00」の固定値となっており、この組み合わせがリアルタイムコマンドであることを示すことになる。端末は、作成したリアルタイムコマンドをICカード1に送信する。   Next, a method for creating a real-time command according to the present invention will be specifically described. When creating a real-time command in the terminal, first, a command conforming to ISO7816 is created and used as the original command. As described above, this original command has a configuration as shown in FIG. The terminal further creates a real-time command having a configuration as shown in FIG. That is, in the data part, the ID is stored in the first byte, the priority parameter is stored in the next byte, and the original command is stored in the third and subsequent bytes of the data part. Further, a header that plays the same role as the header of the original command is added to the header. However, in the real-time command, the CLA value is a fixed value of “D0” and the INS value is “00”, which indicates that this combination is a real-time command. The terminal transmits the created real-time command to the IC card 1.

ICカード1では、通信I/F2がコマンドを受け取ると、通信検知手段3が通信を検知し、CPU4の割込部5に伝える。この場合、CPU4は実行中のコマンド処理があったとしても、それを中断して、コマンドの受信処理を行う。続いて、CPU4は、受信したコマンドがリアルタイムコマンドであるかどうかを判別する。具体的には、コマンドの先頭のCLAとINSの値を確認し、この値が「D0」「00」であれば、リアルタイムコマンドであると判別し、「D0」「00」以外であれば、リアルタイムコマンドでないと判別する。リアルタイムコマンドでない場合は、そのコマンドの優先度をあらかじめ設定したデフォルト値(例えば「80」)とし、空いているID番号を付与する。リアルタイムコマンドである場合は、そのコマンドのIDが、コマンドの処理待ちリストに存在するかどうかを確認し、存在していればエラーを返す。リストに存在していない場合は、処理待ちリスト上でIDが重複しないため、受信したコマンドの優先度に従ってコマンドを処理待ちリストに追加する。これで割込み処理は終了する。   In the IC card 1, when the communication I / F 2 receives a command, the communication detection unit 3 detects the communication and transmits it to the interrupt unit 5 of the CPU 4. In this case, even if there is a command process being executed, the CPU 4 interrupts the command process and performs a command reception process. Subsequently, the CPU 4 determines whether or not the received command is a real-time command. Specifically, the values of CLA and INS at the head of the command are confirmed. If these values are “D0” and “00”, it is determined that the command is a real-time command, and if other than “D0” and “00”, It is determined that it is not a real-time command. If the command is not a real-time command, the priority of the command is set to a preset default value (eg, “80”), and a free ID number is assigned. If it is a real-time command, it is checked whether the ID of the command exists in the command processing waiting list, and if it exists, an error is returned. If the ID does not exist in the list, the ID is not duplicated on the processing waiting list, so the command is added to the processing waiting list according to the priority of the received command. This completes the interrupt process.

割込み処理が終了した時点で、CPU4は、処理待ちリストの一番優先度の高いコマンドを調べ実行する。1つのコマンドの実行が終了したら、対応するIDを1バイト目に付加して結果を送信し、処理待ちリストから、そのコマンドを削除する。処理待ちリストにコマンドが存在する場合は、引き続き、リスト中で一番優先度の高いコマンドから実行していく。   When the interrupt process is completed, the CPU 4 checks and executes the command with the highest priority in the process waiting list. When the execution of one command is completed, the corresponding ID is added to the first byte, the result is transmitted, and the command is deleted from the processing wait list. If there is a command in the processing waiting list, the command is executed from the command with the highest priority in the list.

ここで、ICカード1におけるCPU4の処理全体の流れについて、図3のフローチャートを参照して説明する。まず、端末10にICカード1を挿入して、端末10から電源供給を受ける。そして、CPU4で起動されるOSは、ATR(answer to reset:初期応答)を端末に返す(S1)。OSは、処理待ちのコマンドが存在するかどうかを確認する(S2)。具体的には、処理待ちリストを確認し、リスト上にコマンドが存在するかどうかを確認することになる。   Here, the flow of the entire processing of the CPU 4 in the IC card 1 will be described with reference to the flowchart of FIG. First, the IC card 1 is inserted into the terminal 10 and receives power supply from the terminal 10. Then, the OS activated by the CPU 4 returns an ATR (answer to reset: initial response) to the terminal (S1). The OS confirms whether there is a command waiting for processing (S2). Specifically, the processing waiting list is confirmed, and it is confirmed whether or not the command exists on the list.

処理待ちのコマンドが存在する場合は、優先度の最も高いコマンドを実行する(S3)。コマンドの実行が終了したら、処理結果を送信バッファにセットする(S4)。さらに、バッファ内容を通信I/F2を経由して端末へ送信する(S5)。そして、S5において処理結果を送信したコマンドを、処理待ちリストから削除する(S6)。S2からS6までの処理は、割込みが処理が入らない限りループ処理されることになる。   If there is a command waiting for processing, the command with the highest priority is executed (S3). When the execution of the command is completed, the processing result is set in the transmission buffer (S4). Further, the buffer contents are transmitted to the terminal via the communication I / F 2 (S5). Then, the command that transmitted the processing result in S5 is deleted from the processing waiting list (S6). The processing from S2 to S6 is looped unless an interrupt is entered.

通信I/F2がコマンドを受け取って、通信検知手段3が通信の開始を割込部5を介してCPU4に伝えると、CPU4で起動されるOSは、実行中の処理を中断する(S7)。この際、後で再開できるような状態で中断が行われる。続いて、コマンドの受信を行う(S8)。さらに、受信したコマンドの内容を解析する(S9)。この結果、受信したコマンドがリアルタイムコマンドかどうかを判別する(S10)。受信したコマンドがリアルタイムコマンドでない場合は、デフォルトとして設定された優先度と空いているIDを付与する(S11)。一方、受信したコマンドがリアルタイムコマンドである場合は、IDが重複しているかどうかを判別する(S12)。   When the communication I / F 2 receives the command and the communication detection unit 3 notifies the CPU 4 of the start of communication via the interrupt unit 5, the OS activated by the CPU 4 interrupts the process being executed (S7). At this time, the interruption is performed in such a state that it can be resumed later. Subsequently, a command is received (S8). Further, the contents of the received command are analyzed (S9). As a result, it is determined whether or not the received command is a real-time command (S10). If the received command is not a real-time command, a priority set as a default and a free ID are assigned (S11). On the other hand, if the received command is a real-time command, it is determined whether or not the ID is duplicated (S12).

IDが重複している場合は、NGメッセージ(エラー)を送信バッファにセットする(S13)。そして、送信バッファの内容を端末10に送信して(S14)、S2に戻り、ループ処理を繰り返す。一方、IDが重複していない場合は、優先度と元コマンドを取り出す(S15)。そして、優先度に従って処理待ちリストに追加する(S16)。なお、S16の処理は、優先度と空いているIDを付与されたコマンドについても行われる。S16における処理後は、S2に戻り、ループ処理を繰り返す。   If the IDs overlap, an NG message (error) is set in the transmission buffer (S13). Then, the contents of the transmission buffer are transmitted to the terminal 10 (S14), the process returns to S2, and the loop processing is repeated. On the other hand, if the IDs are not duplicated, the priority and the original command are extracted (S15). Then, it is added to the processing waiting list according to the priority (S16). Note that the processing of S16 is also performed for a command given a priority and a free ID. After the process in S16, the process returns to S2 to repeat the loop process.

(具体的な例)
次に、具体的な例をあげて、端末におけるリアルタイムコマンドの作成、ICカードにおけるリアルタイムコマンドの処理について説明する。暗証番号の照合を行うVERIFYコマンドについて、ISO−7816part−4規定の元コマンドのデータ配列、端末10で作成されるリアルタイムコマンドのデータ配列を図4に示す。また、鍵の生成を行う鍵生成コマンドについて、ISO−7816part−4規定の元コマンドのデータ配列、端末で作成されるリアルタイムコマンドのデータ配列を図5に示す。
(Specific example)
Next, with reference to a specific example, creation of a real-time command in the terminal and processing of the real-time command in the IC card will be described. FIG. 4 shows the data array of the original command defined in ISO-7816part-4 and the data array of the real-time command created by the terminal 10 for the VERIFY command for collating the password. FIG. 5 shows the data array of the original command defined by ISO-7816part-4 and the data array of the real-time command created by the terminal for the key generation command for generating the key.

図4(a)に示す元コマンドは、INSが「20」であることがVERIFYコマンドを示し、図中「xx xx…xx」で示す128バイトの任意のデータについて照合を行うことを示している。Lcが「80」であるのは、データ部が128バイトであるため、「128」を16進表記したものである。図4(b)に示すリアルタイムコマンドは、図4(a)に示した元コマンドをカプセル化して作成されたものである。図4(b)に示すように、リアルタイムコマンドは、元コマンドにIDと優先度を付加したものを新たなデータ部としたものである。また、先頭のCLA、INSの組み合わせが「D0」「00」であるのは、上述のように、リアルタイムコマンドを示すものである。Lcが「87」であるのは、データ部が135バイト(ID1バイト+優先度1バイト+元コマンド133バイト)であるため、「135」を16進表記したものである。   The original command shown in FIG. 4A indicates that the INS is “20” indicates the VERIFY command, and indicates that collation is performed on any 128-byte data indicated by “xx xx... Xx” in the drawing. . Lc is “80” because the data portion is 128 bytes, so “128” is expressed in hexadecimal. The real-time command shown in FIG. 4B is created by encapsulating the original command shown in FIG. As shown in FIG. 4B, the real-time command is a new data part obtained by adding an ID and priority to the original command. The combination of the leading CLA and INS being “D0” “00” indicates a real-time command as described above. Lc is “87” because the data part is 135 bytes (ID 1 byte + priority 1 byte + original command 133 bytes), so “135” is expressed in hexadecimal.

図5(a)に示す元コマンドは、INSが「46」であることが鍵生成コマンドを示し、図中「xx」で示す1バイトの任意のデータをパラメータとして鍵の生成を行うことを示している。Lcが「01」であるのは、データ部が1バイトであるため、「1」を16進表記したものである。図5(b)に示すリアルタイムコマンドは、図5(a)に示した元コマンドをカプセル化して作成されたものである。図5(b)に示すように、リアルタイムコマンドは、元コマンドにIDと優先度を付加したものを新たなデータ部としたものである。また、先頭のCLA、INSの組み合わせが「D0」「00」であるのは、上述のように、リアルタイムコマンドを示すものである。Lcが「08」であるのは、データ部が8バイト(ID1バイト+優先度1バイト+元コマンド6バイト)であるため、「8」を16進表記したものである。   The original command shown in FIG. 5A indicates that the key generation command indicates that INS is “46”, and indicates that key generation is performed using an arbitrary 1-byte data indicated by “xx” in the figure as a parameter. ing. Lc is “01” because “1” is expressed in hexadecimal since the data portion is 1 byte. The real-time command shown in FIG. 5B is created by encapsulating the original command shown in FIG. As shown in FIG. 5B, the real-time command is obtained by adding an ID and priority to the original command as a new data part. The combination of the leading CLA and INS being “D0” “00” indicates a real-time command as described above. Lc is “08” because the data part is 8 bytes (ID 1 byte + priority 1 byte + original command 6 bytes), so “8” is expressed in hexadecimal.

ここからは、図4に示したVERIFYコマンドを処理する場合と、図4に示したVERIFYコマンドと図5に示した鍵生成コマンドを順序を代えて送信する場合の計3通りについて説明する。なお、以下のいずれの場合においても、VERIFYコマンドのIDは「01」、優先度は「01」とし、鍵生成コマンドのIDは「0A」、優先度は「80」とする。優先度については、「00」が最優先であり、「FF」が一番優先度が低いものとする。   From now on, a total of three cases will be described: the case of processing the VERIFY command shown in FIG. 4 and the case of transmitting the VERIFY command shown in FIG. 4 and the key generation command shown in FIG. In any of the following cases, the ID of the VERIFY command is “01”, the priority is “01”, the ID of the key generation command is “0A”, and the priority is “80”. As for the priority, “00” is the highest priority and “FF” is the lowest priority.

まず、端末10が、VERIFYコマンドを利用して暗証番号の照合を行う場合の処理について説明する。この場合、端末は、端末のキーから入力された暗証番号をデータ部のデータとして組み込んだ、図4(a)に示したようなVERIFYコマンドを元コマンドとして生成する。さらに、端末は、この元コマンドをカプセル化して、図4(b)に示したようなリアルタイムコマンドを作成する。この際、端末は、IDと優先度を決定してリアルタイムコマンドの6バイト目と7バイト目に設定する。端末は、IDについては、発行中の他のコマンドと重複しないIDを所定のルールで決定して付与し、優先度は、そのコマンドに応じて所定の数値範囲内であって、他のコマンドと重複しないものを付与する。作成されたリアルタイムコマンドは、端末からICカード1に送信される。   First, a process in the case where the terminal 10 collates a password using the VERIFY command will be described. In this case, the terminal generates, as an original command, a VERIFY command as shown in FIG. 4A, in which the code number input from the terminal key is incorporated as data in the data part. Further, the terminal encapsulates the original command to create a real-time command as shown in FIG. At this time, the terminal determines the ID and priority, and sets them in the sixth and seventh bytes of the real-time command. The terminal determines and assigns an ID that does not overlap with other commands being issued according to a predetermined rule for the ID, and the priority is within a predetermined numerical range according to the command. Give something that doesn't overlap. The created real-time command is transmitted from the terminal to the IC card 1.

すると、ICカード1では、割込みが発生し、OS(CPU)が、リアルタイムコマンドを受信する。続いて、受信したリアルタイムコマンドのCLA、INSをチェックする。この場合、図4(a)に示したように「D0」「00」であるので、リアルタイムコマンドであると判断する。次に、6バイト目のIDを読取り、読取ったIDが処理待ちリストに存在するかどうかを確認する。この時点では、処理待ちリストには、コマンドが1つも存在せず、従ってID=「01」のコマンドは存在しないため、7バイト目の優先度を読み取るとともに、8バイト目以降の元コマンドを取り出す。そして、ID、優先度、元コマンドを処理待ちリストに登録する。これにより割込みが終了し、OSは、処理待ちリストの確認を行う。そして、優先度「01」のVERIFYコマンドを実行する。OSはVERIFYコマンドの処理結果を送信バッファに格納した後、端末に送信し、処理待ちリストから削除する。処理待ちリストには、登録されたコマンドがなくなるため、端末からコマンドを受信して割り込みが入るまでループ処理に入ることになる。端末では、受信したコマンドのIDが1であることを確認し、レスポンスを処理する。レスポンスとは、例えば、VERIFYの結果がOKであるかNGであるかということである。   Then, an interrupt occurs in the IC card 1, and the OS (CPU) receives a real time command. Subsequently, CLA and INS of the received real-time command are checked. In this case, since it is “D0” “00” as shown in FIG. 4A, it is determined to be a real-time command. Next, the 6th byte ID is read, and it is confirmed whether or not the read ID exists in the processing waiting list. At this time, since there is no command in the processing waiting list, and therefore there is no command with ID = “01”, the priority of the seventh byte is read and the original command after the eighth byte is taken out. . Then, the ID, priority, and original command are registered in the processing waiting list. As a result, the interruption ends, and the OS checks the processing waiting list. Then, the VERIFY command with the priority “01” is executed. The OS stores the processing result of the VERIFY command in the transmission buffer, transmits it to the terminal, and deletes it from the processing waiting list. Since there is no registered command in the processing waiting list, the loop processing is entered until an interrupt is received after receiving a command from the terminal. The terminal confirms that the received command ID is 1, and processes the response. The response is, for example, whether the result of VERIFY is OK or NG.

続いて、鍵生成中にVERIFYコマンドを発行した場合について説明する。鍵生成コマンドについては、端末が適当なパラメータを設定し、図5(a)に示したような鍵生成コマンドを元コマンドとして生成する。さらに、端末は、この元コマンドをカプセル化して、図5(b)に示したようなリアルタイムコマンドを作成した後、ICカード1に送信する。   Next, a case where a VERIFY command is issued during key generation will be described. For the key generation command, the terminal sets appropriate parameters and generates a key generation command as shown in FIG. 5A as the original command. Further, the terminal encapsulates this original command, creates a real-time command as shown in FIG. 5B, and transmits it to the IC card 1.

すると、ICカード1では、割込みが発生し、OS(CPU)が、リアルタイムコマンドを受信する。続いて、受信したリアルタイムコマンドのCLA、INSをチェックする。この場合、図5(a)に示したように「D0」「00」であるので、リアルタイムコマンドであると判断する。次に、6バイト目のIDを読取り、読取ったIDが処理待ちリストに存在するかどうかを確認する。この時点では、処理待ちリストには、コマンドが1つも存在せず、従ってID=「0A」のコマンドは存在しないため、7バイト目の優先度を読み取るとともに、8バイト目以降の元コマンドを取り出す。そして、ID、優先度、元コマンドを処理待ちリストに登録する。これにより割込みが終了し、OSは、処理待ちリストの確認を行う。そして、優先度=「0A」であり、処理待ちリスト内で最も優先度が高い鍵生成コマンドを実行する。   Then, an interrupt occurs in the IC card 1, and the OS (CPU) receives a real time command. Subsequently, CLA and INS of the received real-time command are checked. In this case, since it is “D0” “00” as shown in FIG. 5A, it is determined to be a real-time command. Next, the 6th byte ID is read, and it is confirmed whether or not the read ID exists in the processing waiting list. At this time, there is no command in the processing waiting list, and therefore there is no command with ID = “0A”. Therefore, the priority of the seventh byte is read and the original command after the eighth byte is taken out. . Then, the ID, priority, and original command are registered in the processing waiting list. As a result, the interruption ends, and the OS checks the processing waiting list. Then, the key generation command having the highest priority in the processing waiting list is executed with the priority = “0A”.

ICカード1上のOSが鍵生成コマンドを処理している状態で、端末は、上記と同様にして、図4(b)に示したようなリアルタイムコマンドを作成し、ICカード1に送信する。ICカード1では、割込みが発生し、実行中の鍵生成コマンドを再開可能な状態で中断する。そして、OS(CPU)は、リアルタイムコマンドを受信する。続いて、受信したリアルタイムコマンドのCLA、INSをチェックする。この場合、図4(a)に示したように「D0」「00」であるので、リアルタイムコマンドであると判断する。次に、6バイト目のIDを読取り、読取ったIDが処理待ちリストに存在するかどうかを確認する。ID=「01」のコマンドは存在しないため、7バイト目の優先度を読み取るとともに、8バイト目以降の元コマンドを取り出す。そして、ID、優先度、元コマンドを処理待ちリストに登録する。これにより割込みが終了し、OSは、処理待ちリストの確認を行う。この時点における処理待ちリストの状態を図6に示す。そして、優先度「01」であり、処理待ちリスト内で最も優先度が高いVERIFYコマンドを実行する。OSはVERIFYコマンドの処理結果を送信バッファに格納した後、端末に送信し、処理待ちリストから削除する。一方、端末では、受信したコマンドのIDが「01」であることを確認し、レスポンスを処理する。OSは、さらに処理待ちリストの確認を行う。そして、優先度「80」であり、処理待ちリスト内で最も優先度が高い鍵生成コマンドを実行する。この際、中断された時点までの続きから行われることになる。OSは鍵生成コマンドの処理結果を送信バッファに格納した後、端末に送信し、処理待ちリストから削除する。処理待ちリストには、登録されたコマンドがなくなるため、端末からコマンドを受信して割り込みが入るまでループ処理に入ることになる。端末では、受信したコマンドのIDが「0A」であることを確認し、レスポンスを処理する。このレスポンスとは、例えば、鍵生成の結果がOKであるかNGであるかということである。   While the OS on the IC card 1 is processing the key generation command, the terminal creates a real-time command as shown in FIG. 4B and transmits it to the IC card 1 in the same manner as described above. In the IC card 1, an interrupt occurs, and the key generation command being executed is suspended in a resumable state. Then, the OS (CPU) receives a real time command. Subsequently, CLA and INS of the received real-time command are checked. In this case, since it is “D0” “00” as shown in FIG. 4A, it is determined to be a real-time command. Next, the 6th byte ID is read, and it is confirmed whether or not the read ID exists in the processing waiting list. Since there is no command with ID = “01”, the priority of the seventh byte is read and the original command after the eighth byte is taken out. Then, the ID, priority, and original command are registered in the processing waiting list. As a result, the interruption ends, and the OS checks the processing waiting list. FIG. 6 shows the state of the processing waiting list at this time. Then, the VERIFY command having the priority “01” and the highest priority in the processing waiting list is executed. The OS stores the processing result of the VERIFY command in the transmission buffer, transmits it to the terminal, and deletes it from the processing waiting list. On the other hand, the terminal confirms that the ID of the received command is “01” and processes the response. The OS further checks the processing waiting list. Then, the key generation command having the priority “80” and the highest priority in the processing waiting list is executed. At this time, it is performed from the continuation to the point of interruption. The OS stores the processing result of the key generation command in the transmission buffer, transmits it to the terminal, and deletes it from the processing waiting list. Since there is no registered command in the processing waiting list, a loop processing is entered until an interrupt is received after receiving a command from the terminal. The terminal confirms that the received command ID is “0A” and processes the response. This response is, for example, whether the result of key generation is OK or NG.

次に、逆にVERIFY中に鍵生成コマンドを発行した場合について説明する。端末は、上記と同様にして、図4(b)に示したようなVERIFYのリアルタイムコマンドを作成し、ICカード1に送信する。すると、ICカード1では、割込みが発生し、OS(CPU)が、リアルタイムコマンドを受信する。続いて、受信したリアルタイムコマンドのCLA、INSをチェックする。この場合、図4(b)に示したように「D0」「00」であるので、リアルタイムコマンドであると判断する。次に、6バイト目のIDを読取り、読取ったIDが処理待ちリストに存在するかどうかを確認する。ID=「01」のコマンドは存在しないため、7バイト目の優先度を読み取るとともに、8バイト目以降の元コマンドを取り出す。そして、ID、優先度、元コマンドを処理待ちリストに登録する。これにより割込みが終了し、OSは、処理待ちリストの確認を行う。そして、優先度「01」であり、処理待ちリスト内で最も優先度が高いVERIFYコマンドを実行する。   Next, the case where a key generation command is issued during VERIFY will be described. The terminal creates a VERIFY real-time command as shown in FIG. 4B and transmits it to the IC card 1 in the same manner as described above. Then, an interrupt occurs in the IC card 1, and the OS (CPU) receives a real time command. Subsequently, CLA and INS of the received real-time command are checked. In this case, since it is “D0” “00” as shown in FIG. 4B, it is determined to be a real-time command. Next, the 6th byte ID is read, and it is confirmed whether or not the read ID exists in the processing waiting list. Since there is no command with ID = “01”, the priority of the seventh byte is read and the original command after the eighth byte is taken out. Then, the ID, priority, and original command are registered in the processing waiting list. As a result, the interruption ends, and the OS checks the processing waiting list. Then, the VERIFY command having the priority “01” and the highest priority in the processing waiting list is executed.

ICカード1上のOSがVERIFYコマンドを処理している状態で、端末は、上記と同様にして、図5(b)に示したような鍵生成のリアルタイムコマンドを作成し、ICカード1に送信する。ICカード1では、割込みが発生し、実行中のVERIFYコマンドを再開可能な状態で中断する。そして、OS(CPU)は、リアルタイムコマンドを受信する。続いて、受信したリアルタイムコマンドのCLA、INSをチェックする。この場合、図4(a)に示したように「D0」「00」であるので、リアルタイムコマンドであると判断する。次に、6バイト目のIDを読取り、読取ったIDが処理待ちリストに存在するかどうかを確認する。ID=「0A」のコマンドは存在しないため、7バイト目の優先度を読み取るとともに、8バイト目以降の元コマンドを取り出す。そして、ID、優先度、元コマンドを処理待ちリストに登録する。これにより割込みが終了し、OSは、処理待ちリストの確認を行う。そして、優先度「01」であり、処理待ちリスト内で最も優先度が高いVERIFYコマンドを実行する。この際、中断された時点までの続きから行われることになる。OSはVERIFYコマンドの処理結果を送信バッファに格納した後、端末に送信し、処理待ちリストから削除する。一方、端末では、受信したコマンドのIDが1であることを確認し、レスポンスを処理する。OSは、さらに処理待ちリストの確認を行う。そして、優先度「80」であり、処理待ちリスト内で最も優先度が高い鍵生成コマンドを実行する。OSは鍵生成コマンドの処理結果を送信バッファに格納した後、端末に送信し、処理待ちリストから削除する。処理待ちリストには、登録されたコマンドがなくなるため、端末からコマンドを受信して割り込みが入るまでループ処理に入ることになる。端末では、受信したコマンドのIDが「0A」であることを確認し、レスポンスを処理する。このレスポンスとは、例えば、鍵生成の結果がOKであるかNGであるかということである。   While the OS on the IC card 1 is processing the VERIFY command, the terminal creates a key generation real-time command as shown in FIG. To do. In the IC card 1, an interrupt occurs, and the VERIFY command being executed is suspended in a state where it can be resumed. Then, the OS (CPU) receives a real time command. Subsequently, CLA and INS of the received real-time command are checked. In this case, since it is “D0” “00” as shown in FIG. 4A, it is determined to be a real-time command. Next, the 6th byte ID is read, and it is confirmed whether or not the read ID exists in the processing waiting list. Since there is no command with ID = “0A”, the priority of the seventh byte is read and the original command after the eighth byte is taken out. Then, the ID, priority, and original command are registered in the processing waiting list. As a result, the interruption ends, and the OS checks the processing waiting list. Then, the VERIFY command having the priority “01” and the highest priority in the processing waiting list is executed. At this time, it is performed from the continuation to the point of interruption. The OS stores the processing result of the VERIFY command in the transmission buffer, transmits it to the terminal, and deletes it from the processing waiting list. On the other hand, the terminal confirms that the ID of the received command is 1, and processes the response. The OS further checks the processing waiting list. Then, the key generation command having the priority “80” and the highest priority in the processing waiting list is executed. The OS stores the processing result of the key generation command in the transmission buffer, transmits it to the terminal, and deletes it from the processing waiting list. Since there is no registered command in the processing waiting list, the loop processing is entered until an interrupt is received after receiving a command from the terminal. The terminal confirms that the received command ID is “0A” and processes the response. This response is, for example, whether the result of key generation is OK or NG.

本発明に係るICカードの機能ブロック図である。It is a functional block diagram of the IC card according to the present invention. 元コマンドおよびリアルタイムコマンドの形式を示す図である。It is a figure which shows the format of an original command and a real-time command. ICカード1におけるCPU4の処理全体の流れを示すフローチャートである。4 is a flowchart showing the overall processing flow of a CPU 4 in the IC card 1. VERIFYコマンドについての、元コマンド、リアルタイムコマンドのデータ配列を示す図である。It is a figure which shows the data arrangement | sequence of the original command and real time command regarding a VERIFY command. 鍵生成コマンドについての、元コマンド、リアルタイムコマンドのデータ配列を示す図である。It is a figure which shows the data arrangement | sequence of the original command and real-time command regarding a key generation command. 処理待ちリストの一例を示す図である。It is a figure which shows an example of a process waiting list.

符号の説明Explanation of symbols

1・・・ICカード
2・・・通信I/F
3・・・通信検知手段
4・・・CPU
5・・・割込部
6・・・情報記憶領域
10・・・端末

1 ... IC card 2 ... Communication I / F
3 ... Communication detection means 4 ... CPU
5 ... Interrupt unit 6 ... Information storage area 10 ... Terminal

Claims (3)

ICカード上において、処理待ちリストに記録された優先度に従って、コマンドの処理を行うにあたり、
外部からコマンドを受信した際に、当該コマンドの処理を中断する段階と、受信したコマンドがリアルタイムコマンドであるかどうか判別する段階と、判別の結果、リアルタイムコマンドである場合に、カプセル化された元コマンドを抽出し、リアルタイムコマンドに記録された優先度と共に処理待ちリストに記録する段階と、を有し、
前記リアルタイムコマンドは、前記元コマンドの前にIDと優先度を付加してデータ部としてカプセル化すると共に、元コマンドのヘッダ部分と同一の役割を果たす部分をカプセル化したデータ部の前に付加することにより作成されたものであることを特徴とするリアルタイムコマンドの処理方法。
In processing the command according to the priority recorded in the processing waiting list on the IC card,
When a command is received from the outside, the processing of the command is interrupted, the step of determining whether the received command is a real-time command, and if the result of the determination is a real-time command, the encapsulated source extracting the commands, have a, a step of recording the process waiting list with recorded priority real-time command,
The real-time command, the addition to encapsulating as data unit adds the ID and priority before the original command, prepended to the data unit that encapsulates the header portion of the same serving portion of Motoko command method of processing real-time commands, characterized in der Rukoto those created by.
処理待ちリストに記録された優先度に従って、CPU上のOSがコマンドの実行を行い、前記CPUが、割込部からの指示に基づいて、実行中のコマンドの処理を中断してコマンドの受信を行い、受信したコマンドがリアルタイムコマンドであるかどうか判別し、判別の結果、リアルタイムコマンドである場合に、カプセル化された元コマンドを抽出し、リアルタイムコマンドに記録された優先度と共に処理待ちリストに記録する機能を有するICカードに対してリアルタイムコマンドを送信する端末であって、
元コマンドの前にIDと優先度を付加してデータ部としてカプセル化すると共に、元コマンドのヘッダ部分と同一の役割を果たす部分をカプセル化したデータ部の前に付加したコマンドを作成し、当該作成したリアルタイムコマンドを前記ICカードに送信することを特徴とするICカード組み込み端末。
The OS on the CPU executes the command according to the priority recorded in the processing waiting list, and the CPU interrupts the processing of the command being executed and receives the command based on the instruction from the interrupt unit. Determine whether the received command is a real-time command, and if the result is a real-time command, extract the original encapsulated command and record it in the processing waiting list with the priority recorded in the real-time command A terminal that transmits a real-time command to an IC card having a function of:
With encapsulating adds the ID and priority as the data portion before Motoko command, it creates a command which is prepended to the data unit that encapsulates the header portion of the same serving portion of Motoko command , IC card embedded terminal, characterized by transmitting real-time commands the created in the IC card.
処理待ちリストに記録された優先度に従って、CPU上のOSがコマンドの実行を行うICカードであって、
ICカード組み込み端末からの通信を検知する通信検知手段と、
前記通信検知手段からの信号に基づいて割込みを発生する割込部と、
処理待ちリストを記録する情報記憶領域と、を有し、
前記CPUは、割込部からの指示に基づいて、実行中のコマンドの処理を中断してコマンドの受信を行い、受信したコマンドがリアルタイムコマンドであるかどうか判別し、判別の結果、リアルタイムコマンドである場合に、カプセル化された元コマンドを抽出し、リアルタイムコマンドに記録された優先度と共に処理待ちリストに記録する機能を有し、
前記リアルタイムコマンドは、前記ICカード組み込み端末により元コマンドの前にIDと優先度を付加してデータ部としてカプセル化されると共に、元コマンドのヘッダ部分と同一の役割を果たす部分をカプセル化したデータ部の前に付加されたコマンドであることを特徴とするICカード。
In accordance with the priority recorded in the processing waiting list, the OS on the CPU is an IC card that executes commands,
Communication detection means for detecting communication from an IC card embedded terminal ;
An interrupt unit that generates an interrupt based on a signal from the communication detection unit;
An information storage area for recording a waiting list for processing,
Based on the instruction from the interrupt unit, the CPU interrupts the processing of the command being executed and receives the command, determines whether the received command is a real-time command, in some cases, to extract the original command encapsulated, have a function of recording the process waiting list with priority recorded in real time command,
The real-time command is encapsulated as a data part by adding an ID and priority in front of the original command by the IC card embedded terminal, and encapsulating a part that plays the same role as the header part of the original command IC card according to claim Oh Rukoto in appended command before the Department.
JP2004279213A 2004-09-27 2004-09-27 Real-time command processing method, IC card, and embedded terminal Expired - Fee Related JP4620418B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004279213A JP4620418B2 (en) 2004-09-27 2004-09-27 Real-time command processing method, IC card, and embedded terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004279213A JP4620418B2 (en) 2004-09-27 2004-09-27 Real-time command processing method, IC card, and embedded terminal

Publications (2)

Publication Number Publication Date
JP2006092416A JP2006092416A (en) 2006-04-06
JP4620418B2 true JP4620418B2 (en) 2011-01-26

Family

ID=36233304

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004279213A Expired - Fee Related JP4620418B2 (en) 2004-09-27 2004-09-27 Real-time command processing method, IC card, and embedded terminal

Country Status (1)

Country Link
JP (1) JP4620418B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009043114A (en) * 2007-08-10 2009-02-26 Dainippon Printing Co Ltd Ic card and program for ic card

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001504955A (en) * 1996-07-30 2001-04-10 オベルテュール カード システムズ ソシエテ アノニム IC card reader with improved man-machine interface
JP2003317039A (en) * 2002-04-24 2003-11-07 Hitachi Ltd Command control method, ic card use terminal device, and memory card
JP2004110276A (en) * 2002-09-17 2004-04-08 Nippon Telegr & Teleph Corp <Ntt> Content distribution device, content distribution processing method, content distribution system program and recording medium therefor

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001504955A (en) * 1996-07-30 2001-04-10 オベルテュール カード システムズ ソシエテ アノニム IC card reader with improved man-machine interface
JP2003317039A (en) * 2002-04-24 2003-11-07 Hitachi Ltd Command control method, ic card use terminal device, and memory card
JP2004110276A (en) * 2002-09-17 2004-04-08 Nippon Telegr & Teleph Corp <Ntt> Content distribution device, content distribution processing method, content distribution system program and recording medium therefor

Also Published As

Publication number Publication date
JP2006092416A (en) 2006-04-06

Similar Documents

Publication Publication Date Title
US20070223696A1 (en) Secure Device and Relay Terminal
US20100175067A1 (en) Method for processing application commands from physical channels using a portable electronic device and corresponding device and system
US8700827B2 (en) Matching method, system and device for data exchange between a communication object and a processing unit
JP4649578B2 (en) IC card information authentication system
JP6516133B2 (en) Communication device and communication system
US20120067947A1 (en) Ic card, mobile electronic device and data processing method in ic card
WO2022252561A1 (en) Card swiping method, card controller, electronic device and storage medium
US10143026B2 (en) Communication device
JP4283611B2 (en) IC card remote control system
US20110197203A1 (en) Communication device, communication method and program
JP7131548B2 (en) Communication device and method
JP4620418B2 (en) Real-time command processing method, IC card, and embedded terminal
JP6241340B2 (en) Information processing apparatus, information processing method, and information processing program
EP2717193B1 (en) IC card, portable electronic device, and reader/ writer
JP4527434B2 (en) Portable information storage medium and program thereof
CN101566975A (en) Method for communication with safe mobile memory apparatus
JP5838713B2 (en) IC chip, UIM, processing method in IC chip, IC chip processing program, and portable terminal
CN107425975B (en) Communication device and method executed by communication device
KR100884710B1 (en) System for controlling sim card data using near field communication and method therof
JP7468754B1 (en) ELECTRONIC INFORMATION STORAGE MEDIUM, IC CHIP, IC CARD, RECEPTION BLOCK PROCESSING METHOD, AND PROGRAM
JP5855816B2 (en) IC chip, processing method in IC chip, IC chip processing program, and portable terminal
CN107644001B (en) Peripheral interface chip and data transmission method thereof
JP2543861B2 (en) Data transmission method
JP5437163B2 (en) Information processing method, information processing apparatus, and information processing system
JP2002236885A (en) Ic card reader/writer and data transmission method therefor

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20070709

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100311

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100507

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

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

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

Free format text: PAYMENT UNTIL: 20131105

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees