JP4840012B2 - IC card with mode change function and IC card program - Google Patents

IC card with mode change function and IC card program Download PDF

Info

Publication number
JP4840012B2
JP4840012B2 JP2006206814A JP2006206814A JP4840012B2 JP 4840012 B2 JP4840012 B2 JP 4840012B2 JP 2006206814 A JP2006206814 A JP 2006206814A JP 2006206814 A JP2006206814 A JP 2006206814A JP 4840012 B2 JP4840012 B2 JP 4840012B2
Authority
JP
Japan
Prior art keywords
mode
command
data
card
apdu
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
JP2006206814A
Other languages
Japanese (ja)
Other versions
JP2008033669A (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 JP2006206814A priority Critical patent/JP4840012B2/en
Publication of JP2008033669A publication Critical patent/JP2008033669A/en
Application granted granted Critical
Publication of JP4840012B2 publication Critical patent/JP4840012B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、ICチップが実装されたカード媒体であるICカードに関し、更に詳しくは、上位装置とICカード間の通信時間を短縮する技術に関する。   The present invention relates to an IC card that is a card medium on which an IC chip is mounted, and more particularly to a technique for shortening communication time between a host device and an IC card.

ICカードに実装されたICチップ近傍を短冊状に切り取ったSIM(Subscriber Identity Module)は、上位装置に組み込まれ、上位装置で利用するデータを暗号化/復号するデバイスとして利用されている。   A SIM (Subscriber Identity Module) obtained by cutting the vicinity of an IC chip mounted on an IC card into a strip shape is incorporated in a host device and used as a device for encrypting / decrypting data used in the host device.

SIMを上位装置に組み込む一例としては、同一出願人は、インターネットに接続できる監視カメラにSIMを搭載し、監視カメラが撮像した動画をSIMで暗号化するシステムを出願している(特許文献1)。   As an example of incorporating a SIM into a host device, the same applicant has applied for a system in which a SIM is mounted on a surveillance camera that can be connected to the Internet, and a moving image captured by the surveillance camera is encrypted by the SIM (Patent Document 1). .

監視カメラなどの上位装置とSIMとを組み合わせることで、データを暗号化するために施す上位装置の変更点が最小限に抑えられ、更に、暗号アルゴリズム交換も容易になるメリットが生じる。   By combining the host device such as a monitoring camera and the SIM, there is a merit that the change of the host device to be performed for encrypting the data can be minimized and that the encryption algorithm can be easily exchanged.

しかしながら、SIMの通信速度は、標準で9600bpsと一般的なネットワークや無線通信速度と比べて非常に遅く、上位装置にSIMを組み込み利用する際は、上位装置とSIM間の通信時間がボトルネックとなってしまう。このため、上位装置とSIM間の通信時間を短縮する上で、上位装置とSIM間の通信量を減らすことは大変メリットがある。   However, the communication speed of the SIM is 9600 bps as standard, which is very slow compared to a general network and wireless communication speed. When the SIM is embedded in the host device, the communication time between the host device and the SIM is a bottleneck. turn into. For this reason, in reducing the communication time between the host device and the SIM, it is very advantageous to reduce the communication amount between the host device and the SIM.

近年では、特許文献2で開示されているようなUSBインターフェースを搭載し、通信速度を飛躍的に向上させることの可能なICチップも提案されてきているが、上位装置とSIM間の通信量を減らすことにメリットがあることにかわりはない。   In recent years, there has also been proposed an IC chip equipped with a USB interface as disclosed in Patent Document 2 and capable of dramatically improving the communication speed. However, the amount of communication between the host device and the SIM has been reduced. There is no substitute for the benefits of reducing it.

上位装置とSIM間の通信量を少なくする一つの発明として、同一出願人は、繰り返して利用することのできるパターンがコマンドに含まれる場合、あらかじめSIM内にこのパターンを登録し、SIMへはこのパターン番号を送ることで、上位装置とSIM間の通信量を減らす発明を出願している(特許文献3)。
特願2005−108601号公報 特表2003−532936号公報 特願2005−265605号公報
As one invention for reducing the amount of communication between the host device and the SIM, if the command includes a pattern that can be used repeatedly, the same applicant registers this pattern in the SIM in advance, and this is registered in the SIM. An application for reducing the amount of communication between the host device and the SIM by sending a pattern number has been filed (Patent Document 3).
Japanese Patent Application No. 2005-108601 Special table 2003-532936 gazette Japanese Patent Application No. 2005-265605

確かに、特許文献3の技術を用いることで、繰り返しのパターンがコマンドに含まれる場合、あらかじめSIM内にパターンを登録し、繰り返しのパターンの代わりにパターン番号を上位装置からSIMに送信することで通信量を削減することができる。   Certainly, by using the technique of Patent Document 3, when a repeated pattern is included in the command, the pattern is registered in the SIM in advance, and the pattern number is transmitted from the host device to the SIM instead of the repeated pattern. The amount of communication can be reduced.

しかしながら、あるコマンドの処理を連続してSIMに実行させる場合、上位装置側では、コマンドを実行させるごとにパターン番号をSIMに送信する必要があるし、また、SIM側では、受信したパターン番号を解釈しなければならない。   However, when processing a certain command continuously in the SIM, the host device side needs to transmit the pattern number to the SIM every time the command is executed, and on the SIM side, the received pattern number is Must be interpreted.

そこで、本発明は、あるコマンドの処理を連続してSIMに実行させる場合、上位装置とSIM間で繰り返し伝送されるパターン(例えば、コマンドコード)を省略することができ、更に、このパターンを識別するパターン番号でさえも省略することのできるICカード、およびICカードプログラムを提供することを目的とする。   Therefore, the present invention can omit a pattern (for example, command code) that is repeatedly transmitted between the host device and the SIM when the processing of a certain command is continuously executed by the SIM, and further identifies this pattern. An object of the present invention is to provide an IC card and an IC card program that can omit even a pattern number.

上述した課題を解決する第1の発明は、上位装置に組み込まれ利用されるICカードであって、前記ICカードは、前記ICカードのモードを示すモード情報をメモリに記憶し、前記モード情報によって、少なくとも、コマンドAPDU及びレスポンスAPDUを前記上位装置とやり取りする第1のモード、或いは、前記コマンドAPDUのデータ部であるコマンドデータ及び前記レスポンスAPDUのデータ部であるレスポンスデータのみを前記上位装置とやり取りする第2のモードのいずれかのモードが示され、前記ICカードは、前記モード情報を操作するモード変更コマンドと、前記モード情報を参照し、前記モード情報に基づいて前記ICカードの振舞いを変更する制御手段とを備え、前記モード変更コマンドは特定の処理モジュールに関連付けられ、更に、前記モード変更コマンドは、前記第1のモードで前記コマンドAPDUを処理するときには、前記モード情報を操作して前記ICカードのモードを前記第2のモードに遷移させ、前記第2のモードに遷移してからは、処理した前記コマンドデータのデータ量をカウントし、カウントしたデータ量が前記モード変更コマンドの前記コマンドAPDUのデータ部で示される前記コマンドデータの総量を超えたときに、前記モード情報を操作して前記ICカードのモードを前記第1のモードに復帰させ、前記制御手段は、前記モード情報が前記第2のモードを示すときは、前記上位装置から送信された前記コマンドデータの処理を前記モード変更コマンドに委任し、前記モード変更コマンドから得られる前記レスポンスデータを前記上位装置に送信することを特徴とする。   A first invention that solves the above-described problem is an IC card that is incorporated and used in a host device, wherein the IC card stores mode information indicating a mode of the IC card in a memory, and the mode information 1st mode for exchanging at least a command APDU and a response APDU with the higher-level device, or only exchanging command data as a data portion of the command APDU and response data as a data portion of the response APDU with the higher-level device Any one of the second modes is indicated, and the IC card refers to the mode change command for operating the mode information and the mode information, and changes the behavior of the IC card based on the mode information. And the mode change command is a specific processing module. Further, when the command change PDU is processed in the first mode, the mode change command operates the mode information to change the mode of the IC card to the second mode, and After the transition to the second mode, the data amount of the processed command data is counted, and the counted data amount exceeds the total amount of the command data indicated by the data part of the command APDU of the mode change command. When the mode information is manipulated to return the mode of the IC card to the first mode, the control means is transmitted from the host device when the mode information indicates the second mode. The command data processing is delegated to the mode change command, and the response obtained from the mode change command And transmitting the over data to the host device.

更に、第2の発明は、第1の発明に記載のICカードであって、前記モード変更コマンドに関連付けられた処理モジュールは、前記コマンドデータを暗号化/複合するモジュールであることを特徴とする。   Further, the second invention is the IC card according to the first invention, wherein the processing module associated with the mode change command is a module for encrypting / combining the command data. .

更に、第3の発明は、少なくとも、コマンドAPDU及びレスポンスAPDUを前記上位装置とやり取りする第1のモード、或いは、前記コマンドAPDUのデータ部であるコマンドデータ及び前記レスポンスAPDUのデータ部であるレスポンスデータのみを前記上位装置とやり取りする第2のモードのいずれかのモードが示されるモード情報を記憶したICカードに実装されるICカードプログラムであって、特定の処理に関連付けられ、前記第1のモードで前記コマンドAPDUを処理するときには、前記モード情報を操作して前記ICカードのモードを前記第2のモードに遷移させ、前記第2のモードに遷移してからは、処理した前記コマンドデータのデータ量をカウントし、カウントしたデータ量が前記コマンドAPDUのデータ部で示される前記コマンドデータの総量を超えたときに、前記モード情報を操作して前記ICカードのモードを前記第1のモードに復帰させるモード変更コマンド機能と、前記モード情報が前記第2のモードを示すときは、前記上位装置から送信された前記コマンドデータの処理を前記モード変更コマンド機能に委任し、前記モード変更コマンドから得られる前記レスポンスデータを前記上位装置に送信する制御機能として、前記ICカードのCPUを動作させるためのICカードプログラムである。   Further, the third aspect of the present invention is at least a first mode in which a command APDU and a response APDU are exchanged with the host device, or command data that is a data part of the command APDU and response data that is a data part of the response APDU. Is an IC card program mounted on an IC card storing mode information indicating any one of the second modes for exchanging only with the host device, and is associated with a specific process, and the first mode When processing the command APDU, the mode information is manipulated to change the mode of the IC card to the second mode, and after the transition to the second mode, the processed command data The amount of counted data is the data of the command APDU A mode change command function for operating the mode information to return the mode of the IC card to the first mode when the total amount of the command data shown in FIG. As a control function for delegating the processing of the command data transmitted from the host device to the mode change command function and transmitting the response data obtained from the mode change command to the host device. It is an IC card program for operating the CPU of the card.

更に、第4の発明は、第3の発明に記載のICカードプログラムにおいて、前記モード変更コマンド機能に関連付けられた処理は、前記コマンドデータを暗号化/複合する処理であることを特徴とするICカードプログラムである。   Furthermore, a fourth invention is the IC card program according to the third invention, wherein the process associated with the mode change command function is a process of encrypting / combining the command data. It is a card program.

上述した発明によれば、上述した第2のモードでは、上位装置とICカード間ではコマンドデータ/レスポンスデータが伝送されため、上位装置とICカード間の通信量を減らす効果が得られるばかりか、ICカードは、上位装置から受信したコマンドAPDUを毎回解釈する必要がなくなるため、ICカードの処理時間を短縮する効果が得られる。   According to the above-described invention, in the above-described second mode, command data / response data is transmitted between the host device and the IC card, so that an effect of reducing the communication amount between the host device and the IC card can be obtained. Since the IC card does not need to interpret the command APDU received from the host device every time, the effect of shortening the processing time of the IC card can be obtained.

更に、第2のモードで処理したコマンドデータのデータ量が総量に達した後は、コマンドAPDUのデータ部であるコマンドデータ及びレスポンスAPDUのデータ部であるレスポンスデータのみを前記上位装置とやり取りする第2のモードから、コマンドAPDU及びレスポンスAPDUを前記上位装置とやり取りする第1のモードに自動復帰するため、第2のモードに遷移した後でも、上位装置はISO/IEC7816などの規格に準拠した手順に従い、ICカードを利用したトランザクションを実行することができる。   Furthermore, after the amount of command data processed in the second mode reaches the total amount, only the command data that is the data portion of the command APDU and the response data that is the data portion of the response APDU are exchanged with the host device. In order to automatically return from the mode 2 to the first mode in which the command APDU and response APDU are exchanged with the host device, the host device is compliant with the ISO / IEC7816 standard even after the transition to the second mode. The transaction using the IC card can be executed.

更に、モード変更コマンドが有する処理モジュールを、平文を暗号化/複合するモジュールとすることで、上位装置が大量の平文を暗号化したときに処理時間を短縮できる。なお、第1のモードに自動復帰することで、暗号鍵の変更やICカードの認証など、モード変更コマンド以外の処理を行うことができる。   Furthermore, the processing module included in the mode change command is a module that encrypts / combines plaintext, so that the processing time can be shortened when the host device encrypts a large amount of plaintext. By automatically returning to the first mode, processing other than the mode change command, such as changing the encryption key and authenticating the IC card, can be performed.

なお、本発明において、ICカードとは、ICチップが実装されたカード媒体を意味し、上位装置と通信するためのインターフェースは接触/非接触を問うものではない。更に、本発明に係るICカードには、ICチップの周辺を短冊状に切り取ったSIM或いはUIMも含まれる。   In the present invention, an IC card means a card medium on which an IC chip is mounted, and an interface for communicating with a host device does not ask for contact / non-contact. Further, the IC card according to the present invention includes a SIM or UIM obtained by cutting the periphery of the IC chip into a strip shape.

ここから、図を参照しながら、本発明に係るSIMについて詳細に説明する。本発明に係るSIM1は、上位装置2と通信するモードとして2つのモードを備え、一つのモードは、APDU(Application Protocol Data Unit)を交換するISOモードであり、もう一つのモードは、APDUのデータ部のみを交換するデータモードである。   From here, the SIM according to the present invention will be described in detail with reference to the drawings. The SIM 1 according to the present invention includes two modes as modes for communicating with the host device 2, one mode is an ISO mode for exchanging APDU (Application Protocol Data Unit), and the other mode is APDU data. This is a data mode in which only parts are exchanged.

図1は、SIM1の振舞いを説明する図で、図1(a)は、APDUを交換するISOモードを説明する図で、図1(b)は、APDUのデータ部のみを交換するデータモードを説明する図である。   FIG. 1 is a diagram for explaining the behavior of SIM1, FIG. 1 (a) is a diagram for explaining an ISO mode for exchanging APDU, and FIG. 1 (b) is a data mode for exchanging only the data part of APDU. It is a figure explaining.

図1(a)に示したように、ISOモードは、ISO/IEC7816の手順に従い、上位装置2とSIM1間でAPDUを交換するモードで、上位装置2からSIM1に送信されるAPDUはコマンドAPDUと呼ばれ、このコマンドAPDUには、実行するコマンドを示すコマンドヘッダと、コマンドで利用されるコマンドデータが含まれる。   As shown in FIG. 1A, the ISO mode is a mode in which APDUs are exchanged between the upper apparatus 2 and the SIM 1 according to the procedure of ISO / IEC 7816. The APDU transmitted from the upper apparatus 2 to the SIM 1 is a command APDU. This command APDU includes a command header indicating a command to be executed and command data used in the command.

また、SIM1から上位装置2に送信されるAPDUはレスポンスAPDUと呼ばれ、このレスポンスAPDUには、コマンドのレスポンスデータと、コマンドの実行結果を示すステータスワード(SW: status word)が含まれる。   An APDU transmitted from the SIM 1 to the higher-level device 2 is called a response APDU, and the response APDU includes a response data of the command and a status word (SW: status word) indicating the execution result of the command.

図1(b)に示したように、SIM1がデータモードであるとき、上位装置2とSIM1間ではAPDUのデータ部のみが交換され、上位装置2からSIM1にはコマンドデータのみが送信され、SIM1から上位装置2にはレスポンスデータのみが送信される。   As shown in FIG. 1B, when the SIM1 is in the data mode, only the data part of the APDU is exchanged between the upper apparatus 2 and the SIM1, and only the command data is transmitted from the upper apparatus 2 to the SIM1. Only the response data is transmitted to the host device 2.

活性化されたときのSIM1のモードはISOモードで、SIM1は、ISOモードからデータモードへ遷移するトリガーとなるモード変更コマンドを備える。   When activated, the SIM1 mode is the ISO mode, and the SIM1 includes a mode change command that triggers a transition from the ISO mode to the data mode.

SIM1はモード変更コマンドを受信すると、SIM1のモードはISOモードからデータモードへと遷移し、データモードでは、SIM1は、上位装置2から送信されたコマンドデータをモード変更コマンドによって処理し、モード変更コマンドの処理結果であるレスポンスデータのみを上位装置2に送信する。   When the SIM1 receives the mode change command, the SIM1 mode transitions from the ISO mode to the data mode. In the data mode, the SIM1 processes the command data transmitted from the host device 2 by the mode change command, and the mode change command Only the response data that is the result of the above process is transmitted to the host device 2.

モード変更コマンドのデータ部には、データモードに遷移しているときに処理すべきコマンドデータの総量でが含まれ、データモードで処理したコマンドデータのデータ量が総量に達したときには、SIM1のモードは、データモードからISOモードに自動復帰する。   The data portion of the mode change command includes the total amount of command data to be processed when transitioning to the data mode. When the data amount of command data processed in the data mode reaches the total amount, the mode of the SIM1 Automatically returns from the data mode to the ISO mode.

SIM1が上述したデータモードを有することで、上位装置2とSIM1間の通信量を減らす効果が得られるばかりか、SIM1は、上位装置2から受信したコマンドAPDUを毎回解釈する必要がなくなるため、SIM1の処理時間を短縮する効果が得られる。   Since the SIM 1 has the above-described data mode, not only can the effect of reducing the communication amount between the upper apparatus 2 and the SIM 1 be obtained, but the SIM 1 does not need to interpret the command APDU received from the upper apparatus 2 every time. The effect of shortening the processing time is obtained.

更に、モード変更コマンドのデータ部に、データモードに遷移しているときに処理すべきコマンドデータの総量を含ませることで、非常に大きいデータ量のコマンドデータを処理することができる。   Furthermore, by including the total amount of command data to be processed when transitioning to the data mode in the data portion of the mode change command, it is possible to process command data having a very large data amount.

更に、コマンドデータを処理したコマンドデータのデータ量が総量に達した後は、SIM1のモードはデータモードからISOモードに自動復帰するため、データモードに遷移した後でも、上位装置2はISO/IEC7816に準拠した手順に従い、ICカードを利用したトランザクションを実行することができる。   Furthermore, since the SIM1 mode automatically returns from the data mode to the ISO mode after the data amount of the command data that has processed the command data reaches the total amount, the higher-level device 2 remains in ISO / IEC7816 even after the transition to the data mode. The transaction using the IC card can be executed according to the procedure conforming to the above.

ここから、本発明に係るSIM1についてより詳しく説明する。図2は、本発明に係るSIM1の外観図である。SIM1は、ICチップ10がモールドされたICモジュール1a周辺を約11.5mm×25mm状に切り取った形状をしており、SIM1の詳細な形状はGSM(Global System for Mobile communications)規格等で規格化されている。   From here, it demonstrates in more detail about SIM1 which concerns on this invention. FIG. 2 is an external view of the SIM 1 according to the present invention. The SIM1 has a shape obtained by cutting the periphery of the IC module 1a in which the IC chip 10 is molded into an approximately 11.5 mm × 25 mm shape, and the detailed shape of the SIM1 is standardized by the GSM (Global System for Mobile communications) standard, etc. Has been.

図3は、SIM1のICモジュール1aにモールドされるICチップ10のハードウェア構造図である。ICチップ10は、Vcc、Reset、Clock、I/O及びGnd用の外部端子を有し、このICチップ10には、中央演算装置11(Central Processing Unit、以下CPUと記す)に、バス17を介して、読み出し専用メモリ15(Read Only Memory、以下ROMと記す)、書換え可能なメモリとしてEEPROM16(Electrically Erasable Programmable Read-Only Memoryの略)、揮発性メモリとしてランダムアクセスメモリ14(Random Access Memory、以下RAMと記す)、暗号演算専用の回路である暗号演算回路12、及び、上位装置2とデータを通信するための通信I/F回路13などが接続されている。   FIG. 3 is a hardware structure diagram of the IC chip 10 molded in the IC module 1 a of the SIM 1. The IC chip 10 has external terminals for Vcc, Reset, Clock, I / O, and Gnd. The IC chip 10 has a bus 17 connected to a central processing unit 11 (Central Processing Unit, hereinafter referred to as CPU). Read-only memory 15 (Read Only Memory, hereinafter referred to as ROM), EEPROM 16 (Electrically Erasable Programmable Read-Only Memory) as rewritable memory, and Random Access Memory 14 (hereinafter referred to as Random Access Memory) as volatile memory. (Referred to as RAM), a cryptographic operation circuit 12 that is a dedicated circuit for cryptographic operations, a communication I / F circuit 13 for communicating data with the host device 2, and the like.

図4は、SIM1のソフトウェア構成図である。図4に示したように、SIM1は、上位装置2から送信された平文を暗号化する暗号鍵104をEEPROM16に記憶し、SIM1が遷移しているモードを示すモード情報105をRAM14などの揮発性メモリに記憶している。   FIG. 4 is a software configuration diagram of the SIM1. As shown in FIG. 4, the SIM 1 stores an encryption key 104 for encrypting plain text transmitted from the host device 2 in the EEPROM 16, and stores mode information 105 indicating a mode in which the SIM 1 is changing into a volatile memory such as the RAM 14. Stored in memory.

更に、SIM1は、図3で示したICチップ10のハードウェアを利用し、CPU11を動作させるプログラムとして、I/F回路13を制御し、上位装置2とデータ通信するための伝送制御モジュール103と、上位装置2から送信されたコマンドAPDUを解釈し、コマンドAPDUに対応するコマンドに処理を委任する手段となるディスパッチャ100(dispatcher)と、ディスパッチャ100から処理を委任される複数のコマンドからなるコマンド群106を備え、このコマンド群106には、上位装置2から送信された平文を暗号化する暗号化コマンド101と、暗号化コマンド101で利用される暗号鍵104をEEPROM16に書込む暗号鍵設定コマンド102が含まれる。   Further, the SIM 1 uses the hardware of the IC chip 10 shown in FIG. 3, controls the I / F circuit 13 as a program for operating the CPU 11, and a transmission control module 103 for data communication with the host device 2. , A command group including a dispatcher 100 (dispatcher) serving as means for delegating processing to a command corresponding to the command APDU and interpreting the command APDU transmitted from the host apparatus 2, and a command group delegating processing from the dispatcher 100 The command group 106 includes an encryption command 101 for encrypting plain text transmitted from the host device 2 and an encryption key setting command 102 for writing the encryption key 104 used in the encryption command 101 to the EEPROM 16. Is included.

更に、暗号化コマンド101は、暗号演算回路12を作動させ、暗号鍵104を用いて、所定のアルゴリズムで引渡されたデータを暗号化/複合する暗号モジュール107を有している。   Further, the encryption command 101 includes an encryption module 107 that operates the encryption arithmetic circuit 12 and encrypts / combines data delivered by a predetermined algorithm using the encryption key 104.

SIM1に備えられた伝送制御モジュール103とは、通信I/F回路13を制御し、上位装置2と確実にデータを送受信するためのプログラムで、例えば、ISO/IEC7816で定義されている伝送プロトコル(T0,T1)や、USB規格の伝送プロトコルに従い、誤り訂正や、再送制御などを行なうプログラムである。   The transmission control module 103 provided in the SIM 1 is a program for controlling the communication I / F circuit 13 and reliably transmitting / receiving data to / from the higher-level device 2. For example, a transmission protocol (defined in ISO / IEC 7816) T0, T1) and a program that performs error correction, retransmission control, and the like according to a USB standard transmission protocol.

