JP4184751B2 - IC card and application program selection method in IC card - Google Patents

IC card and application program selection method in IC card Download PDF

Info

Publication number
JP4184751B2
JP4184751B2 JP2002314683A JP2002314683A JP4184751B2 JP 4184751 B2 JP4184751 B2 JP 4184751B2 JP 2002314683 A JP2002314683 A JP 2002314683A JP 2002314683 A JP2002314683 A JP 2002314683A JP 4184751 B2 JP4184751 B2 JP 4184751B2
Authority
JP
Japan
Prior art keywords
application program
card
tcp
application
selecting
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
JP2002314683A
Other languages
Japanese (ja)
Other versions
JP2004151864A (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 JP2002314683A priority Critical patent/JP4184751B2/en
Publication of JP2004151864A publication Critical patent/JP2004151864A/en
Application granted granted Critical
Publication of JP4184751B2 publication Critical patent/JP4184751B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)
  • Credit Cards Or The Like (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、複数のアプリケーションプログラム(以下、単にアプリケーションという)を実行可能なICカードに関し、特に、複数のアプリケーションの切り替えに関するものである。
【0002】
【従来の技術】
従来、JavaCard(Sun Microsystems社の登録商標)やMultosのような複数のアプリケーションプログラムを実行可能なICカードは、ISO7816−4に従い、アプリケーション毎にAIDという5〜16バイトの固有の識別子を付け、そのAIDによりアプリケーションを選択してから、続く処理を指示するという手順を取っている。
【0003】
例えば、クレジットの支払い処理を行うには、まず「SELECT FILExxxx」(xxxxは、クレジットアプリケーションのAID)として、クレジットアプリケーションを選択し、次に認証コマンドや支払いコマンドを端末からカードに送信すると、それらのコマンドが選択済みのクレジットアプリケーションに渡される
【0004】
AIDは、国内および世界中で重複がないように登録制により付与される5〜16バイトの識別子で、AIDによりアプリケーションを一意に特定することができる。
【0005】
ICカードは、携帯電話、携帯情報端末(PDA:Personal Digital Assistant)、情報家電などの様々な機器を介してネットワーク、特にインターネットに接続し、インターネットの標準的なプロトコルであるTCP/IPによる通信を行うことにより、その適用範囲を広げることが可能になる。
【0006】
しかしながら、複数のアプリケーションを実行可能なICカードが、TCP/IPによる通信を行うためには、TCP/IPで用いられているIPアドレスおよびポート番号によりアプリケーションの指定を行う必要がある。
【0007】
TCP/IPにおいては、IPアドレスによりコンピュータや携帯電話などの機器を特定し、ポート番号により該機器の上で動作するアプリケーションを特定している。一つのアプリケーションで複数のポートを使用することもある。
【0008】
従来のICカードは、ICカードリーダ/ライタなどの端末装置との通信をISO7816に従って行うため、TCP/IPによる通信を行うことはできないから、端末装置にTCP/IPを解釈し、ICカード専用のコマンドに変換するソフトウェアを追加しなければならない。
【0009】
このため、ISO7816の下位層であるISO7816−3上にTCP/IPを載せる提案が、IETF(Internet Engineering Task Force)に対して為されている(例えば、非特許文献1参照。)。
【0010】
しかしながら、上述の提案においては、通信プロトコルの実装が主体であるため、ISO7816の上位層であるISO7816−4により規定されているAIDによる複数アプリケーションの切り替えが考慮されていないという問題がある。
【0011】
また、ISO7816上にTCP/IPを簡易化し、更にアプリケーション切り替えを考慮したSmartTPと呼ぶ実験用プロトコルもIETFに対して提案されている(例えば、非特許文献2参照。)。
【0012】
しかしながら、SmartTPにおいては、各々のアプリケーションはエージェントと呼ばれ、2バイトのエージェント番号を付けて区別されているが、5〜16バイトのAIDで区別可能なISO7816−4とは異なり、互換性がないという問題がある。
【0013】
【非特許文献1】
Mobile-Mind社、“IP and ARP over ISO 7816”、[online]、2001年1月、[平成14年10月12日検索]、インターネット<URL http://www.scdk.com/draft-guthery-ip7816-01.txt>
【非特許文献2】
Schlumberger CP8、“SmartTP Smart Transfer Protocol”、[online]、2001年6月、[平成14年10月12日検索]、インターネット<URL: http://www.satersprings.org/pub/id/draft-urien-smarttp-00.txt>
【0014】
【発明が解決しようとする課題】
本発明は上述の問題点に鑑みてなされたものであり、複数のアプリケーションを切り替えて使用可能なICカードにおいて、TCP/IPとISO7816−4のどちらのプロトコルでも複数アプリケーションを選択できる機能を提供することを目的とする。
【0015】
【課題を解決するための手段】
上記目的を達成するために、本発明の第1の態様は、端末装置とデータの受け渡しを行い、複数のアプリケーションプログラムの各々を内部に備えるCPUにおいて実行可能なICカードであって、アプリケーションプログラムを実行する以前に、TCP IP プロトコルのポート番号とアプリケーションプログラムを関連付けて記憶する対応テーブルと、前記端末装置から受信したコマンド中に含まれる通信手順判定情報に応じて、異なる選択経路を経て実行するアプリケーションプログラムを選択するアプリケーション選択手段と、前記アプリケーション選択手段が、前記端末装置から受信したAPDUコマンドの先頭のCLAにより通信手順を判定する判定手段と、前記判定手段の判定結果に基づいて、前記対応テーブルを経由してアプリケーションプログラムを選択する、またはAPDUコマンドの先頭のCLAとINSとアプリケーションIDによりアプリケーションプログラムを選択する、のどちらかの手順においてアプリケーションプログラムを選択する選択手段と、を備え、前記判定手段が、前記端末装置から受信したコマンドの中のAPDUコマンドの先頭のCLAにより、TCP/IPおよびISOのどちらの通信手順か判定し、前記選択手段が、前記判定手段の判定結果がTCP/IPの場合、TCP/IPのデータの中からポート番号を取得し、前記ポート番号に基づいて前記対応テーブルに記憶している対応するアプリケーションプログラムを選択し、前記判定手段の判定結果がISOの場合、APDUコマンドの先頭のCLAとINSとアプリケーションIDによりICカード内のアプリケーションプログラムを選択する、ことを特徴とするICカードである。
【0019】
本発明の第2の態様は、端末装置とデータの受け渡しを行い、内部に備えるCPUにより複数のアプリケーションプログラムの各々を実行するICカードにおける実行するアプリケーションプログラムの選択方法であって、アプリケーションプログラムを実行する以前に、端末装置から受信したコマンド中に含まれる通信手順判定情報に応じて、異なる選択経路を経て実行するアプリケーションプログラムを選択する段階と、アプリケーションを選択する際に、端末装置がICカードに対して発行するコマンドの中のAPDUコマンドの先頭のCLAに対して、TCP/IPおよびISOのどちらの通信手順か記述する段階と、端末装置から受信した前記コマンドの中のAPDUコマンドの先頭のCLAにより、通信手順がTCP/IPおよびISOのどちらであるか判定する段階と、前記判定結果がTCP/IPの場合、TCP/IPのデータの中からポート番号を取得し、前記ポート番号に基づいて TCP IP プロトコルのポート番号とアプリケーションプログラムを関連付けて記憶する対応テーブルに記憶している対応するアプリケーションプログラムを選択する段階と、前記判定手段の判定結果がISOの場合、APDUコマンドの先頭のCLAとINSとアプリケーションIDによりICカード内のアプリケーションプログラムを選択する段階と、を行なうようにしたものである。
【0021】
【発明の実施の形態】
以下、本発明を図示する実施形態に基づいて説明する。図1は、本発明のICカード内部の概要構成図である。ICカード1は、I/O制御部2、CPU3、記憶手段4、プログラム格納部5、作業用メモリ6を備えている。
【0022】
I/O制御部2は、ICカード1がICカード用リーダ/ライタ7と通信を行うためのインタフェースである。
【0023】
CPU3は、プログラム格納部5内に記録している様々な処理プログラムを実行するものである。処理プログラムを実行する際に、必要に応じて記憶手段4や作業用メモリ6を使用する。
【0024】
記憶手段4は、実際には不揮発メモリであるEEPROM(Electrically Erasable Programmable Read-Only Memory)であり、様々なデータを記憶し、保持するのに使用する。記憶手段4は、その一部に対応テーブル8を記憶する領域を備えている。
【0025】
図2に、対応テーブル8の一実施形態を示す。図2は、TCP/IPのポート番号一つ一つに対して、対応するアプリケーションを記憶したものである。一つのアプリケーションが複数のポートを使用する場合は、ポート番号の「10」と「30」のように、同じAIDを記憶する。
【0026】
また、対応テーブル8は、図3のように構成することも可能である。図3の対応テーブル8においては、一つのAIDに対して、使用するTCP/IPポートを記憶している。アプリケーションが複数のポートを使用する場合は、AIDが「0x00 01 02 03 01(「0x」は16進数表記であることを示す。以下、同様)のように、複数のポート番号を記憶する。
【0027】
対応テーブル8の形式は、AIDとアプリケーションが使用する全てのポート番号との関連付けが可能であれば、図2および図3に示す形式に限定されるものではない。
【0028】
対応テーブル8における通信手順とAIDの対応付けは、カード製造時、ICカードへのアプリケーションのダウンロード時、ダウンロード後のインストール(初期化)時など、アプリケーションを選択および実行する以前であれば、いつでもよい。
【0029】
また、実行時にアプリケーションがICカード1のOSに対して、登録や削除を指示するなど、動的に登録および削除してもよい。
【0030】
プログラム格納部5は、CPU3が実行可能な処理プログラムを記憶するものである。カード製造時に記録するROM(Read Only Memory)か、処理プログラムをロードして使用することが可能なEEPROMがある。
【0031】
プログラム格納部5には、複数のアプリケーションの他に、アプリケーション選択手段9も記憶している。
【0032】
アプリケーション選択手段9は、判定手段10と、選択手段11とを備えており、ISO7816−4により規定されている端末装置からICカード1へ送られるAPDU(Application Protocol Data Unit)コマンド中に含まれる通信手順判定情報に応じて、異なる選択経路を経て実行するアプリケーションプログラムを選択するものである。
【0033】
次に、図4のフローチャートに従い、クレジット処理および入退室管理の2つのアプリケーションを実行可能で、IPアドレスを備えるICカード1がアプリケーションを選択する手順を例に説明する。
【0034】
図5に、TCP/IPによる通信と、ISO7816−4によるコマンドの両方を処理可能な、クレジット処理、および入退室管理の2つのアプリケーションの対応テーブル8を示す。
【0035】
クレジット処理(AIDが「0x01 02 03 04 05 01」)は、クレジットカードとしての決済機能と、ポイント管理機能を備え、TCP/IPのポート番号10番と11番を使用するものとする。
【0036】
入退室管理(AIDが「0x01 02 03 04 05 02」)は、いくつかあるドアゲートを開閉する認証処理と、どのドアをいつ開閉したかの記録を保存する機能を備え、TCP/IPのポート番号20を使用するものとする。
【0037】
以下の説明においては、TCP/IPまたはAPDUコマンドがICカードに届く過程は、端末装置やルータなどのネットワーク機器の処理であるから、説明を省略する。
【0038】
図6は、ISO7816−4により規定されている端末装置からICカード1へ送られるAPDUコマンドの構造を示すものである。
【0039】
APDUコマンドの先頭のCLAは、クラスバイトと呼ばれるものであり、該コマンドの内容がどの程度ISO7816−4に従っているかを示す。例えば、CLAが「0x00」の場合は、コマンドとレスポンスのコーディング方法および構造がISO7816−4に準拠し、「0x90」の場合は、コマンドとレスポンスの構造はISO7816−4に準拠するが、一部のコーディングはベンダーの実装に依存し、任意であることを示す。CLAが「0xD0」の場合は、コマンドとレスポンスのコーディング方法および構造が任意であることを示し、これをTCP/IPなどと定義することで、通信手順を区別する。
【0040】
INSは、コマンドの種類を表し、P1およびP2がコマンドに与えるパラメータを示し、Lcはデータの長さである。
【0041】
APDUコマンドは、図6の形式の他に、Lc以下を省略する、データ部の後ろにLeと呼ばれるICカードからの返信の長さを付ける、付けない、という複数の構造を用いることが可能である。
【0042】
ICカード1は、端末装置から電源の供給を受け、OS部を起動し、APDUコマンドの受信まで待機する。
【0043】
ISO7816−4に準拠するクレジット処理を選択する場合は、図7(a)に示す、INSに選択コマンド(SELECT FILE:「0xA4」)を、P1およびP2にAIDを用いて選択する対象を指定することを示す「0x0400」を、データ部にAID「0x01 02 03 04 05 01」を、Lcにデータ部の長さ、すなわちAIDの長さ「6バイト」を格納したAPDUコマンドを発行する。
【0044】
ICカード1が図7(a)に示すAPDUコマンドを受信すると、判定手段10は、端末装置から受信したAPDUコマンドのCLAを参照し、CLAが「0x00」であるから、該APDUコマンドがISO7816−4に準拠したものであると判定する。
【0045】
次に、選択手段11は、INSが選択コマンドであるから、P1、P2、およびLcによりデータ部に格納されているAID「0x01 02 03 04 05 01」を参照し、クレジット処理がプログラム格納部5に存在するか否かを確認する。
【0046】
クレジット処理がプログラム格納部5に存在する場合、選択手段11は、クレジット処理を選択し、選択済みのマークを付ける。
【0047】
次に、選択手段11は、選択済みのクレジット処理にコマンドを渡し、制御を移す。
【0048】
クレジット処理の処理結果(例えば、「選択OK」を示すコード)を端末装置に送信し、コマンド受信待ち状態に戻る。
【0049】
次に、選択したクレジット処理における支払いコマンド(例えば、0x90 01...とする)を受信した場合、判定手段10は、CLAが「0x90」なので、TCP/IPではなく、ISO7816−4に準拠するコマンドであると判定する。
【0050】
INSは、支払いコマンド(「0x01」)であるから、選択手段11は、アプリケーションを選択することなく、選択済みのクレジット処理に支払いコマンドを渡し、制御を移す。
【0051】
クレジット処理は、支払いの処理を行い、例えば残高を端末装置に送信し、コマンド受信状態に戻る。
【0052】
TCP/IPに準拠する入退出管理における最新ログの参照を行う場合は、図7(b)に示す、CLAに「0xD0」を、INSにアプリケーション選択手段9を実行するコマンド(例えば、「0x00」)を、P1およびP2にプロトコル番号(例えば、「0x00 21」がIPプロトコルであると定義したもの)を、データ部にTCP/IP形式の通信データであるIPデータグラムを、Lcにデータ部の長さ、すなわちIPデータグラムの長さを格納したAPDUコマンドを発行する。
【0053】
ここで、IPデータグラムとは、図8に示すようにIPヘッダー、TCPヘッダー、アプリケーションデータから構成されており、TCP/IPに規定されているデータ形式そのものである。
【0054】
TCPヘッダーとアプリケーションデータを合わせて、TCPセグメントと呼ぶが、図9に示すように、TCPセグメントには、TCP宛先のポート番号を記述することになっているので、最新ログ参照処理が使用するポート番号「20」を格納する。
【0055】
ICカード1が図7(b)に示すAPDUコマンドを受信すると、判定手段10は、端末装置から受信したAPDUコマンドのCLAを参照し、CLAが「0xD0」であるから、該APDUコマンドがTCP/IPに準拠したものであると判定する。
【0056】
次に、選択手段11は、P1、P2、およびLcによりデータ部に格納されているIPデータグラムを参照し、TCPセグメントのヘッダーにあるTCP宛先ポート番号からポート番号「20」を取得する。
【0057】
選択手段11は、取得したポート番号「20」を用いて、対応テーブルを参照し、ポート番号「20」を使用するアプリケーション、すなわち入退室管理のAID「0x01 02 03 04 05 02」を取得し、入退室管理がプログラム格納部5に存在するか否かを確認する。
【0058】
入退室管理がプログラム格納部5に存在する場合、選択手段11は、入退室管理を選択し、選択済みのマークを付ける。
【0059】
次に、選択手段11は、選択済みの入退室管理にTCPセグメントのアプリケーションデータを渡し、制御を移す。
【0060】
入退室管理は、最新ログの参照要求に従い、処理結果として最新のログを端末装置に送信し、コマンド受信待ち状態に戻る。
【0061】
また、支払い処理をISO7816−4の通信で行ったクレジット処理が、TCP/IPのポート番号「10」を用いて、例えば、Web画面上からICカード1に累計ポイントを問い合わせるなどの機能を持つことができる。
【0062】
この場合、入退室管理のアプリケーションの選択と同様に、APDUコマンドのCLAにより、TCP/IPによる通信であることを判定し、ポート番号「10」により対応テーブルを参照して、クレジット処理を選択し、クレジット処理に累計ポイントの問い合わせを行うことが可能である。
【0063】
以上、本発明を実施の形態に基づいて詳細に説明してきたが、本発明によるICカードおよびICカードにおけるアプリケーションプログラム選択方法は、上述の実施の形態に何ら限定されるものではなく、本発明の趣旨を逸脱しない範囲において種々の変更が可能なことは当然のことである。
【0064】
【発明の効果】
以上のとおり、本発明に係るICカードおよびICカードにおけるアプリケーションプログラム選択方法によれば、通信手順を判定し、対応テーブルを参照することで、インターネットの標準プロトコルであるTCP/IPと、ICカードの標準プロトコルであるISO7816−4の両方のアプリケーションの選択方法をとることができる。
【0065】
また、TCP/IPおよびISO7816の両方のプロトコルでアクセス可能なアプリケーションを搭載可能なICカードを用いたシステムを提供できるため、様々な用途に使えるICカードを提供することができる。
【図面の簡単な説明】
【図1】 本発明のICカード内部の概要構造図である。
【図2】 本発明の対応テーブルの構成の例である。
【図3】 本発明の対応テーブルの異なる構成の例である。
【図4】 本発明のICカードにおけるアプリケーションプログラムの選択のフローチャートである。
【図5】 本発明の対応テーブルにおいて、2つのアプリケーションを記憶した例である。
【図6】 ISO7816−4におけるAPDUコマンドの構成を示す説明図である。
【図7】 本発明のAPDUコマンドの実施例である。
【図8】 ISO7816上を伝送されるTCPセグメント、IPデータグラムの構成を示す説明図である。
【図9】 TCPセグメントの構成を示す説明図である。
【符号の説明】
1 ICカード
2 I/O制御部
3 CPU
4 記憶手段
5 プログラム格納部
6 作業用メモリ
7 ICカード用リーダ/ライタ
8 対応テーブル
9 アプリケーション選択手段
10 判定手段
11 選択手段
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an IC card capable of executing a plurality of application programs (hereinafter simply referred to as applications), and more particularly to switching of a plurality of applications.
[0002]
[Prior art]
Conventionally, an IC card capable of executing a plurality of application programs such as JavaCard (registered trademark of Sun Microsystems) and Multis attaches a unique identifier of 5 to 16 bytes called AID for each application in accordance with ISO 7816-4. After selecting an application by AID, a procedure for instructing subsequent processing is taken.
[0003]
For example, to perform a credit payment process, first select a credit application as “SELECT FILExxxx” (xxx is the AID of the credit application), and then send an authentication command or payment command from the terminal to the card. The command is passed to the selected credit application
The AID is an identifier of 5 to 16 bytes given by a registration system so that there is no duplication in the country and the world, and the application can be uniquely specified by the AID.
[0005]
IC cards connect to networks, especially the Internet, via various devices such as mobile phones, personal digital assistants (PDAs), and information appliances, and communicate using TCP / IP, the standard Internet protocol. By doing so, it is possible to widen the application range.
[0006]
However, in order for an IC card capable of executing a plurality of applications to perform communication using TCP / IP, it is necessary to specify an application using an IP address and a port number used in TCP / IP.
[0007]
In TCP / IP, a device such as a computer or a mobile phone is specified by an IP address, and an application operating on the device is specified by a port number. A single application may use multiple ports.
[0008]
Since a conventional IC card performs communication with a terminal device such as an IC card reader / writer in accordance with ISO 7816, communication using TCP / IP cannot be performed. Therefore, the terminal device interprets TCP / IP and uses a dedicated IC card. You have to add software that translates into commands.
[0009]
For this reason, proposals for placing TCP / IP on ISO 7816-3, which is a lower layer of ISO 7816, have been made for the Internet Engineering Task Force (IETF) (see Non-Patent Document 1, for example).
[0010]
However, in the above proposal, since the communication protocol is mainly implemented, there is a problem that switching of a plurality of applications by AID defined by ISO7816-4 which is an upper layer of ISO7816 is not considered.
[0011]
Also, an experimental protocol called SmartTP that simplifies TCP / IP on ISO7816 and further considers application switching has been proposed to the IETF (see, for example, Non-Patent Document 2).
[0012]
However, in SmartTP, each application is called an agent and is distinguished by attaching a 2-byte agent number. Unlike ISO 7816-4, which can be distinguished by an AID of 5 to 16 bytes, it is not compatible. There is a problem.
[0013]
[Non-Patent Document 1]
Mobile-Mind, “IP and ARP over ISO 7816”, [online], January 2001, [October 12, 2002 search], Internet <URL http://www.scdk.com/draft-guthery -ip7816-01.txt>
[Non-Patent Document 2]
Schlumberger CP8, “SmartTP Smart Transfer Protocol”, [online], June 2001, [October 12, 2002 search], Internet <URL: http://www.satersprings.org/pub/id/draft- urien-smarttp-00.txt>
[0014]
[Problems to be solved by the invention]
The present invention has been made in view of the above-described problems, and provides a function capable of selecting a plurality of applications using either the TCP / IP protocol or the ISO7816-4 protocol in an IC card that can be used by switching a plurality of applications. For the purpose.
[0015]
[Means for Solving the Problems]
In order to achieve the above object, according to a first aspect of the present invention, there is provided an IC card that exchanges data with a terminal device and that can be executed by a CPU provided with each of a plurality of application programs. Before execution, the correspondence table for storing the TCP / IP protocol port number and the application program in association with each other and the communication procedure determination information included in the command received from the terminal device are executed through different selection paths. An application selection unit that selects an application program, a determination unit that determines a communication procedure based on a CLA at the head of an APDU command received from the terminal device, and the correspondence based on a determination result of the determination unit App via table Selection means for selecting an application program in either of the following procedure: selecting an application program, or selecting an application program according to CLA and INS at the beginning of an APDU command and an application ID, The CLA at the head of the APDU command in the command received from the terminal apparatus determines whether the communication procedure is TCP / IP or ISO. When the determination result of the determination means is TCP / IP, the TCP / IP The port number is acquired from the / IP data, the corresponding application program stored in the correspondence table is selected based on the port number, and when the determination result of the determination means is ISO, the head of the APDU command CLA, INS and Application I The IC card is characterized in that an application program in the IC card is selected by D.
[0019]
According to a second aspect of the present invention, there is provided a method for selecting an application program to be executed in an IC card that exchanges data with a terminal device and executes each of a plurality of application programs by an internal CPU. Before selecting the application program to be executed via a different selection route according to the communication procedure determination information included in the command received from the terminal device, and when selecting the application, the terminal device is connected to the IC card. A step of describing which communication procedure of TCP / IP or ISO is described with respect to the CLA at the head of the APDU command in the command to be issued, and the CLA at the head of the APDU command in the command received from the terminal device Makes the communication procedure TCP / IP and A step of determining whether it is a ISO, if the determination result is TCP / IP, to retrieve the port number from the TCP / IP data, based on the port number, and port number of the TCP / IP protocol The step of selecting the corresponding application program stored in the correspondence table storing the application program in association, and if the determination result of the determination means is ISO, the CLA and INS at the head of the APDU command and the application ID are stored in the IC card. And selecting an application program.
[0021]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, the present invention will be described based on the illustrated embodiments. FIG. 1 is a schematic configuration diagram of the inside of an IC card according to the present invention. The IC card 1 includes an I / O control unit 2, a CPU 3, a storage unit 4, a program storage unit 5, and a work memory 6.
[0022]
The I / O control unit 2 is an interface for the IC card 1 to communicate with the IC card reader / writer 7.
[0023]
The CPU 3 executes various processing programs recorded in the program storage unit 5. When executing the processing program, the storage means 4 and the working memory 6 are used as necessary.
[0024]
The storage means 4 is an EEPROM (Electrically Erasable Programmable Read-Only Memory) which is actually a nonvolatile memory, and is used to store and hold various data. The storage means 4 has an area for storing the correspondence table 8 in a part thereof.
[0025]
FIG. 2 shows an embodiment of the correspondence table 8. FIG. 2 shows an application corresponding to each TCP / IP port number. When one application uses a plurality of ports, the same AID is stored, such as port numbers “10” and “30”.
[0026]
The correspondence table 8 can also be configured as shown in FIG. In the correspondence table 8 of FIG. 3, the TCP / IP port to be used is stored for one AID. When the application uses a plurality of ports, the AID stores a plurality of port numbers such as “0x00 01 02 03 01 (“ 0x ”indicates hexadecimal notation. The same applies hereinafter).
[0027]
The format of the correspondence table 8 is not limited to the format shown in FIGS. 2 and 3 as long as the association between the AID and all the port numbers used by the application is possible.
[0028]
The correspondence between the communication procedure and the AID in the correspondence table 8 may be any time before the selection and execution of the application, such as when the card is manufactured, when the application is downloaded to the IC card, or after installation (initialization) after downloading. .
[0029]
In addition, the application may dynamically register and delete such as instructing the OS of the IC card 1 to register or delete at the time of execution.
[0030]
The program storage unit 5 stores a processing program that can be executed by the CPU 3. There is a ROM (Read Only Memory) that is recorded when a card is manufactured, or an EEPROM that can be used by loading a processing program.
[0031]
The program storage unit 5 stores an application selection unit 9 in addition to a plurality of applications.
[0032]
The application selection unit 9 includes a determination unit 10 and a selection unit 11, and is included in an APDU (Application Protocol Data Unit) command sent from the terminal device defined by ISO 7816-4 to the IC card 1. According to the procedure determination information, an application program to be executed through different selection paths is selected.
[0033]
Next, according to the flowchart of FIG. 4, a procedure in which two applications of credit processing and entrance / exit management can be executed and the IC card 1 having an IP address selects an application will be described as an example.
[0034]
FIG. 5 shows a correspondence table 8 for two applications of credit processing and entry / exit management that can process both TCP / IP communication and ISO 7816-4 commands.
[0035]
The credit processing (AID “0x01 02 03 04 05 01”) has a payment function as a credit card and a point management function, and uses TCP / IP port numbers 10 and 11.
[0036]
The entrance / exit management (AID is “0x01 02 03 04 05 02”) has an authentication process that opens and closes some door gates and a function that saves a record of which doors are opened and closed, and TCP / IP port numbers 20 shall be used.
[0037]
In the following description, the process in which the TCP / IP or APDU command arrives at the IC card is a process of a network device such as a terminal device or a router, and the description thereof will be omitted.
[0038]
FIG. 6 shows the structure of an APDU command sent from the terminal device defined by ISO 7816-4 to the IC card 1.
[0039]
The CLA at the head of the APDU command is called a class byte and indicates how much the content of the command complies with ISO7816-4. For example, when CLA is “0x00”, the command and response coding method and structure conform to ISO 7816-4, and when “0x90”, the command and response structure conforms to ISO 7816-4. The coding of is dependent on the vendor implementation and is optional. When CLA is “0xD0”, it indicates that the coding method and structure of the command and response are arbitrary, and the communication procedure is distinguished by defining this as TCP / IP or the like.
[0040]
INS indicates the type of command, P1 and P2 indicate parameters given to the command, and Lc is the length of data.
[0041]
In addition to the format shown in FIG. 6, the APDU command can use a plurality of structures such as omitting Lc and below, adding a reply length from an IC card called Le after the data portion, and not attaching it. is there.
[0042]
The IC card 1 is supplied with power from the terminal device, activates the OS unit, and waits for reception of an APDU command.
[0043]
When selecting a credit process conforming to ISO7816-4, a selection command (SELECT FILE: “0xA4”) is specified in INS and an object to be selected is specified in P1 and P2 as shown in FIG. 7A. An APDU command in which “0x0400” indicating this, AID “0x01 02 03 04 05 01” in the data part, and the length of the data part, that is, the AID length “6 bytes” is stored in Lc.
[0044]
When the IC card 1 receives the APDU command shown in FIG. 7A, the determination means 10 refers to the CLA of the APDU command received from the terminal device, and since the CLA is “0x00”, the APDU command is ISO7816− 4 is determined to be compliant.
[0045]
Next, since the INS is a selection command, the selection unit 11 refers to the AID “0x01 02 03 04 05 01” stored in the data part by P1, P2, and Lc, and the credit processing is performed by the program storage part 5 To check if it exists.
[0046]
When the credit processing exists in the program storage unit 5, the selection unit 11 selects the credit processing and puts the selected mark.
[0047]
Next, the selection means 11 passes a command to the selected credit process and transfers control.
[0048]
The processing result of the credit processing (for example, a code indicating “selection OK”) is transmitted to the terminal device, and the process returns to the command reception waiting state.
[0049]
Next, when a payment command (for example, 0x90 01...) Is received in the selected credit processing, the determination unit 10 conforms to ISO 7816-4, not TCP / IP, because CLA is “0x90”. It is determined that it is a command.
[0050]
Since the INS is a payment command (“0x01”), the selection unit 11 passes the payment command to the selected credit processing without selecting an application, and transfers control.
[0051]
The credit process performs a payment process, for example, transmits a balance to the terminal device, and returns to the command reception state.
[0052]
When referring to the latest log in entry / exit management compliant with TCP / IP, a command (for example, “0x00”) that executes “0xD0” in CLA and application selection means 9 in INS shown in FIG. ), A protocol number (for example, “0x00 21” defined as an IP protocol) in P1 and P2, an IP datagram that is communication data in TCP / IP format in the data portion, and Lc in the data portion Issue an APDU command that stores the length, ie, the length of the IP datagram.
[0053]
Here, the IP datagram is composed of an IP header, a TCP header, and application data as shown in FIG. 8, and is a data format itself defined in TCP / IP.
[0054]
The TCP header and application data are collectively referred to as a TCP segment, but as shown in FIG. 9, the TCP segment port number is described in the TCP segment, so the port used by the latest log reference process The number “20” is stored.
[0055]
When the IC card 1 receives the APDU command shown in FIG. 7B, the determination means 10 refers to the CLA of the APDU command received from the terminal device, and since the CLA is “0xD0”, the APDU command is TCP / Judged to be IP compliant.
[0056]
Next, the selection unit 11 refers to the IP datagram stored in the data part by P1, P2, and Lc, and acquires the port number “20” from the TCP destination port number in the header of the TCP segment.
[0057]
The selection unit 11 refers to the correspondence table using the acquired port number “20”, acquires the application using the port number “20”, that is, the AID “0x01 02 03 04 05 02” of the entrance / exit management, It is confirmed whether or not entrance / exit management exists in the program storage unit 5.
[0058]
When entry / exit management exists in the program storage unit 5, the selection unit 11 selects entry / exit management and puts a mark on the selection.
[0059]
Next, the selection unit 11 passes the application data of the TCP segment to the selected entrance / exit management, and transfers control.
[0060]
The entrance / exit management transmits the latest log as a processing result to the terminal device in accordance with the latest log reference request, and returns to the command reception waiting state.
[0061]
In addition, the credit processing performed by the communication of ISO7816-4 has a function of inquiring the accumulated points from the Web screen, for example, using the TCP / IP port number “10”. Can do.
[0062]
In this case, similarly to the selection of the application for entering / leaving management, it is determined that the communication is based on TCP / IP by the CLA of the APDU command, the credit processing is selected by referring to the correspondence table by the port number “10”. It is possible to inquire about the accumulated points for credit processing.
[0063]
As described above, the present invention has been described in detail based on the embodiments. However, the IC card and the application program selection method in the IC card according to the present invention are not limited to the above-described embodiments. Naturally, various changes can be made without departing from the spirit of the invention.
[0064]
【The invention's effect】
As described above, according to the IC card and the application program selection method in the IC card according to the present invention, the communication procedure is determined and the correspondence table is referred to, so that the Internet standard protocol TCP / IP and the IC card It is possible to select both applications of the standard protocol ISO 7816-4.
[0065]
In addition, since a system using an IC card that can be loaded with an application that can be accessed using both TCP / IP and ISO7816 protocols can be provided, an IC card that can be used for various purposes can be provided.
[Brief description of the drawings]
FIG. 1 is a schematic structural diagram inside an IC card of the present invention.
FIG. 2 is an example of a configuration of a correspondence table according to the present invention.
FIG. 3 is an example of a different configuration of the correspondence table of the present invention.
FIG. 4 is a flowchart for selecting an application program in the IC card of the present invention.
FIG. 5 is an example in which two applications are stored in the correspondence table of the present invention.
FIG. 6 is an explanatory diagram showing a configuration of an APDU command in ISO 7816-4.
FIG. 7 is an example of an APDU command of the present invention.
FIG. 8 is an explanatory diagram showing a configuration of a TCP segment and an IP datagram transmitted on ISO7816.
FIG. 9 is an explanatory diagram showing a configuration of a TCP segment.
[Explanation of symbols]
1 IC card 2 I / O control unit 3 CPU
4 Storage means 5 Program storage section 6 Work memory 7 IC card reader / writer 8 Corresponding table 9 Application selection means 10 Determination means 11 Selection means

