JP3718565B2 - IC card - Google Patents

IC card Download PDF

Info

Publication number
JP3718565B2
JP3718565B2 JP28646496A JP28646496A JP3718565B2 JP 3718565 B2 JP3718565 B2 JP 3718565B2 JP 28646496 A JP28646496 A JP 28646496A JP 28646496 A JP28646496 A JP 28646496A JP 3718565 B2 JP3718565 B2 JP 3718565B2
Authority
JP
Japan
Prior art keywords
search
information
file
address
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
JP28646496A
Other languages
Japanese (ja)
Other versions
JPH09231332A (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 JP28646496A priority Critical patent/JP3718565B2/en
Publication of JPH09231332A publication Critical patent/JPH09231332A/en
Application granted granted Critical
Publication of JP3718565B2 publication Critical patent/JP3718565B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Storage Device Security (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、メモリに格納されているファイルについて、指定したパターンと同一パターンの情報を所有しているか否かを検索することが可能なICカーに関するものである。
【0002】
【従来の技術】
図5は、従来のICカードの構成、及びそのICカードとリーダライタ装置との接続関係を示すブロック図である。
従来のICカード10は、通常、I/Oインタフェース11、CPU12、ROM13、RAM14、EEPROM15を内蔵している。I/Oインタフェース11は、データを送受するための入出力回路であり、CPU12はこのI/Oインタフェース11を介してリーダライタ装置20と交信する。ROM13内には、CPU12によって実行されるべきプログラムが記憶されており、CPU12は、このプログラムに基いてICカード10を統括制御する。RAM14は、CPU12がこのような統括制御を行う上で作業領域として使用するメモリである。一方、EEPROM15は、このICカード10に記録すべき本来のデータを格納するメモリである。
【0003】
図6は、図5に示すEEPROM15内の階層構造を示すブロック図である。本実施形態のEEPROMは、3つの階層から構成される。3つの階層とは、第1層のMF(Master File) 、第2層のDF(Dedicated File)及び第3層のEF(Elementary File)である。 MFは、データメモリ全体のファイルである。MFは
、各アプリケーション(サービス)に共通したデータを格納するためのファイルであり、例えば、このICカード10の所有者の氏名、住所、電話番号などの情報が記録される。DFは、専用ファイルであり、アプリケーションごとにDFの設定がなされている。EFは、基礎ファイルであり、CPUがICカードを管理・制御する際に解釈実行するデータを格納するIEFと、アプリケーションで使用するデータを格納するWEF(作業用基礎ファイル)の2種類がある。
【0004】
ICカード10内の各メモリ13、14、15へのアクセスは、すべてCPU12を介して行われ、外部からこれらメモリを直接アクセスすることはできない。すなわち、リーダライタ装置20からCPU12に対して所定の「コマンド」を与えると、CPU12はこの「コマンド」を解釈実行し、その結果を、リーダライタ装置20に対して「レスポンス」として返送することになる。
【0005】
リーダライタ装置20において、特定のWEFの内容を知りたい場合には、そのWEFのファイルIDをICカード10に通知し、ICカード10にそのWEFを選択させなければならない。さらに、リーダライタ装置20は、選択されたファイルの全部の情報ではなく、特定の情報のみを知りたい場合には、その情報が書き込まれているレコードID又はオフセットアドレスをICカード10に通知しなければならない。オフセットアドレス等を通知すると、ICカード10は、そのオフセットアドレスに書き込まれている情報を読み出し、リーダライタ装置20へ送信する。
【0006】
一方、リーダライタ装置20において、求める情報が書き込まれているレコードID又はオフセットアドレスが既知でない場合には、WEFの内容全部をICカード10より受信し、リーダライタ装置20側でファイルの内容を確認しなければならなかった。さらに、必要な情報を所有しているWEFのファイルIDも既知でない場合には、DF内の全てのWEFの内容をICカード10より受信し、その内容を調べなければならなかった。
【0007】
【発明が解決しようとする課題】
しかし、前述した従来のICカードでは、リーダライタ装置との間で行う通信速度が9600bps前後と比較的遅く、1つの基礎ファイルの情報全部をリーダライタ装置へ送信する場合には莫大な時間が必要となる。このために、リーダライタ装置においてWEFのファイルID又は求める情報が書き込まれているオフセットアドレス等の情報がない場合には、事実上ICカードより情報を取得することができないという問題があった。
【0008】
また、最近は、一のICカードを複数の機関で共通に使用することに対する要請が高まっている。一例としては、一のICカードを複数の医療機関で治療履歴を記録するカルテとして利用することがある。このような場合には、カルテを安全に管理すること等の理由から、通常、それぞれの医療機関が別個にWEFを設け、利用することとなる。一方、医師は、患者に医薬品を与える前に、他の医療機関でその医薬品との関係で有害な副作用を引き起こすものが与えられていないかを調べる必要がある。したがって、医師が他の医療機関の管理するWEFをも参照できるようにすることが望まれるが、WEFの内容全てを無条件に参照可能とすれば、患者のプライバシーが害されるという問題があった。
【0009】
そこで、本発明の課題は、セキュリティーを害さず、かつ、迅速にファイルに特定の情報があるか否かを確認できるICカードを提供することである。
【0012】
【課題を解決するための手段】
前記課題を解決するために、請求項の発明は、メモリにファイルを格納しているICカードにおいて、前記ファイルの内容から、外部より指定されたパターンと同一パターンを有する情報を検索する検索手段と、前記検索手段が前記情報を発見した場合に、前記情報が格納されているアドレスを外部に送信する送信手段とを備え、前記検索手段は、前記情報を発見した回数を記録する回数記録手段と、外部からの命令により指定された値を記憶する回数指定手段とを有し、前記送信手段は、前記回数記録手段に記録されている値が前記回数指定手段に記憶されている値に達したときに、最後に発見された前記情報の格納されているアドレスを外部へ送信することを特徴とする。
【0013】
【発明の実施の形態】
以下、図面等を参照して、本発明に係る実施形態について、さらに詳しく説明する。
(第1実施形態)
はじめに、本発明に係るICカードの第1実施形態について説明する。本実施形態は、ハードウェア構成において従来のICカードと同一であるが、カレントEF又はショートEF−IDで指定されたトランスペアレント形式のWEFの中で、指定されたパターンと同一パターンのデータを検索して、検索したデータの位置をレスポンスとして送信する機能を備える点において従来のICカードと異なっている。上記機能は、リーダライタ装置20よりSEARCHコマンドを受信し、これを処理することにより発揮される。
【0014】
図1は、SEARCHコマンドのAPDUを示す図である。
SEARCHコマンドの第1バイト目から第4バイト目は、順にコマンドのクラス(CLA)、種別コード(INS)、パラメータ(P1、P2)である。パラメータP1、P2は、検索対象であるWEFにおいて、検索をすべき領域の先頭のオフセットアドレス(以下「検索開始アドレス」という)を指定する。すなわち、パラメータP1の第8ビット(b8)が0である場合には、P1及びP2は、検索を開始すべきアドレスを残りの15ビットで指定する。一方、パラメータP1のb8が1である場合には、P1の上位5ビットがショートEF−IDを指定し、P2の8ビットが検索開始アドレスを指定する。
【0015】
第6ビット目以降に続くデータフィールドは、検索すべきパターンに関する情報である。データフィールドは、2バイトの検索終了ファイル内アドレス、2バイトの検索インターバルバイト数、1バイトの検索番号及び任意バイト数の検索データ(検索パターン)より構成される。これらデータフィールドを構成する各情報の意味内容については、図2に関する説明において詳述する。
第5ビット目のLCは、データフィールドの長さ(バイト数)情報である。
【0016】
図2は、SEARCHコマンドを受信し、処理するときのICカード10の動作を示す流れ図である。
リーダライタ装置20からSEARCHコマンドがあった場合には、CPU12は、実行前チェックを行い(S501)、エラーがあったときには、その旨のメッセージ(S503)を送信する。実行前チェックは、コマンドのパラメータP1、P2が適正であるか、LCとデータフィールドの内容の間に整合がとれているか等について行われる。例えば、LCの値が6未満である、又はデータフィールドの大きさと矛盾する場合には、SEARCHコマンドが適切な情報を備えていないことになるので、その旨のエラーメッセージが送信される。
【0017】
次に、読み出しファイルを指定する(S504)。P1のb8が1の場合には、ショートEF−IDでのファイル検索サブルーチンを使用して、読み出しファイルの指定を行う。ショートEF−ID検索サブルーチンへは、カレントDFのファイルエントリのアドレス(CRT−DF)、検索するEFのショートEF−ID、及びファイル種別(本実施形態の場合はWEF)を引数として渡す。
【0018】
CPU12は、指定したファイルを検索する(S505)。以下、その具体的方法について図3を用いて説明する。図3は、EEPROM15におけるファイル格納イメージを示す図である。図中、なお、CRT−DPは、格納されている全ディレクトリアドレスのうち最も先頭に格納されているもののファイルエントリのアドレスを示すポインタである。EEPROM15には、アドレスの大なる方から順にシステム情報エリア及びMFディレクトリが、さらに続けてWEF等のディレクトリが隙間なく格納されている。ショートEF−ID検索サブルーチンは、CRT−DFからCRT−DPまで順にファイルディレクトリを参照し、CRT−DFを親DFとするWEFであって、ファイルIDの下位5ビットがショートEF−IDと一致するものを検索する。
【0019】
上記の検索の結果、検索エラー又は検索したファイルがレコード形式のWEFの場合には(図2のS506)、該当するメッセージを送信し(S507、S521)、コマンドを終了する。上記の他は、検索したファイルのアドレスを、RAM14のカレントEFアドレスにセットする(S508)。
【0020】
次に、読み出しファイルのチェックを行い(S510)、エラーの場合には、その旨のメッセージ(S511)を送信する(S521)。
チェック項目は、RAM14のカレントEFアドレスが0000hのとき、検索開始アドレス又は検索終了アドレスがライトアペインドポインタを超えているとき、検索開始アドレスが検索終了アドレスを超えているとき、データ領域のCRCチェックエラーのときである。
【0021】
「RAM14のカレントEFアドレスが0000hのとき」とは、カレントEFアドレスが選択されていないときのことである。このときがエラーとして処理されるのは、ショートEF−IDが指定されていない場合である。
「検索開始アドレス又は検索終了アドレスがライトアペインドポインタを超えているとき」をエラーとして処理するのは、実際にデータが格納されている領域を越えて誤った範囲を検索範囲として指定しているからである。また、「検索開始アドレスが検索終了アドレスを超えているとき」も、コマンドの内容が整合性を欠くので、エラー処理を行うこととしている。
「データ領域のCRCチェックエラーのとき」にエラーメッセージを送信するのは、WEFに格納されているデータがそもそも異常を有するものである旨をリーダライタ装置に警告するためである。
【0022】
S512では、SEARCHコマンドのパラメータP1、P2を参照することにより、検索ファイルの検索開始位置を取得する。P1のb8が1の場合には、P2の8ビットをファイル先頭からのオフセットアドレスとして認識し、検索を行う際の読み出し開始位置とする。P1のb8が0の場合には、(P1の下位7ビット)+(P2の計15ビット)をファイル先頭からのオフセットアドレスとして認識し、読み出し開始位置とする。ここで、再度検索開始アドレスがライトアペンドポインタを超えているか否かを確認し、越えている場合には(S514)、その旨のメッセージを送信する(S515、S521)。
次に、検索終了アドレスのチェックを行う(S516)。検索終了アドレスがライトアペンドポインタ(又はファイルエンド)を超えないことを確認し、超える場合には、検索終了アドレスにライトアペンドポインタ(又はファイルエンド)をセットする(S517)。
【0023】
次に、CPU12は、データの検索を行う(S518)。検索するキー(パターン)は、Data Fieldの先頭から6バイト目以降の検索データであり、検索キー長(検索パターン長)は、LC−5である。(検索アドレス)+(検索キー長)が検索終了アドレスを超えた場合には、検索を終了し、その旨のメッセージを送信してコマンドを終了する。比較方法は、検索キー長分(検索パターン長分)の完全一致により行う。一致データが検索番号分見つかった(S519)場合には、そのデータのファイル内のオフセットアドレス2バイトと、正常であるメッセージを送信し(S521)、処理を終了する。不一致の場合には、インターバルサイズ分(コマンドのデータフィールドで指定する検索インターバルバイト数)アドレスを進めて、次の検索を行う(S518)。
【0024】
(第1実施形態の変形例)
第1実施形態で説明したSEARCHコマンドの処理内容は、種々の態様に変形することが可能である。図4は、SEARCHコマンドの処理内容の変形例を示す流れ図である。本変形例におけるSEARCHコマンドの処理内容は、S519とS521の間に新たに検索パターンの発見回数を確認する処理(S522、S523)を有する点において第1実施形態と異なる。
本変形例では、S518、S519の検索において指定された検索パターンと同一のデータを発見した場合には、RAM14上の所定アドレスに格納されている発見個数Nに1加算する(S522)。次に、発見個数Nがコマンドのデータフィールドで指定された検索番号以上か否かが判断される(S523)。発見個数Nが検索番号以上である場合には、S521の処理がなされる。すなわち、検索番号で指定される回数目に発見されたデータのアドレスがリーダライタ装置20に送信される。他の場合には、S518へ戻り、さらに検索が継続される。
【0025】
以上説明したように、本発明の第1実施形態及びその変形例のICカードは、SEARCHコマンドを実行すると、選択されたWEF内で指定されたパターンと同一パターンの情報を検索し、その結果、同一パターンの情報が発見されたときは当該情報のオフセットアドレスをレスポンスとして外部へ送信する。したがって、本実施形態では、フォーマットが未知のWEFから、特定の情報のみを読み出すことが可能である。すなわち、最初にSEARCHコマンドを用いて上記特定情報が格納されている領域のオフセットアドレスを取得すれば、そのオフセットアドレスに基づいて、READ BINARYコマンド等を用いることにより、上記特定情報のみをWEFから読み出すことができる。換言すれば、本実施形態では、フォーマットが未知であるWEFから特定の情報を取得する場合に、その内容の全てを外部へ読み出す必要を回避することで通信時間を必要最小限に抑制し、迅速に上記特定の情報を取得することを可能としているのである。
【0026】
また、本実施形態は、一のICカードを複数のシステムにおいて多目的に使用する場合のICカードの利用価値を増大させるものである。ここで、一例として、一のICカードを2つの金融システムにおいて同時に使用可能とした場合を考える。この場合には、カード所有者のプライバシー保護の観点から、A金融システムの取引明細を記録したWEFについて、B金融システムによるアクセスを許容すべきではない。一方、B金融システムとしては、カード所有者に貸し出しを行う場合に、カード所有者が他の金融機関からの借入金を有するか否かを事前に確認し、取引の安全性を確保する必要がある。
【0027】
上記のような場合に、A、Bそれぞれの金融システムが、「借入金」を検索パターンとしたSEARCHコマンドの実行を各々のWEFにおいて認めれば、各金融システムは、カード所有者が他の金融機関より金銭の借入をしているか否かを確認することが可能となる。しかも、SEARCHコマンドは、検索パターンが一致する領域のオフセットアドレスのみをレスポンスとして返すので、WEFの他の情報を他金融機関に知られ、プライバシーが犯されるおそれはない。このように、本実施形態は、ICカードの機密性という特徴を損なうことなく、ICカードを用いた取引の安全性を向上させることが可能である。
【0028】
また、本実施形態では、SEARCHコマンドにより検索されるべき領域を指定することが可能となっている。したがって、検索したい領域が明確である場合には、それを指定することにより、不必要な領域を検索する無駄を回避し、検索時間を抑制することが可能となっている。
さらに、SEARCHコマンドでは、検索インターバルバイト数が指定可能となっている。よって、検索する領域が同一であっても、検索パターンの内容又は検索事項の重要度等に合わせ、検索する速度を適切に加減することが可能となっている。
さらにまた、SEARCHコマンドでは、検索番号が指定可能となっている。したがって、WEFの中で任意の回数目に現れる検索パターンと同一パターンを有する情報について、そのオフセットアドレスを取得することが可能である。
【0029】
(その他の実施形態)
なお、本発明は、上記実施形態に限定されるものではない。上記実施形態は、例示であり、本発明の特許請求の範囲に記載された技術的思想と実質的に同一な構成を有し、同様な作用効果を奏するものは、いかなるものであっても本発明の技術的範囲に包含される。
【0030】
例えば、上記実施形態では、トランスペアレント構造のWEFを検索する場合について説明しているが、これは、検索対象を限定する意味ではない。SEARCHコマンドの対象は、例えばレコード構造のWEFであってもよい。この場合には、コマンドのパラメータP1、P2により検索を開始すべきオフセットアドレスを指定する代わりに、パラメータP2のみでレコードナンバーを指定することとなる。
【0031】
【発明の効果】
以上詳しく説明したように、発明によれば、内容の不明なファイルについて、特定の情報が保存されているか否かを確認することが可能である。そして、ファイルの中で任意の回数目に現れる検索パターンと同一パターンの情報を検索することが可能である。
【図面の簡単な説明】
【図1】SEARCHコマンドのAPDUを示す図である。
【図2】SEARCHコマンドを受信し、処理するときのICカード10の動作を示す流れ図である。
【図3】EEPROM15におけるファイル格納イメージを示す図である。
【図4】SEARCHコマンドの処理内容の変形例を示す流れ図である。
【図5】従来のICカードの構成、及びそのICカードとリーダライタ装置との接続関係を示すブロック図である。
【図6】EEPROM15内の階層構造を示すブロック図である。
【符号の説明】
11 I/Oインタフェース
12 CPU
13 ROM
14 RAM
15 EEPROM
20 リーダライタ装置
[0001]
BACKGROUND OF THE INVENTION
The present invention is, for files stored in the memory, to an IC card capable of searching whether owns the information for the specified pattern and the same pattern.
[0002]
[Prior art]
FIG. 5 is a block diagram showing a configuration of a conventional IC card and a connection relationship between the IC card and a reader / writer device.
A conventional IC card 10 normally includes an I / O interface 11, a CPU 12, a ROM 13, a RAM 14, and an EEPROM 15. The I / O interface 11 is an input / output circuit for transmitting and receiving data, and the CPU 12 communicates with the reader / writer device 20 via the I / O interface 11. A program to be executed by the CPU 12 is stored in the ROM 13, and the CPU 12 controls the IC card 10 based on this program. The RAM 14 is a memory used as a work area when the CPU 12 performs such overall control. On the other hand, the EEPROM 15 is a memory for storing original data to be recorded on the IC card 10.
[0003]
FIG. 6 is a block diagram showing a hierarchical structure in the EEPROM 15 shown in FIG. The EEPROM of this embodiment is composed of three layers. The three hierarchies are a first layer MF (Master File), a second layer DF (Dedicated File), and a third layer EF (Elementary File). MF is a file of the entire data memory. The MF is a file for storing data common to each application (service). For example, information such as the name, address, and telephone number of the owner of the IC card 10 is recorded. The DF is a dedicated file, and the DF is set for each application. The EF is a basic file, and there are two types: IEF that stores data that is interpreted and executed when the CPU manages and controls the IC card, and WEF (working basic file) that stores data used by the application.
[0004]
All accesses to the memories 13, 14, and 15 in the IC card 10 are performed via the CPU 12, and these memories cannot be directly accessed from the outside. That is, when a predetermined “command” is given from the reader / writer device 20 to the CPU 12, the CPU 12 interprets and executes this “command” and returns the result as a “response” to the reader / writer device 20. Become.
[0005]
When the reader / writer device 20 wants to know the contents of a specific WEF, the IC card 10 must be notified of the file ID of the WEF, and the IC card 10 must be selected. Furthermore, when the reader / writer device 20 wants to know only specific information, not the entire information of the selected file, the reader / writer device 20 must notify the IC card 10 of the record ID or offset address in which the information is written. I must. When the offset address or the like is notified, the IC card 10 reads the information written in the offset address and transmits it to the reader / writer device 20.
[0006]
On the other hand, if the reader / writer device 20 does not know the record ID or offset address in which the requested information is written, the entire contents of the WEF are received from the IC card 10 and the content of the file is confirmed on the reader / writer device 20 side. Had to do. Furthermore, if the file ID of the WEF that owns the necessary information is not known, the contents of all the WEFs in the DF must be received from the IC card 10 and the contents must be examined.
[0007]
[Problems to be solved by the invention]
However, with the above-described conventional IC card, the communication speed with the reader / writer device is relatively slow, around 9600 bps, and enormous time is required to transmit all the information of one basic file to the reader / writer device. It becomes. For this reason, when there is no information such as an offset address in which a WEF file ID or required information is written in the reader / writer device, there is a problem that the information cannot be actually obtained from the IC card.
[0008]
Recently, there is an increasing demand for the common use of one IC card in a plurality of institutions. As an example, one IC card may be used as a medical record for recording treatment histories at a plurality of medical institutions. In such a case, for reasons such as safe management of the medical chart, each medical institution usually provides and uses a WEF separately. On the other hand, before giving a drug to a patient, a doctor needs to check whether another medical institution has been given anything that causes harmful side effects in relation to the drug. Therefore, it is desirable for doctors to be able to refer to WEF managed by other medical institutions, but if all WEF contents can be referred to unconditionally, there is a problem that patient privacy is impaired. .
[0009]
SUMMARY OF THE INVENTION An object of the present invention is to provide an IC card that can quickly check whether there is specific information in a file without compromising security.
[0012]
[Means for Solving the Problems]
In order to solve the above-mentioned problem, the invention of claim 1 is a retrieval means for retrieving information having the same pattern as an externally specified pattern from the contents of the file in an IC card storing a file in a memory. And a transmission means for transmitting the address where the information is stored to the outside when the search means finds the information, and the search means records the number of times the information is found. And a number specifying means for storing a value specified by an instruction from the outside, wherein the transmission means reaches a value stored in the number specifying means when the value recorded in the number recording means In this case, the address at which the information found last is stored is transmitted to the outside.
[0013]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments according to the present invention will be described in more detail with reference to the drawings.
(First embodiment)
First, a first embodiment of an IC card according to the present invention will be described. This embodiment is the same as the conventional IC card in the hardware configuration, but searches for data having the same pattern as the specified pattern in the transparent WEF specified by the current EF or the short EF-ID. Thus, it differs from a conventional IC card in that it has a function of transmitting the retrieved data position as a response. The above function is exhibited by receiving a SEARCH command from the reader / writer device 20 and processing it.
[0014]
FIG. 1 is a diagram illustrating an APDU of a SEARCH command.
The first to fourth bytes of the SEARCH command are a command class (CLA), a type code (INS), and parameters (P1, P2) in order. The parameters P1 and P2 specify the offset address (hereinafter referred to as “search start address”) at the head of the area to be searched in the search target WEF. That is, when the eighth bit (b8) of the parameter P1 is 0, P1 and P2 specify the address where the search is to be started with the remaining 15 bits. On the other hand, when b8 of the parameter P1 is 1, the upper 5 bits of P1 specify the short EF-ID, and the 8 bits of P2 specify the search start address.
[0015]
The data field subsequent to the sixth bit is information on a pattern to be searched. The data field is composed of a 2-byte search end file address, a 2-byte search interval byte number, a 1-byte search number, and search data (search pattern) having an arbitrary number of bytes. The meaning of each piece of information constituting these data fields will be described in detail in the description relating to FIG.
The fifth bit LC is data field length (number of bytes) information.
[0016]
FIG. 2 is a flowchart showing the operation of the IC card 10 when receiving and processing a SEARCH command.
If there is a SEARCH command from the reader / writer device 20, the CPU 12 performs a pre-execution check (S501), and if there is an error, sends a message to that effect (S503). The pre-execution check is performed as to whether the parameters P1 and P2 of the command are appropriate, whether the contents of the LC and the data field are consistent, or the like. For example, when the value of LC is less than 6 or contradicts the size of the data field, the SEARCH command does not include appropriate information, and an error message to that effect is transmitted.
[0017]
Next, a read file is designated (S504). When b8 of P1 is 1, a file search subroutine is specified using a file search subroutine with a short EF-ID. To the short EF-ID search subroutine, the file entry address (CRT-DF) of the current DF, the short EF-ID of the EF to be searched, and the file type (WEF in this embodiment) are passed as arguments.
[0018]
The CPU 12 searches for the designated file (S505). Hereinafter, the specific method will be described with reference to FIG. FIG. 3 is a diagram showing a file storage image in the EEPROM 15. In the figure, CRT-DP is a pointer indicating the address of the file entry of the stored directory address at the top of all stored directory addresses. In the EEPROM 15, a system information area and an MF directory are stored in order from the largest address, and directories such as WEF are stored without a gap. The short EF-ID search subroutine refers to the file directory in order from CRT-DF to CRT-DP, and is a WEF with CRT-DF as the parent DF, and the lower 5 bits of the file ID match the short EF-ID. Search for things.
[0019]
As a result of the above search, if the search error or the searched file is a record format WEF (S506 in FIG. 2), the corresponding message is transmitted (S507, S521), and the command is terminated. Other than the above, the address of the searched file is set to the current EF address of the RAM 14 (S508).
[0020]
Next, the read file is checked (S510). If there is an error, a message to that effect (S511) is transmitted (S521).
Check items include CRC check of the data area when the current EF address of the RAM 14 is 0000h, the search start address or the search end address exceeds the write-aware pointer, and the search start address exceeds the search end address. It is an error.
[0021]
“When the current EF address of the RAM 14 is 0000h” means that the current EF address is not selected. This case is processed as an error when the short EF-ID is not specified.
“When the search start address or search end address exceeds the right-ahead pointer” is handled as an error because the wrong range is specified as the search range beyond the area where the data is actually stored Because. In addition, even when “the search start address exceeds the search end address”, the content of the command is inconsistent, so error processing is performed.
The reason why the error message is transmitted in the case of “data area CRC check error” is to warn the reader / writer device that the data stored in the WEF originally has an abnormality.
[0022]
In S512, the search start position of the search file is acquired by referring to the parameters P1 and P2 of the SEARCH command. When b8 of P1 is 1, the 8 bits of P2 are recognized as an offset address from the beginning of the file, and are set as a reading start position when performing a search. When b8 of P1 is 0, (the lower 7 bits of P1) + (a total of 15 bits of P2) is recognized as an offset address from the beginning of the file, and is set as a reading start position. Here, it is confirmed again whether or not the search start address exceeds the write append pointer. If it exceeds (S514), a message to that effect is transmitted (S515, S521).
Next, the search end address is checked (S516). It is confirmed that the search end address does not exceed the write append pointer (or file end). If it exceeds, the write append pointer (or file end) is set to the search end address (S517).
[0023]
Next, the CPU 12 searches for data (S518). The search key (pattern) is search data after the 6th byte from the top of the Data Field, and the search key length (search pattern length) is LC-5. When (search address) + (search key length) exceeds the search end address, the search is ended, a message to that effect is transmitted, and the command is ended. The comparison method is performed by a complete match of the search key length (search pattern length). If matching data is found for the search number (S519), the 2-byte offset address in the data file and a normal message are transmitted (S521), and the process ends. If they do not match, the address is advanced by the interval size (the number of search interval bytes specified in the data field of the command), and the next search is performed (S518).
[0024]
(Modification of the first embodiment)
The processing content of the SEARCH command described in the first embodiment can be modified in various ways. FIG. 4 is a flowchart showing a modification of the processing content of the SEARCH command. The processing content of the SEARCH command in this modification is different from that of the first embodiment in that there is processing (S522, S523) for newly confirming the number of search pattern discovery between S519 and S521.
In this modification, when the same data as the search pattern specified in the search of S518 and S519 is found, 1 is added to the found number N stored at a predetermined address on the RAM 14 (S522). Next, it is determined whether or not the found number N is greater than or equal to the search number specified in the command data field (S523). If the number N of discoveries is equal to or greater than the search number, the process of S521 is performed. That is, the address of the data found at the number of times specified by the search number is transmitted to the reader / writer device 20. In other cases, the process returns to S518 and the search is continued.
[0025]
As described above, when the SEARCH command is executed, the IC card according to the first embodiment of the present invention and the modification thereof searches for information of the same pattern as the pattern specified in the selected WEF, and as a result, When information of the same pattern is found, the offset address of the information is transmitted as a response to the outside. Therefore, in this embodiment, only specific information can be read from the WEF whose format is unknown. That is, if the offset address of the area where the specific information is stored is first obtained using the SEARCH command, only the specific information is read from the WEF by using a READ BINARY command or the like based on the offset address. be able to. In other words, in the present embodiment, when specific information is acquired from a WEF whose format is unknown, the communication time can be suppressed to the minimum necessary by avoiding the need to read out all of its contents to the outside, and promptly It is possible to acquire the specific information.
[0026]
Further, the present embodiment increases the utility value of an IC card when one IC card is used for multiple purposes in a plurality of systems. Here, as an example, consider a case where one IC card can be used simultaneously in two financial systems. In this case, from the viewpoint of protecting the cardholder's privacy, access by the B financial system should not be allowed for the WEF recording the transaction details of the A financial system. On the other hand, as for the B financial system, when lending to the cardholder, it is necessary to confirm in advance whether or not the cardholder has a borrowing from another financial institution and to ensure the safety of the transaction. .
[0027]
In such a case, if each of the financial systems A and B allows each WEF to execute the SEARCH command using “borrowed money” as a search pattern, each financial system will receive a cardholder from another financial institution. It is possible to check whether or not money is borrowed. In addition, since the SEARCH command returns only the offset address of the area where the search pattern matches as a response, other information of the WEF is known to other financial institutions, and there is no possibility that privacy will be violated. As described above, this embodiment can improve the safety of transactions using an IC card without impairing the characteristic of confidentiality of the IC card.
[0028]
In the present embodiment, it is possible to specify an area to be searched by the SEARCH command. Therefore, when the area to be searched is clear, it is possible to avoid unnecessary use of searching for an unnecessary area and to reduce the search time by specifying it.
Further, in the SEARCH command, the number of search interval bytes can be specified. Therefore, even if the search area is the same, the search speed can be appropriately adjusted according to the content of the search pattern or the importance of the search item.
Furthermore, a search number can be specified in the SEARCH command. Therefore, it is possible to obtain the offset address of information having the same pattern as the search pattern appearing at an arbitrary number of times in the WEF.
[0029]
(Other embodiments)
The present invention is not limited to the above embodiment. The above-described embodiment is an exemplification, and the present invention has substantially the same configuration as the technical idea described in the claims of the present invention, and any device that exhibits the same function and effect is the present invention. It is included in the technical scope of the invention.
[0030]
For example, in the above-described embodiment, a case where a transparent structure WEF is searched has been described. However, this does not mean that the search target is limited. The target of the SEARCH command may be, for example, a record structure WEF. In this case, instead of specifying the offset address where the search should be started by the command parameters P1 and P2, the record number is specified only by the parameter P2.
[0031]
【The invention's effect】
As described above in detail, according to the present invention, it is possible to confirm whether or not specific information is stored for a file whose contents are unknown. Then, it is possible to search for information having the same pattern as the search pattern appearing any number of times in the file.
[Brief description of the drawings]
FIG. 1 is a diagram illustrating an APDU of a SEARCH command.
FIG. 2 is a flowchart showing the operation of the IC card 10 when receiving and processing a SEARCH command.
FIG. 3 is a diagram showing a file storage image in the EEPROM 15;
FIG. 4 is a flowchart showing a modification of the processing content of the SEARCH command.
FIG. 5 is a block diagram showing a configuration of a conventional IC card and a connection relationship between the IC card and a reader / writer device.
6 is a block diagram showing a hierarchical structure in the EEPROM 15. FIG.
[Explanation of symbols]
11 I / O interface 12 CPU
13 ROM
14 RAM
15 EEPROM
20 Reader / writer device

Claims (1)

メモリにファイルを格納しているICカードにおいて、
前記ファイルの内容から、外部より指定されたパターンと同一パターンを有する情報を検索する検索手段と、
前記検索手段が前記情報を発見した場合に、前記情報が格納されているアドレスを外部に送信する送信手段とを備え、
前記検索手段は、
前記情報を発見した回数を記録する回数記録手段と、
外部からの命令により指定された値を記憶する回数指定手段と
を有し、
前記送信手段は、前記回数記録手段に記録されている値が前記回数指定手段に記憶されている値に達したときに、最後に発見された前記情報の格納されているアドレスを外部へ送信すること
を特徴とするICカード。
For IC cards that store files in memory,
Search means for searching for information having the same pattern as the externally designated pattern from the contents of the file;
Transmission means for transmitting the address where the information is stored to the outside when the search means finds the information;
The search means includes
Number-of-times recording means for recording the number of times the information was found;
A number of times designation means for storing a value designated by an instruction from the outside, and
When the value recorded in the number recording means reaches the value stored in the number designation means, the transmission means transmits the address where the information found last is stored to the outside. IC card characterized by this.
JP28646496A 1995-12-22 1996-10-29 IC card Expired - Fee Related JP3718565B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP28646496A JP3718565B2 (en) 1995-12-22 1996-10-29 IC card

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP7-335509 1995-12-22
JP33550995 1995-12-22
JP28646496A JP3718565B2 (en) 1995-12-22 1996-10-29 IC card

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2005220282A Division JP2005322273A (en) 1995-12-22 2005-07-29 Ic card

Publications (2)

Publication Number Publication Date
JPH09231332A JPH09231332A (en) 1997-09-05
JP3718565B2 true JP3718565B2 (en) 2005-11-24

Family

ID=26556329

Family Applications (1)

Application Number Title Priority Date Filing Date
JP28646496A Expired - Fee Related JP3718565B2 (en) 1995-12-22 1996-10-29 IC card

Country Status (1)

Country Link
JP (1) JP3718565B2 (en)

Also Published As

Publication number Publication date
JPH09231332A (en) 1997-09-05

Similar Documents

Publication Publication Date Title
JP2537199B2 (en) IC card
KR920007410B1 (en) Safe file system for a portable data carrier
JP3820999B2 (en) Proximity communication system and proximity communication method, data management apparatus and data management method, storage medium, and computer program
US7281101B2 (en) Memory device storing data relating to specific application programs
US4839792A (en) Portable electronic apparatus with a device for determining data validity
EP2642422B1 (en) Ic card and ic card control method
CN102422256A (en) Method for accessing a portable data storage medium with auxiliary module and portable data storage medium
JP4891587B2 (en) Portable electronic device, IC card and IC module
WO2002003271A1 (en) Ic card, method for backing up ic card, and restoring method
JP2005322273A (en) Ic card
JP3718565B2 (en) IC card
JP5301018B2 (en) Portable electronic device
JP2004252968A (en) Semiconductor memory card and control program
JP3545045B2 (en) Creating a pattern file for IC card access
JP2537200B2 (en) Portable electronic devices
JP4318494B2 (en) IC card and IC card program
JPH1074243A (en) Ic card
JP4100166B2 (en) IC card and database access method using the same
CN101004796A (en) Recording method, recorder and ic card
JP7397402B2 (en) Electronic information storage medium, data transmission method, and program
JP4059452B2 (en) IC card
US20020158122A1 (en) Method and system to interpret and manage different smart card data architectures
JP4071377B2 (en) IC card
JPS61251985A (en) Memory protecting mechanism
JP4176889B2 (en) IC card

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20050513

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050531

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050729

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20050905

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

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20090909

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20100909

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20110909

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20110909

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20120909

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20120909

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20130909

Year of fee payment: 8

LAPS Cancellation because of no payment of annual fees