ディスパッチャ100とは、本発明に係る制御手段を実現するプログラムであって、モード情報105を参照し、SIM1の振舞いを変更する。モード情報105がISOモードを示すとき、ディスパッチャ100は上位装置2から送信されたコマンドAPDUを解釈し、コマンド群106の中からコマンドAPDUを処理させるコマンドを選択し、選択したコマンドにコマンドAPDUの処理を委任する。   The dispatcher 100 is a program that realizes the control means according to the present invention, and refers to the mode information 105 to change the behavior of the SIM1. When the mode information 105 indicates the ISO mode, the dispatcher 100 interprets the command APDU transmitted from the host apparatus 2, selects a command for processing the command APDU from the command group 106, and processes the command APDU in the selected command. Delegate.

また、モード情報105がデータモードを示すとき、ディスパッチャ100は上位装置2から送信されたコマンドデータを解釈することなく、暗号化コマンド101にコマンドデータの処理を委任する。   When the mode information 105 indicates the data mode, the dispatcher 100 delegates the command data processing to the encrypted command 101 without interpreting the command data transmitted from the host apparatus 2.

暗号鍵設定コマンド102とは、ISO/IEC7816規格で定義されているWriteコマンドのように、上位装置2から受信したデータ(暗号鍵104)をEEPROM16に書き込むプログラムである。SIM1がこの暗号鍵設定コマンド102を備えることで、平文を暗号化する暗号鍵104を任意に変更することが可能である。   The encryption key setting command 102 is a program for writing the data (encryption key 104) received from the higher-level device 2 to the EEPROM 16, like the Write command defined in the ISO / IEC7816 standard. Since the SIM 1 includes the encryption key setting command 102, the encryption key 104 for encrypting plaintext can be arbitrarily changed.