Claims (2)

端末装置とデータの受け渡しを行い、複数のアプリケーションプログラムの各々を内部に備えるCPUにおいて実行可能なICカードであって、
アプリケーションプログラムを実行する以前に、TCP IP プロトコルのポート番号とアプリケーションプログラムを関連付けて記憶する対応テーブルと、
前記端末装置から受信したコマンド中に含まれる通信手順判定情報に応じて、異なる選択経路を経て実行するアプリケーションプログラムを選択するアプリケーション選択手段と、
前記アプリケーション選択手段が、
前記端末装置から受信したAPDUコマンドの先頭のCLAにより通信手順を判定する判定手段と、
前記判定手段の判定結果に基づいて、前記対応テーブルを経由してアプリケーションプログラムを選択する、またはAPDUコマンドの先頭のCLAとINSとアプリケーションIDによりアプリケーションプログラムを選択する、のどちらかの手順においてアプリケーションプログラムを選択する選択手段と、を備え、
前記判定手段が、前記端末装置から受信したコマンドの中のAPDUコマンドの先頭のCLAにより、TCP/IPおよびISOのどちらの通信手順か判定し、
前記選択手段が、前記判定手段の判定結果がTCP/IPの場合、TCP/IPのデータの中からポート番号を取得し、前記ポート番号に基づいて前記対応テーブルに記憶している対応するアプリケーションプログラムを選択し、
前記判定手段の判定結果がISOの場合、APDUコマンドの先頭のCLAとINSとアプリケーションIDによりICカード内のアプリケーションプログラムを選択する、
ことを特徴とするICカード。
An IC card that exchanges data with a terminal device and that can be executed by a CPU provided with each of a plurality of application programs,
Before executing the application program, a correspondence table for storing the TCP / IP protocol port number and the application program in association with each other,
Application selection means for selecting an application program to be executed through different selection paths in accordance with communication procedure determination information included in the command received from the terminal device;
The application selection means is
A determination means for determining a communication procedure by CLA at the head of the APDU command received from the terminal device;
Application program in either procedure of selecting an application program via the correspondence table based on the determination result of the determination means, or selecting an application program by CLA, INS and application ID at the head of the APDU command And a selection means for selecting
The determination means determines the communication procedure of TCP / IP or ISO by the CLA at the head of the APDU command in the command received from the terminal device,
When the selection means obtains a port number from TCP / IP data when the determination result of the determination means is TCP / IP, the corresponding application program stored in the correspondence table based on the port number Select
When the determination result of the determination means is ISO, the application program in the IC card is selected by the CLA and INS at the head of the APDU command and the application ID.
IC card characterized by that.
端末装置とデータの受け渡しを行い、内部に備えるCPUにより複数のアプリケーションプログラムの各々を実行するICカードにおける実行するアプリケーションプログラムの選択方法であって、
アプリケーションプログラムを実行する以前に、
端末装置から受信したコマンド中に含まれる通信手順判定情報に応じて、異なる選択経路を経て実行するアプリケーションプログラムを選択する段階と、
アプリケーションを選択する際に、端末装置がICカードに対して発行するコマンドの中のAPDUコマンドの先頭のCLAに対して、TCP/IPおよびISOのどちらの通信手順か記述する段階と、
端末装置から受信した前記コマンドの中のAPDUコマンドの先頭のCLAにより、通信手順がTCP/IPおよびISOのどちらであるか判定する段階と、
前記判定結果がTCP/IPの場合、TCP/IPのデータの中からポート番号を取得し、前記ポート番号に基づいて TCP IP プロトコルのポート番号とアプリケーションプログラムを関連付けて記憶する対応テーブルに記憶している対応するアプリケーションプログラムを選択する段階と、
前記判定手段の判定結果がISOの場合、APDUコマンドの先頭のCLAとINSとアプリケーションIDによりICカード内のアプリケーションプログラムを選択する段階と、
を設けたことを特徴とするICカードにおけるアプリケーションプログラム選択方法。
A method of selecting an application program to be executed in an IC card that exchanges data with a terminal device and executes each of a plurality of application programs by an internal CPU,
Before running the application program
Selecting an application program to be executed through different selection paths according to communication procedure determination information included in the command received from the terminal device;
A step of describing either TCP / IP or ISO communication procedure for the CLA at the head of the APDU command in the command issued to the IC card by the terminal device when selecting an application;
Determining whether the communication procedure is TCP / IP or ISO based on CLA at the head of the APDU command in the command received from the terminal device;
When the determination result is TCP / IP, a port number is acquired from the TCP / IP data and stored in a correspondence table that stores the port number of the TCP / IP protocol in association with the application program based on the port number. Selecting the corresponding application program that is running ,
If the determination result of the determination means is ISO, selecting an application program in the IC card by the first CLA and INS of the APDU command and the application ID;
An application program selection method in an IC card, characterized in that
JP2002314683A 2002-10-29 2002-10-29 IC card and application program selection method in IC card Expired - Fee Related JP4184751B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002314683A JP4184751B2 (en) 2002-10-29 2002-10-29 IC card and application program selection method in IC card

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002314683A JP4184751B2 (en) 2002-10-29 2002-10-29 IC card and application program selection method in IC card