暗号化コマンド101とは、ICチップ10の暗号演算回路12を操作し、SIM1に記憶された暗号鍵104を用い、所定の暗号アルゴリズムに従い、上位装置2から伝送される平文を暗号化する処理モジュールを備えたコマンドで、SIM1がデータモードへ遷移するトリガーとなるモード変更コマンドである。   The encryption command 101 is a processing module that operates the cryptographic operation circuit 12 of the IC chip 10 and uses the encryption key 104 stored in the SIM 1 to encrypt plaintext transmitted from the higher-level device 2 according to a predetermined encryption algorithm. Is a mode change command that triggers the SIM 1 to transition to the data mode.

図5は、SIM1のモード遷移を説明する図である。上述しているように、SIM1は、ISOモードとデータモードの2つのモードを有し、SIM1が遷移しているモードは、モード情報105によって示される。   FIG. 5 is a diagram for explaining the mode transition of the SIM1. As described above, the SIM1 has two modes, the ISO mode and the data mode, and the mode in which the SIM1 is transitioning is indicated by the mode information 105.

ISOモードでは、SIM1と上位装置2間でAPDUが交換され、ISOモードで、暗号化コマンド101のコマンドAPDUを受信したとき、SIM1のモードは、ISOモードからデータモードに遷移する。そして、データモードでは、APDUのデータ部のみ、すなわち、コマンドデータとレスポンスデータのみが交換される。   In the ISO mode, when an APDU is exchanged between the SIM 1 and the host device 2 and the command APDU of the encryption command 101 is received in the ISO mode, the SIM 1 mode transits from the ISO mode to the data mode. In the data mode, only the data part of the APDU, that is, only command data and response data are exchanged.

ISOモードからデータモードに遷移した後は、暗号化コマンド101のコマンドAPDUのデータフィールドに含まれる処理データ量の平文の暗号処理がすべて終了したときに、SIM1のモードは、データモードからISOモードへと自動復帰する。   After the transition from the ISO mode to the data mode, the SIM1 mode changes from the data mode to the ISO mode when all the plaintext encryption processing of the processing data amount included in the data field of the command APDU of the encryption command 101 is completed. And automatically return.

図6は、ISOモードにおけるSIM1の動作を説明する図である。ISOモードでは、コマンド群106に含まれるコマンドの実行が可能で、このISOモードでは、プロトコルバイトとチェックコードが付加されたコマンドAPDUが、上位装置2からSIM1に送信される。   FIG. 6 is a diagram for explaining the operation of the SIM 1 in the ISO mode. In the ISO mode, commands included in the command group 106 can be executed. In this ISO mode, a command APDU to which a protocol byte and a check code are added is transmitted from the higher-level device 2 to the SIM 1.

SIM1の伝送制御モジュール103は、コマンドAPDUを受信すると、コマンドAPDUに付加されたプロトコルバイトとチェックコードを確認し、データを正常に受信したと判断した場合、ディスパッチャ100がコマンドAPDUのコマンドヘッダの内容を解釈し、コマンド群106に含まれ、受信したコマンドAPDUに対応するコマンドに処理を委任する。委任されたコマンドはコマンドAPDUで示される処理を実行した後、レスポンスAPDUを生成し、伝送制御モジュール103は生成したレスポンスAPDUを上位装置2に返信する。   When the transmission control module 103 of the SIM 1 receives the command APDU, it confirms the protocol byte and the check code added to the command APDU, and if it is determined that the data has been received normally, the dispatcher 100 determines the contents of the command header of the command APDU. And the processing is delegated to a command included in the command group 106 and corresponding to the received command APDU. The delegated command executes processing indicated by the command APDU, and then generates a response APDU, and the transmission control module 103 returns the generated response APDU to the higher-level device 2.