Publications (2)

Publication Number Publication Date
JP2004151864A JP2004151864A (en) 2004-05-27
JP4184751B2 true JP4184751B2 (en) 2008-11-19

Family

ID=32458930

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002314683A Expired - Fee Related JP4184751B2 (en) 2002-10-29 2002-10-29 IC card and application program selection method in IC card

Country Status (1)

Country Link
JP (1) JP4184751B2 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100773741B1 (en) 2006-05-18 2007-11-09 삼성전자주식회사 Integrated circuit having a plurality of interfaces and integrated circuit card having the same
JP4834748B2 (en) 2009-03-10 2011-12-14 株式会社東芝 Information storage medium, medium authentication device, medium authentication system, and IC card
JP2011118837A (en) 2009-12-07 2011-06-16 Sony Corp Information processing device, information processing method and program
US9575777B2 (en) * 2011-03-08 2017-02-21 Sony Corporation Information processing device for performing contactless communication with an external device using multiple communication standards
JP5943036B2 (en) * 2014-06-04 2016-06-29 ソニー株式会社 Information processing apparatus, information processing method, and program
JP7234567B2 (en) * 2018-10-22 2023-03-08 大日本印刷株式会社 Electronic information storage medium, processing method in electronic information storage medium, and program

Also Published As

Publication number Publication date
JP2004151864A (en) 2004-05-27