図7は、データモードにおけるSIM1の動作を説明する図である。SIM1が暗号化コマンド102のコマンドAPDUを受信することで、SIM1のモードはISOモードからデータモードへ遷移し、上位装置2にACK(acknowledgment)を返信する。   FIG. 7 is a diagram for explaining the operation of the SIM 1 in the data mode. When the SIM 1 receives the command APDU of the encryption command 102, the SIM 1 mode changes from the ISO mode to the data mode, and ACK (acknowledgment) is returned to the higher-level device 2.

データモードでは、ISOモードとは異なり、上位装置2からSIM1には平文のみが送信される。上位装置2が平文をSIM1に送信するとき、平文には、コマンドAPDUと同様にプロトコルバイトとチェックコードが付加される。   In the data mode, unlike the ISO mode, only plain text is transmitted from the host device 2 to the SIM 1. When the host device 2 transmits a plain text to the SIM 1, a protocol byte and a check code are added to the plain text in the same manner as the command APDU.

SIM1が平文を受信すると、伝送制御モジュール103は、平文に付加されたプロトコルバイトとチェックコードを確認し、正常にデータを受信したと判断した場合、受信した平文の暗号化を暗号化コマンド101に委任し、暗号化コマンド101は暗号モジュール107に平文を受渡し、平文を暗号化した暗号文を得る。   When the SIM1 receives the plaintext, the transmission control module 103 checks the protocol byte and the check code added to the plaintext, and if the SIM1 determines that the data has been received normally, the encryption of the received plaintext is sent to the encryption command 101. After entrusting, the encryption command 101 passes the plaintext to the encryption module 107 to obtain a ciphertext obtained by encrypting the plaintext.

暗号化コマンド101が得た暗号文は、伝送制御モジュール103に受け渡され、しかるべきプロトコルバイトとチェックコードが付加されてSIM1から上位装置1に送信される。   The ciphertext obtained by the encryption command 101 is transferred to the transmission control module 103, and an appropriate protocol byte and check code are added to the ciphertext and transmitted from the SIM1 to the host device 1.

また、暗号化コマンド101は、データモードにおいて暗号化した平文のデータ量をカウントし、カウントしたデータ量が、暗号化コマンド101のコマンドAPDUのデータフィールドで示される処理データ量に達したとき、モード情報105を操作し、SIM1のモードをデータモードからISOモードへと遷移させると共に、暗号化コマンドのレスポンスAPDUを生成し、生成したレスポンスAPDUにプロトコルバイトとチェックコードを付加して上位装置2へ送信する。   The encryption command 101 counts the amount of plaintext data encrypted in the data mode, and when the counted data amount reaches the processing data amount indicated by the data field of the command APDU of the encryption command 101, the mode Manipulate the information 105 to change the SIM1 mode from the data mode to the ISO mode, generate a response APDU of the encrypted command, add a protocol byte and a check code to the generated response APDU, and send it to the host device 2 To do.

従来のICカードにおいては、データ容量の大きい平文を暗号化する際、一つのコマンドAPDUに含めることができるブロックサイズに平文を分割し、分割した平文ごとにコマンドAPDUを生成しなければならないが、本発明に係るSIM1を用いれば、分割した平文ごとにコマンドAPDUを生成する必要はなくなるため、上位装置2とSIM1間の通信量を減らす効果が得られるばかりか、SIM1は、上位装置2から受信したコマンドAPDUを毎回解釈する必要がなくなるため、SIM1の処理時間を短縮する効果が得られる。   In a conventional IC card, when plaintext with a large data capacity is encrypted, the plaintext must be divided into block sizes that can be included in one command APDU, and a command APDU must be generated for each divided plaintext. If the SIM1 according to the present invention is used, it is not necessary to generate a command APDU for each divided plaintext, so that not only the effect of reducing the amount of communication between the host device 2 and the SIM1 is obtained, but the SIM1 is received from the host device 2. This eliminates the need to interpret the command APDU every time, so that the processing time of the SIM 1 can be shortened.

更に、処理データ量の平文を処理した後は、SIM1のモードはデータモードからISOモードに自動復帰するため、データモードに遷移した後であっても、上位装置2はISO/IEC7816などに準拠した手順に従い、ICカードを利用したトランザクションを実行することができる。   Furthermore, since the SIM1 mode automatically returns from the data mode to the ISO mode after processing the plain text of the processing data amount, the upper apparatus 2 conforms to ISO / IEC7816 and the like even after the transition to the data mode. A transaction using an IC card can be executed according to the procedure.

図8は、暗号化コマンド101のコマンドAPDUの一例を示した図である。図8で示しているように、本実施の形態において、ISOモード時に上位装置からSIM1に送信されるコマンドAPDUの構造は、ISO/IEC7816規格のCase3のコマンド構造で、CLA、INS、P1及びP2とから成るコマンドヘッダと、Lc及びデータフィールドとから成るボディとから構成される。   FIG. 8 is a diagram illustrating an example of a command APDU of the encryption command 101. As shown in FIG. 8, in the present embodiment, the structure of the command APDU transmitted from the higher-level device to the SIM 1 in the ISO mode is the case 3 command structure of the ISO / IEC 7816 standard, and CLA, INS, P1, and P2 And a body consisting of Lc and a data field.

暗号化コマンド101のコマンドAPDUのヘッダーに含まれるCLAとINSは、コマンドAPDUを識別するためのデータで、本実施の形態において、暗号化コマンド101のCLAは「D0h」で、INSは「04h」である。   CLA and INS included in the header of the command APDU of the encrypted command 101 are data for identifying the command APDU. In this embodiment, the CLA of the encrypted command 101 is “D0h” and the INS is “04h”. It is.

暗号化コマンド101のコマンドAPDUのヘッダーに含まれるP1およびP2は、暗号化コマンド101が実行されるときのパラメータで、本実施の形態においては、P1及びP2は用いられず、P1及びP2の値はそれぞれ「00h」である。   P1 and P2 included in the command APDU header of the encrypted command 101 are parameters when the encrypted command 101 is executed. In this embodiment, P1 and P2 are not used, and values of P1 and P2 are used. Is “00h”.

暗号化コマンド101のボディのLcは、データフィールドに含まれるデータの長さを示し、データフィールドには、暗号化する平文の総量が記述される。なお、上述しているように、データモードでは、平文のみが送信され、コマンドヘッダのCLA、INS、P1およびP2は送信されない。   Lc of the body of the encryption command 101 indicates the length of data included in the data field, and the total amount of plaintext to be encrypted is described in the data field. As described above, in the data mode, only plain text is transmitted, and the command headers CLA, INS, P1, and P2 are not transmitted.

SIM1がデータモードにいるときは、上位装置2からSIM1に平文のデータオブジェクトが送信され、このデータオブジェクトには平文のデータ長と平文とが含まれ、暗号化コマンド101は、データ長で示される長さの平文を暗号化する。   When the SIM 1 is in the data mode, a plain text data object is transmitted from the host apparatus 2 to the SIM 1, and this data object includes a plain text data length and a plain text, and the encryption command 101 is indicated by the data length. Encrypt length plaintext.

図9は、暗号化コマンド101のレスポンスAPDUの一例を示した図で、暗号化した平文の総データ量が暗号化コマンド101のデータフィールドで示される総量に達したときはレスポンスAPDUを生成する。   FIG. 9 is a diagram showing an example of a response APDU of the encrypted command 101. When the total amount of encrypted plaintext data reaches the total amount indicated by the data field of the encrypted command 101, a response APDU is generated.

図9で示したように、暗号化コマンド101のレスポンスAPDUの構造は、ISO/IEC7816のレスポンスAPDUの構造に準拠し、ボディと、トレイラー(Trailer)である2バイトのSWとから構成される。   As shown in FIG. 9, the response APDU structure of the encrypted command 101 conforms to the response APDU structure of ISO / IEC7816, and is composed of a body and a 2-byte SW that is a trailer.

暗号化コマンド101のレスポンスAPDUのボディには、最後に受信する平文を暗号化した暗号文が含まれる。また、レスポンスAPDUの2バイトのSWでは、暗号化コマンド101の実行結果が示される。   The body of the response APDU of the encrypted command 101 includes a ciphertext obtained by encrypting the plaintext received last. The 2-byte SW of the response APDU indicates the execution result of the encryption command 101.

ここから、暗号化コマンド101を実装したSIM1の動作フローについて説明する。図10は、SIM1の動作を示したフロー図である。図10の最初のステップS1は、SIM1が活性化されるステップである。このステップでは、SIM1は、ISO/IEC7816の手順に従い活性化され、SIM1の初期処理が実行される。   From here, the operation flow of the SIM 1 in which the encryption command 101 is implemented will be described. FIG. 10 is a flowchart showing the operation of the SIM1. The first step S1 in FIG. 10 is a step in which SIM1 is activated. In this step, SIM1 is activated according to the procedure of ISO / IEC7816, and the initial processing of SIM1 is executed.

この初期処理によって、SIM1のモード情報105の値がISOモードを示す値に設定されることで、SIM1のモードはISOモードになる。   By this initial processing, the value of the SIM1 mode information 105 is set to a value indicating the ISO mode, so that the SIM1 mode becomes the ISO mode.

次のステップS2は、SIM1が非活性化されるまで繰り返し実行されるループ処理である。   The next step S2 is a loop process that is repeatedly executed until SIM1 is deactivated.

次のステップS3は、SIM1が上位装置2からコマンドAPDUを受信するステップである。SIM1の伝送制御モジュール103は、上位装置2から、プロトコルバイトとチェックコードが付加されたコマンドAPDUを受信すると、コマンドAPDUに付加されたプロトコルバイトとチェックコードを確認し、データを正常に受信したと判断した場合、コマンドAPDUのみをディスパッチャ100に受け渡す。   The next step S3 is a step in which the SIM 1 receives a command APDU from the higher-level device 2. When the transmission control module 103 of the SIM 1 receives the command APDU to which the protocol byte and the check code are added from the host device 2, the transmission control module 103 confirms the protocol byte and the check code added to the command APDU, and receives the data normally. If it is determined, only the command APDU is transferred to the dispatcher 100.

次のステップS4は、SIM1が上位装置から受信したコマンドAPDUを処理するコマンドを特定するステップである。このステップでは、SIM1のモード情報105の値は、ISOモードを示す値に設定されているため、SIM1のディスパッチャ100は、コマンドAPDUのCLA,INSを解析することで、SIM1が有するコマンド群106の中から、SIM1は実行するコマンドを特定し、P1、P2およびデータフィールドのデータを引渡すなどして、コマンドAPDUの処理を特定したコマンドに委任する。   The next step S4 is a step of specifying a command for processing the command APDU received by the SIM 1 from the upper apparatus. In this step, since the value of the mode information 105 of the SIM1 is set to a value indicating the ISO mode, the dispatcher 100 of the SIM1 analyzes the CLA and INS of the command APDU, so that the command group 106 of the SIM1 has From among them, the SIM1 specifies a command to be executed, and delegates the processing of the command APDU to the specified command by delivering data of P1, P2 and the data field.

なお、このステップで、特定したコマンドが暗号化コマンド101の場合はステップS10に進み、他のコマンドの場合はステップS5に進む。   In this step, if the specified command is the encrypted command 101, the process proceeds to step S10, and if it is another command, the process proceeds to step S5.

ステップS5において、暗号化コマンド101以外のコマンド(例えば、暗号鍵設定コマンド102)を処理され、レスポンスAPDUが生成される。そして、ステップS6では、伝送制御モジュール103は、生成したレスポンスAPDUにプロトコルバイトとチェックコードを付加し上位装置2に送信する。   In step S5, a command other than the encryption command 101 (for example, the encryption key setting command 102) is processed, and a response APDU is generated. In step S <b> 6, the transmission control module 103 adds a protocol byte and a check code to the generated response APDU and transmits the response APDU to the higher-level device 2.

図11は、図10のステップS10で実行され、暗号化コマンド101を処理する手順を示したフロー図である。暗号化コマンド101を処理する手順の最初のステップS11は、SIM1のモードを、ISOモードからデータモードへ遷移させるステップである。   FIG. 11 is a flowchart showing the procedure for processing the encryption command 101, which is executed in step S10 of FIG. The first step S11 of the procedure for processing the encryption command 101 is a step of changing the SIM1 mode from the ISO mode to the data mode.

このステップS11では、ディスパッチャ100は、図10のステップS3で受信したコマンドAPDUが、暗号化コマンド101のコマンドAPDUであると判断した場合、暗号化コマンド101を呼び出す。暗号化コマンド101が読み出されると、暗号化コマンド101は、ISOモードを示す値からデータモードを示す値に、モード情報105の値を変更することで、SIM1のモードを、ISOモードからデータモードへ遷移させる。   In this step S11, when the dispatcher 100 determines that the command APDU received in step S3 in FIG. 10 is the command APDU of the encrypted command 101, the dispatcher 100 calls the encrypted command 101. When the encryption command 101 is read, the encryption command 101 changes the value of the mode information 105 from the value indicating the ISO mode to the value indicating the data mode, thereby changing the SIM1 mode from the ISO mode to the data mode. Transition.

次のステップS12は、暗号化した平文のデータ量を示すカウンタを初期化するステップである。このステップでは、SIM1の暗号化コマンド101は、図10のステップS3で受信した暗号化コマンド101のコマンドAPDUに含まれる総量を、CPU11のレジスタまたはRAM14にコピーしておく。   The next step S12 is a step of initializing a counter indicating the amount of encrypted plaintext data. In this step, the encryption command 101 of the SIM 1 copies the total amount included in the command APDU of the encryption command 101 received in step S 3 of FIG. 10 to the register of the CPU 11 or the RAM 14.

次のステップS13は、暗号化コマンド101のコマンドAPDUを正常に受信したことを示すACKを返信するステップである。なお、このACKにはプロトコルバイトやチェックコードは伝送制御モジュール103によって付加される。なお、ACKとレスポンスAPDUに含まれるSWを区別できるように、ACKの値は、SWで使用される以外の値であることが望ましい。   The next step S13 is a step of returning an ACK indicating that the command APDU of the encrypted command 101 has been normally received. Note that the transmission control module 103 adds a protocol byte and a check code to this ACK. It should be noted that the ACK value is preferably a value other than that used by the SW so that the ACK and the SW included in the response APDU can be distinguished.