Similar Documents

Publication Publication Date Title
CN101027929B (en) System and method for communication with universal integrated circuit cards in mobile devices using internet protocols
US9843889B2 (en) Method and system for managing multiple applications in near field communication
TW567700B (en) Method of registration a user on a directory server of an internet type network and/or of localization of a user on this network, and chip card for using such method
JP3834239B2 (en) How to load software components into a smart card, especially a format called &#34;applet&#34;
FI109756B (en) A method of utilizing local resources in a communication system, a communication system and wireless communication
US8676260B2 (en) Method of managing information by a large capacity UICC
KR100791946B1 (en) Safe terminal provided with a smart card reader designed to communicate with a server via an internet-type network
KR101340982B1 (en) Me network parameters configuration by uicc
EP3133852A1 (en) Nfc device with multiple secure elements
US7483690B2 (en) Communication terminal having a function to inhibit connection to a particular site and program thereof
Rees et al. Webcard: a Java Card web server
KR100971896B1 (en) Communication terminal, user data transferring system and user data transferring method
KR101577714B1 (en) Automatic configuration for a terminal
JP5447522B2 (en) Communication between client and server in mobile radio communication device
JP4184751B2 (en) IC card and application program selection method in IC card
JP4139674B2 (en) IC card and command processing method in IC card
JP4950282B2 (en) Data transmission between server and communication object
JPWO2004080009A1 (en) Cooperation information management system and message transfer control system
US20100250838A1 (en) Portable data carrier comprising a web server
KR100848402B1 (en) Card Terminals with Function of Wire VoIP Gateway
US8549161B2 (en) Data communication method and data carrier therefor
TWI298851B (en)
KR20050074857A (en) System and method for loading data(or application) for smart card
KR101401846B1 (en) Gateway loaded with hsdpa device driver based on linux and its operating method
KR100928848B1 (en) How to Provide Host Applications for Smart Card Terminals

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20051019

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20071030

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20071120

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080118

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080212

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080414

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080529

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080625

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

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

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

Free format text: PAYMENT UNTIL: 20110912

Year of fee payment: 3

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

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20120912

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20120912

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20130912

Year of fee payment: 5

LAPS Cancellation because of no payment of annual fees