次のステップS14は、上位装置2から平文を受信するステップである。このステップで受信する平文には、プロトコルバイトとチェックコードが付加される。SIM1が平文を受信すると、伝送制御モジュール103は、コマンドAPDUに付加されたプロトコルバイトとチェックコードを確認する。   The next step S <b> 14 is a step of receiving plain text from the higher-level device 2. A protocol byte and a check code are added to the plaintext received at this step. When the SIM1 receives the plain text, the transmission control module 103 confirms the protocol byte and the check code added to the command APDU.

次のステップS15は、上位装置2から送信された平文を暗号化した暗号文を生成するステップである。このステップでは、暗号化コマンド101は、暗号演算回路12を作動させ、暗号鍵104を用いて所定の暗号アルゴリズムに従い、ディスパッチャ100から引渡された平文を暗号化する。   The next step S15 is a step of generating a ciphertext obtained by encrypting the plaintext transmitted from the host device 2. In this step, the encryption command 101 activates the cryptographic operation circuit 12 and encrypts the plain text delivered from the dispatcher 100 according to a predetermined cryptographic algorithm using the cryptographic key 104.

次のステップS16は、暗号化した平文のデータ量を示すカウンタを更新するステップである。このステップでは、暗号化コマンド101は、平文のデータオブジェクトに含まれるデータ長をカウンタに加算することで、カウンタを更新する。   The next step S16 is a step of updating a counter indicating the amount of encrypted plaintext data. In this step, the encryption command 101 updates the counter by adding the data length included in the plaintext data object to the counter.

次のステップS17は、ステップS3で受信した暗号化コマンド101のコマンドPADUのデータフィールドに含まれていた総量とカウンタの値を比較し、総量の平文を暗号化したか確認するステップである。   In the next step S17, the total amount contained in the data field of the command PADU of the encrypted command 101 received in step S3 is compared with the value of the counter to check whether the plaintext of the total amount has been encrypted.

ステップS17で、総量の平文を暗号化していない場合はステップS18に進み、暗号化した場合は正常終了処理(ステップS20)に進む。   If the total amount of plaintext is not encrypted in step S17, the process proceeds to step S18. If encrypted, the process proceeds to a normal end process (step S20).

総量の平文を暗号化していない場合に実行されるステップS18では、平文を暗号化した暗号文のみが上位装置2に送信される。このステップでは、暗号化コマンド101は、ステップS15で生成した暗号文を伝送制御モジュール103に引渡し、伝送制御モジュール103は、暗号文に、プロトコルバイトとチェックコードを付加して上位装置2に送信し、送信後にSIM1は上位装置2からデータを受信する状態になる。なお、ステップS18を実行した後は、ステップS14に戻る。   In step S <b> 18 executed when the total amount of plaintext is not encrypted, only the ciphertext obtained by encrypting the plaintext is transmitted to the host apparatus 2. In this step, the encryption command 101 passes the ciphertext generated in step S15 to the transmission control module 103, and the transmission control module 103 adds the protocol byte and the check code to the ciphertext and sends it to the upper level apparatus 2. After transmission, the SIM 1 is in a state of receiving data from the higher-level device 2. In addition, after performing step S18, it returns to step S14.

図12は、正常終了処理に手順を示したフロー図である。この手順の最初のステップS21は、正常終了を示すSWと、最後に暗号化した平文の暗号文であるレスポンスデータとからなるレスポンスAPDUを生成し、更に、データモードを示す値からISOモードを示す値にモード情報105の値を変更する。   FIG. 12 is a flowchart showing a procedure for normal termination processing. The first step S21 of this procedure is to generate a response APDU composed of SW indicating normal termination and response data which is the last encrypted plaintext ciphertext, and further indicates the ISO mode from the value indicating the data mode. The value of the mode information 105 is changed to a value.

ステップS21の後に実行されるステップS22は、ステップS21で生成したレスポンスAPDUを上位装置2に送信するステップである。このステップでは、暗号化コマンド101は、ステップS21で生成したレスポンスAPDUを伝送制御モジュール103に引渡し、伝送制御モジュール103は、プロトコルバイトとチェックコードをレスポンスAPDUに付加し、レスポンスAPDUを上位装置2に送信する。   Step S22 executed after step S21 is a step of transmitting the response APDU generated in step S21 to the higher-level device 2. In this step, the encryption command 101 passes the response APDU generated in step S21 to the transmission control module 103, and the transmission control module 103 adds a protocol byte and a check code to the response APDU, and sends the response APDU to the higher-level device 2. Send.

SIMの振舞いを説明する図。The figure explaining behavior of SIM. SIMの外観図。The external view of SIM. ICチップのハードウェア構造図。1 is a hardware structure diagram of an IC chip. SIMのソフトウェア構成図。The software block diagram of SIM. SIMのモード遷移を説明する図。The figure explaining the mode transition of SIM. ISOモードにおけるSIMの動作を説明する図。The figure explaining operation | movement of SIM in ISO mode. データモードにおけるSIMの動作を説明する図。The figure explaining operation | movement of SIM in a data mode. 暗号化コマンドのコマンドAPDUの一例を示した図。The figure which showed an example of command APDU of an encryption command. 暗号化コマンドのレスポンスAPDUの一例を示した図。The figure which showed an example of the response APDU of an encryption command. SIMの動作を示したフロー図。The flowchart which showed operation | movement of SIM. 暗号化コマンドを処理する手順を示したフロー図。The flowchart which showed the procedure which processes an encryption command. 正常終了時の手順を示したフロー図。The flowchart which showed the procedure at the time of normal completion.

符号の説明Explanation of symbols

1 SIM
100 ディスパッチ
101 暗号鍵設定コマンド
102 暗号化コマンド
103 伝送制御モジュール
104 暗号鍵
105 モード情報
2 上位装置
1 SIM
100 Dispatch 101 Encryption Key Setting Command 102 Encryption Command 103 Transmission Control Module 104 Encryption Key 105 Mode Information 2 Host Device

Claims (4)

上位装置に組み込まれ利用されるICカードであって、前記ICカードは、前記ICカードのモードを示すモード情報をメモリに記憶し、前記モード情報によって、少なくとも、コマンドAPDU及びレスポンスAPDUを前記上位装置とやり取りする第1のモード、或いは、前記コマンドAPDUのデータ部であるコマンドデータ及び前記レスポンスAPDUのデータ部であるレスポンスデータのみを前記上位装置とやり取りする第2のモードのいずれかのモードが示され、前記ICカードは、前記モード情報を操作するモード変更コマンドと、前記モード情報を参照し、前記モード情報に基づいて前記ICカードの振舞いを変更する制御手段とを備え、前記モード変更コマンドは特定の処理モジュールに関連付けられ、更に、前記モード変更コマンドは、前記第1のモードで前記コマンドAPDUを処理するときには、前記モード情報を操作して前記ICカードのモードを前記第2のモードに遷移させ、前記第2のモードに遷移してからは、処理した前記コマンドデータのデータ量をカウントし、カウントしたデータ量が前記モード変更コマンドの前記コマンドAPDUのデータ部で示される前記コマンドデータの総量を超えたときに、前記モード情報を操作して前記ICカードのモードを前記第1のモードに復帰させ、前記制御手段は、前記モード情報が前記第2のモードを示すときは、前記上位装置から送信された前記コマンドデータの処理を前記モード変更コマンドに委任し、前記モード変更コマンドから得られる前記レスポンスデータを前記上位装置に送信することを特徴とするICカード。   An IC card incorporated in and used in a host device, wherein the IC card stores mode information indicating a mode of the IC card in a memory, and at least a command APDU and a response APDU are stored in the host device according to the mode information. Or the first mode for exchanging data with the host device or only the command data that is the data part of the command APDU and the response data that is the data part of the response APDU. The IC card includes a mode change command for operating the mode information, and a control unit that refers to the mode information and changes the behavior of the IC card based on the mode information. Associated with a specific processing module, and When the command further processes the command APDU in the first mode, the mode information is manipulated to change the mode of the IC card to the second mode, and then to the second mode. Counts the data amount of the processed command data, and operates the mode information when the counted data amount exceeds the total amount of the command data indicated by the data portion of the command APDU of the mode change command. The mode of the IC card is returned to the first mode, and when the mode information indicates the second mode, the control unit performs processing of the command data transmitted from the host device. Delegating to a change command and sending the response data obtained from the mode change command to the host device. IC card to be butterflies. 請求項1に記載のICカードであって、前記モード変更コマンドに関連付けられた処理モジュールは、前記コマンドデータを暗号化/複合するモジュールであることを特徴とするICカード。   2. The IC card according to claim 1, wherein the processing module associated with the mode change command is a module that encrypts / combines the command data. 少なくとも、コマンドAPDU及びレスポンスAPDUを前記上位装置とやり取りする第1のモード、或いは、前記コマンドAPDUのデータ部であるコマンドデータ及び前記レスポンスAPDUのデータ部であるレスポンスデータのみを前記上位装置とやり取りする第2のモードのいずれかのモードが示されるモード情報を記憶したICカードに実装されるICカードプログラムであって、特定の処理に関連付けられ、前記第1のモードで前記コマンドAPDUを処理するときには、前記モード情報を操作して前記ICカードのモードを前記第2のモードに遷移させ、前記第2のモードに遷移してからは、処理した前記コマンドデータのデータ量をカウントし、カウントしたデータ量が前記コマンドAPDUのデータ部で示される前記コマンドデータの総量を超えたときに、前記モード情報を操作して前記ICカードのモードを前記第1のモードに復帰させるモード変更コマンド機能と、前記モード情報が前記第2のモードを示すときは、前記上位装置から送信された前記コマンドデータの処理を前記モード変更コマンド機能に委任し、前記モード変更コマンドから得られる前記レスポンスデータを前記上位装置に送信する制御機能として、前記ICカードのCPUを動作させるためのICカードプログラム。   At least a first mode in which a command APDU and a response APDU are exchanged with the host apparatus, or only command data that is a data part of the command APDU and response data that is a data part of the response APDU are exchanged with the host apparatus. An IC card program mounted on an IC card storing mode information indicating any one of the second modes, when associated with a specific process and processing the command APDU in the first mode The mode information is manipulated to change the mode of the IC card to the second mode. After the transition to the second mode, the data amount of the processed command data is counted, and the counted data The frame whose amount is indicated in the data part of the command APDU A mode change command function for operating the mode information to return the mode of the IC card to the first mode when the total amount of data exceeds the mode, and when the mode information indicates the second mode, The CPU of the IC card is operated as a control function for delegating the processing of the command data transmitted from the host device to the mode change command function and transmitting the response data obtained from the mode change command to the host device. IC card program to let you. 請求項3に記載のICカードプログラムにおいて、前記モード変更コマンド機能に関連付けられた処理は、前記コマンドデータを暗号化/複合する処理であることを特徴とするICカードプログラム。
4. The IC card program according to claim 3, wherein the process associated with the mode change command function is a process of encrypting / combining the command data.
JP2006206814A 2006-07-28 2006-07-28 IC card with mode change function and IC card program Expired - Fee Related JP4840012B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006206814A JP4840012B2 (en) 2006-07-28 2006-07-28 IC card with mode change function and IC card program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006206814A JP4840012B2 (en) 2006-07-28 2006-07-28 IC card with mode change function and IC card program

Publications (2)

Publication Number Publication Date
JP2008033669A JP2008033669A (en) 2008-02-14
JP4840012B2 true JP4840012B2 (en) 2011-12-21

Family

ID=39123005

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006206814A Expired - Fee Related JP4840012B2 (en) 2006-07-28 2006-07-28 IC card with mode change function and IC card program

Country Status (1)

Country Link
JP (1) JP4840012B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7397402B2 (en) * 2019-12-13 2023-12-13 大日本印刷株式会社 Electronic information storage medium, data transmission method, and program
JP7459899B2 (en) 2022-08-01 2024-04-02 大日本印刷株式会社 Electronic information storage medium, verification method, and program

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5103803B2 (en) * 2006-06-26 2012-12-19 大日本印刷株式会社 IC card with mode change function and IC card program
JP4904957B2 (en) * 2006-07-13 2012-03-28 大日本印刷株式会社 Billing system, method, IC card, and IC card program using IC card
JP4904966B2 (en) * 2006-07-26 2012-03-28 大日本印刷株式会社 IC card with mode change function and IC card program

Also Published As

Publication number Publication date
JP2008033669A (en) 2008-02-14

Similar Documents

Publication Publication Date Title
US20100235629A1 (en) Information storage medium, authentication data generation method, and medium authentication system
JP5103803B2 (en) IC card with mode change function and IC card program
US10021104B2 (en) Method for operating a security element
JP2008059304A (en) Communication device, method, and program
KR100782113B1 (en) Memory card system and method transmitting host identification information thereof
JP4904966B2 (en) IC card with mode change function and IC card program
JP4840012B2 (en) IC card with mode change function and IC card program
JP5293231B2 (en) IC chip, IC card, issuing device, issuing method and issuing system
JP4236830B2 (en) Storage device with upload function
JP4373239B2 (en) IC card issuance method, IC card program and IC card
KR100562505B1 (en) Integrated circuit card capable of automatically transmitting null byte information without intervention by cpu
JP4770255B2 (en) IC card and command processing method mounted on IC card
JP2011022841A (en) Processing system for portable electronic apparatus, portable electronic apparatus, and processing apparatus for portable electronic apparatus
JP4394413B2 (en) Information storage device and information processing system
JP7444197B2 (en) Electronic information storage medium, cryptographic operation method selection method, and program
JP4957209B2 (en) IC card communication module, IC card communication method, and computer program
JP7439847B2 (en) Electronic information storage medium, key data setting method, and program
JP5693824B2 (en) IC card processing device, IC card, and IC card processing system
JP7487837B1 (en) ELECTRONIC INFORMATION STORAGE MEDIUM, IC CHIP, IC CARD, KEY DATA STORAGE METHOD, AND PROGRAM
JP2009015375A (en) Ic card with function of encrypting data, method, and program for ic card
JP7397402B2 (en) Electronic information storage medium, data transmission method, and program
JP7468757B1 (en) ELECTRONIC INFORMATION STORAGE MEDIUM, IC CHIP, IC CARD, RESPONSE TRANSMISSION METHOD, AND PROGRAM
JP2022025986A (en) Electronic information storage medium, program addition method, and program
JP2006172271A (en) Multi-application ic card, and program for ic card
JP7468754B1 (en) ELECTRONIC INFORMATION STORAGE MEDIUM, IC CHIP, IC CARD, RECEPTION BLOCK PROCESSING METHOD, AND PROGRAM

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20090525

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

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20141014

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees