JP2008016050A - Ic card - Google Patents

Ic card Download PDF

Info

Publication number
JP2008016050A
JP2008016050A JP2007219026A JP2007219026A JP2008016050A JP 2008016050 A JP2008016050 A JP 2008016050A JP 2007219026 A JP2007219026 A JP 2007219026A JP 2007219026 A JP2007219026 A JP 2007219026A JP 2008016050 A JP2008016050 A JP 2008016050A
Authority
JP
Japan
Prior art keywords
capacity
file
address
card
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2007219026A
Other languages
Japanese (ja)
Inventor
Kazuyoshi Irisawa
和義 入澤
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 JP2007219026A priority Critical patent/JP2008016050A/en
Publication of JP2008016050A publication Critical patent/JP2008016050A/en
Pending legal-status Critical Current

Links

Images

Landscapes

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

Abstract

<P>PROBLEM TO BE SOLVED: To provide an IC card reducing or increasing capacity of a file while maintaining security. <P>SOLUTION: The IC card having a memory storing one or more files has a capacity changing means for reducing or increasing the capacity of the file selected by specific capacity specified from the outside. The file has a free space storage part which stores its own free space, the capacity changing means has a master file change restriction means for changing the content of the free space storage part of a master file containing files based on the specific capacity and not permitting reduction of the capacity of the selected file by the capacity changing means when a value obtained by subtracting the specific capacity from the capacity of the selected file becomes less than the total capacity of the size of the files contained in the selected file when the capacity changing means reduces the capacity of the file. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、外部からの命令により、メモリに格納されているファイルの容量を縮小又は変更することが可能なICカードに関するものである。   The present invention relates to an IC card capable of reducing or changing the capacity of a file stored in a memory by an external command.

図11は、従来の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に記録すべき本来のデータを格納するメモリである。   FIG. 11 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.

図12は、図11に示すEEPROM15内のファイル構成を示す図である。本実施形態では、3種類のファイルが階層構造を構成している。3種類のファイルとは、MF(Master File)、DF(Dedicated File)及びEF(Elementary File)のことである。MFは、データメモリ全体のファイルである。MFは、各アプリケーション(サービス)に共通したデータを格納するためのファイルであり、例えば、ICカード10の所有者の氏名、住所、電話番号などの情報が記録される。DFは、専用ファイルであり、アプリケーションごとにDFの設定がなされている。EFは、基礎ファイルであり、CPUがICカードを管理・制御する際に解釈実行するデータを格納するIEFと、アプリケーションで使用するデータを格納するWEFの2種類がある。   FIG. 12 is a diagram showing a file structure in the EEPROM 15 shown in FIG. In the present embodiment, three types of files form a hierarchical structure. The three types of files are MF (Master File), DF (Dedicated File), and 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 for storing data to be interpreted and executed when the CPU manages and controls the IC card, and WEF for storing data used in the application.

MF、DF及びEFは、図12(A)に示す階層構造を構成する。MFは、階層構造の根幹であり、その配下にDF又はEFを配置する。図12(A)の例では、MFはDF1及びWEF1をその配下に配置しており、DF1、WEF1の親ファイルとなっている。DFは、MFを親ファイルとしてその配下に位置することができると同時に、自己の配下に他のDF又はEFを配置し、それらの親ファイルとなることも可能なファイルである。これに対しEFは、他のファイルの親ファイルとなることができないファイルである。   The MF, DF, and EF form a hierarchical structure shown in FIG. The MF is the root of the hierarchical structure, and the DF or EF is placed under the MF. In the example of FIG. 12A, the MF arranges DF1 and WEF1 under its control, and is a parent file of DF1 and WEF1. DF is a file in which MF can be positioned as a parent file, and at the same time, other DFs or EFs can be placed under the MF and become their parent file. On the other hand, EF is a file that cannot be a parent file of another file.

図13は、EEPROM15におけるファイル格納イメージの一例を示す図である。図13では、左上より右下へ向けてメモリの絶対アドレスが増大している。また、横幅は32ビットに相当している。なお、本明細書では、絶対アドレスが大なる方を上位アドレスと呼ぶこととする。図13に示す例では、ファイルのディレクトリは全て32ビットから構成され、上位アドレスから各ディレクトリ間に空き領域が存在しないように、順に配置されている。一方、ファイルのデータ格納エリアは、下位アドレスから、これも各エリア間に空き容量の生じないように、順に配置されている。   FIG. 13 is a diagram showing an example of a file storage image in the EEPROM 15. In FIG. 13, the absolute address of the memory increases from the upper left to the lower right. Further, the horizontal width corresponds to 32 bits. In the present specification, the one having a larger absolute address is called an upper address. In the example shown in FIG. 13, the file directories are all composed of 32 bits, and are arranged in order so that there is no empty area between the directories from the higher address. On the other hand, the file data storage areas are arranged in order from the lower address so that there is no free space between the areas.

図示の状態では、ディレクトリは32バイトおきに規則的に配置されている。したがって、ディレクトリ又はディレクトリの内容を検索するときは、32バイトおきのアドレスを検索すれば足り、演算処理能力が比較的低いCPUを用いても迅速にディレクトリの検索を行うことが可能となっている。また、1つのWEFのデータ格納エリアは、必ず連続した1つのメモリ領域にまとめて格納されており、例えば図14に示すWEF1のデータ格納エリアのように、2つの領域に分散して格納されていない。これは、EEPROM15の限られたメモリ資源を最大限有効に利用するための処置である。つまり、図14に示すように、一つのデータ格納エリアを複数の領域に分散して格納した場合には、それら分散した各領域のアドレス情報を管理するファイル・アロケーション・テーブル等が必要となり、余分にメモリを消費することとなる。これに対し、図13の例では、ディレクトリにおいて、一つのデータ格納エリアについてのアドレス情報のみを管理すればよく、メモリの消費量が最小限に抑制される。   In the state shown in the figure, the directories are regularly arranged every 32 bytes. Therefore, when searching for a directory or the contents of a directory, it is sufficient to search for an address every 32 bytes, and it is possible to quickly search a directory even with a CPU having a relatively low processing capacity. . One WEF data storage area is always stored together in one continuous memory area. For example, the WEF1 data storage area shown in FIG. 14 is distributed and stored in two areas. Absent. This is a procedure for maximally effectively using the limited memory resources of the EEPROM 15. That is, as shown in FIG. 14, when one data storage area is distributed and stored in a plurality of areas, a file allocation table or the like for managing address information of each of the distributed areas is required. Memory is consumed. On the other hand, in the example of FIG. 13, only the address information for one data storage area needs to be managed in the directory, and the amount of memory consumption is minimized.

上記各種のファイルは、ICカードの発行時に、ICカード発行者により、所定の階層構造を構成するように格納される。つまり、各種のDFやEFは、カード発行時にICカードに既に格納されており、ICカード所有者は、既に格納された各種ファイルの中から必要とするものを選択して利用する。
また、特許文献1は、データを記憶するメモリを有効に利用できるICカードを開示している。
特開平6−131517号公報
The various files are stored by the IC card issuer so as to form a predetermined hierarchical structure when the IC card is issued. That is, various DFs and EFs are already stored in the IC card when the card is issued, and the IC card owner selects and uses necessary ones from the various stored files.
Patent Document 1 discloses an IC card that can effectively use a memory for storing data.
JP-A-6-131517

しかし、前述した従来のICカードでは、ICカード所有者と無関係に、ICカード発行者が各種のファイルを格納する。しかも、ICカードの価値を高めるために、ICカード発行者は、異なるアプリケーション等に対応した数多くのファイルを格納し、ICカードを多目的に利用可能とすることを希望する場合がある。ところが、ICカード所有者は、それぞれにライフスタイル等が異なるため、必ずしも提供されている全てのアプリケーションを利用するとは限らない。このために、所有者によっては、格納されているファイルのうち一部のものは頻繁に使用するが、他のファイルは全く使用しないことがある。このような場合には、頻繁に使用されるファイルでは容量が不足する一方で、使用されないファイルではメモリが利用されず無駄となるという問題があった。   However, in the conventional IC card described above, the IC card issuer stores various files regardless of the IC card owner. Moreover, in order to increase the value of the IC card, the IC card issuer may wish to store a large number of files corresponding to different applications and make the IC card usable for multiple purposes. However, the IC card owners do not always use all the provided applications because their lifestyles are different. For this reason, some owners frequently use some of the stored files, but not others at all. In such a case, there is a problem that a file that is frequently used is insufficient in capacity, but a memory that is not used is not used and is wasted.

上記の問題に対し、各ファイルを一度消去し、それぞれのファイルを適切な大きさに直して、再度格納することで解決を図ることも考えられる。しかし、この場合には、各ファイルに記録されている情報をICカードの外部へ読み出し、再度格納することとなるので、ICカードの特徴の一つであるセキュリティーを担保することができないという問題があった。   The above problem can be solved by deleting each file once, restoring each file to an appropriate size, and storing it again. However, in this case, the information recorded in each file is read out of the IC card and stored again, so that security that is one of the characteristics of the IC card cannot be secured. there were.

そこで、本発明の課題は、セキュリティーを維持しつつ、ファイルの容量を縮小または拡大することが可能なICカードを提供することである。   SUMMARY OF THE INVENTION An object of the present invention is to provide an IC card that can reduce or expand the file capacity while maintaining security.

前記課題を解決するために、請求項1に係る発明は、1又は2以上のファイルを格納可能なメモリを有するICカードにおいて、外部からの命令により、外部から指定された指定容量だけ選択されているファイルの容量を縮小又は拡大する容量変更手段を有し、前記ファイルは、自己の空き容量を記憶する空き容量記憶部を有し、前記容量変更手段は、前記ファイルを配下に有する親ファイルの前記空き容量記憶部の内容を、前記指定容量に基づいて変更し、前記容量変更手段が前記ファイルの容量を縮小する場合に、前記選択されているファイルの容量から、前記指定容量を減算した値が、前記選択されているファイルが配下に有するファイルのサイズの総容量より小となる場合に、前記容量変更手段が前記選択されているファイルの容量を縮小することを許可しない親ファイル変更制限手段を有することを特徴とするICカードである。
請求項2の発明は、請求項1に記載のICカードにおいて、前記ファイルが有するデータ領域を移動する移動手段を有し、前記ファイルのディレクトリ領域は、前記メモリの一方の端部から未使用な領域が存在しないように順に格納され、前記ファイルのデータ領域は、前記メモリの他方の端部から未使用な領域が存在しないように順に格納されており、前記容量変更手段は、前記選択されているファイルがデータ領域を有するファイルである場合は、前記データ領域を前記指定容量だけ縮小又は拡大し、前記移動手段は、前記容量変更手段により縮小されたデータ領域より前記メモリの一方の端部側に他の前記データ領域が存在する場合は、前記メモリの他方の端部側へ前記指定容量だけ前記他のデータ領域を移動させる、又は、前記容量変更手段により拡大されるべきデータ領域より前記メモリの一方の端部側に他の前記データ領域が存在する場合は、前記メモリの一方の端部側へ、前記指定容量だけ前記他のデータ領域を移動させることを特徴とするICカードである。
In order to solve the above-mentioned problem, the invention according to claim 1 is the IC card having a memory capable of storing one or more files, and the specified capacity specified from the outside is selected by an external command. Capacity changing means for reducing or expanding the capacity of the file, the file has a free capacity storage unit for storing its own free capacity, and the capacity changing means is a parent file having the file under it. A value obtained by subtracting the designated capacity from the capacity of the selected file when the content of the free capacity storage unit is changed based on the designated capacity and the capacity changing unit reduces the capacity of the file. but if the selected file is smaller than the total volume of the size of the file that Yusuke under the size of the file that the capacity changing means is the selected An IC card and having a parent file changes limiting means does not allow to reduce.
According to a second aspect of the present invention, in the IC card according to the first aspect of the present invention, the IC card includes a moving unit that moves a data area of the file, and the directory area of the file is unused from one end of the memory. The file data area is stored in order so that there is no unused area from the other end of the memory, and the capacity changing means is selected. If the file is a file having a data area, the data area is reduced or enlarged by the specified capacity, and the moving means is on one end side of the memory from the data area reduced by the capacity changing means. The other data area is moved to the other end side of the memory by the specified capacity, or the capacity When the other data area exists on one end side of the memory from the data area to be expanded by the further means, the other data area is transferred to the one end side of the memory by the specified capacity. The IC card is characterized by being moved.

発明によれば、以下のような効果がある。
(1)セキュリティーを維持しつつ、選択されたファイルの容量を変更することが可能である。
(2)ファイルの有する有効な情報の容量を誤認し、その容量以下にファイルの容量を縮小することにより、ファイル内の情報が失われることが防止される。
The present invention has the following effects.
(1) It is possible to change the capacity of the selected file while maintaining security.
(2) It is possible to prevent the information in the file from being lost by misidentifying the capacity of valid information included in the file and reducing the capacity of the file below the capacity.

(3)親ファイルが管理する領域を越えてファイルの容量を拡大し、その結果、他のファイルの有する情報が失われるという事態が防止される。
(4)ファイルの容量を縮小又は拡大しても、親ファイルの空き容量が正確に管理される。
(3) The file capacity is expanded beyond the area managed by the parent file, and as a result, a situation in which information held by another file is lost is prevented.
(4) Even if the file capacity is reduced or expanded, the free capacity of the parent file is accurately managed.

(5)ファイルの容量を縮小した結果、その配下にあるファイルの有する情報が失われるという事態が防止される。
(6)ファイルのデータ領域を縮小しても、データ領域の間で空き領域が生じることはない。また、データ領域を拡大しても、他のデータ領域の有する情報が失われることはなく、かつ、データ領域の間で空き領域が生じることもない。つまり、メモリを最大限有効に利用し、かつ、情報を消失することなく、データ領域を縮小又は拡大することが可能である。
(5) As a result of reducing the capacity of the file, it is possible to prevent a situation in which information held by the file under the file is lost.
(6) Even if the data area of the file is reduced, a free area does not occur between the data areas. Further, even if the data area is enlarged, information held in other data areas is not lost, and a free area does not occur between the data areas. That is, it is possible to reduce or expand the data area while using the memory to the maximum extent and without losing information.

(7)移動手段は、最終データ位置記憶手段の記憶する情報に基づいて特定される位置までに存在するデータ領域を移動するので、ファイルのデータ部が格納されていない領域のデータを移動する不都合が回避される。
(8)容量変更手段は、位置情報記憶部の内容を指定容量に基づいて変更するので、データ領域が縮小又は拡大された後にも、前記位置記憶部の内容は適切なものに維持される。
(9)移動手段は、位置情報記憶部の内容を指定容量に基づいて変更するので、データ領域が移動された後にも、前記位置情報記憶部の内容は適切なものに維持される。
(7) Since the moving means moves the data area existing up to the position specified based on the information stored in the final data position storage means, the inconvenience of moving the data in the area where the data portion of the file is not stored. Is avoided.
(8) Since the capacity changing unit changes the contents of the position information storage unit based on the specified capacity, the contents of the position storage unit are maintained appropriately even after the data area is reduced or enlarged.
(9) Since the moving means changes the contents of the position information storage unit based on the designated capacity, the contents of the position information storage unit are maintained appropriately even after the data area is moved.

(10)可変長レコード構造のファイルにおいて、データ領域に格納されている各レコードのアドレス情報は、指定容量に基づいて変更されるので、上記アドレス情報は、データ領域が縮小若しくは拡大又は移動された後も適正な値を有する。 (10) In a variable-length record structure file, the address information of each record stored in the data area is changed based on the specified capacity, so that the data area is reduced, enlarged, or moved. It has a proper value afterwards.

(11)可変長レコード構造のファイルにおいて、そのアドレス情報が変更された場合は、変更後のアドレス情報に基づいてデータ領域に格納されている誤り検出符号も変更されるので、データ領域が縮小若しくは拡大又は移動された後も誤り検出符号が適正な値を有する。 (11) In a variable-length record structure file, when the address information is changed, the error detection code stored in the data area is also changed based on the changed address information. Even after being expanded or moved, the error detection code has a proper value.

以下、図面等を参照して、本発明に係る一実施形態について、さらに詳しく説明する。本実施形態は、ハードウェア構成において従来のICカードと同一であるが、カレントファイルのファイルサイズを変更するCHANGE−SIZEコマンドを処理する機能を備える点において従来のICカードと異なっている。   Hereinafter, an embodiment according to the present invention will be described in more detail with reference to the drawings. This embodiment is the same as the conventional IC card in hardware configuration, but differs from the conventional IC card in that it has a function of processing a CHANGE-SIZE command for changing the file size of the current file.

図1は、CHANGE−SIZEのコマンドAPDUを示す図である。CHANGE−SIZEコマンドでは、パラメータP1において、サイズ(容量)を変更すべきファイルが現在選択されているDF(以下「カレントDF」という)あるいはEF(以下「カレントEF」という)のいずれであるかを指定する。また、データフィールド(DATA)において、変更すべきサイズを指定する。   FIG. 1 is a diagram showing a CHANGE-SIZE command APDU. In the CHANGE-SIZE command, in the parameter P1, whether the file whose size (capacity) is to be changed is the currently selected DF (hereinafter referred to as “current DF”) or EF (hereinafter referred to as “current EF”). specify. Further, the size to be changed is designated in the data field (DATA).

図2は、CHANGE−SIZEコマンドを処理するICカード10の動作を示す流れ図である。リーダライタ装置20から「CHANGE−SIZE」コマンドがあった場合には、CPU12は、実行前チェックを行い(S701)、エラーがあったときには、その旨のメッセージ(S703)を送信する。ファイルサイズの変更を行い(S704)、コマンドが正常に終了した場合には(S705)、その旨のメッセージを送信して(S708)、コマンドを終了する。   FIG. 2 is a flowchart showing the operation of the IC card 10 that processes the CHANGE-SIZE command. If there is a “CHANGE-SIZE” command from the reader / writer device 20, the CPU 12 performs a pre-execution check (S701), and if there is an error, sends a message to that effect (S703). The file size is changed (S704), and when the command ends normally (S705), a message to that effect is transmitted (S708), and the command is ended.

次に、S704のファイルサイズの変更について、さらに詳しく説明する。本実施形態において、ファイルサイズを変更できるファイルの種別は、DF/WEFの2種類である。サイズの変更は、増減両方をサポートしている。また、容量指定なし(管理ぺージ数FFh)のDFのサイズ変更はできない。容量指定なしのDFとは、自己が管理する領域の容量が定められておらず、親ファイルの空き容量の範囲内でファイルの容量を拡大し得るDFをいう。言い換えると、容量指定なしのDFとは、その空き容量が常に親ファイルの空き容量に一致する容量親依存のファイルである。容量指定なしのDFでは、管理ページ数が「FFh」に設定される。管理ページ数とは、ファイルのディレクトリに格納されている変数であり、ファイルの管理する容量を示すものである。   Next, the change of the file size in S704 will be described in more detail. In this embodiment, there are two types of files whose file size can be changed: DF / WEF. The size change supports both increase and decrease. Also, the DF size cannot be changed without specifying the capacity (the number of management pages FFh). The DF without capacity designation refers to a DF in which the capacity of the area managed by the DF is not defined and the file capacity can be expanded within the range of the free capacity of the parent file. In other words, a DF without capacity specification is a capacity parent-dependent file whose free capacity always matches the free capacity of the parent file. In a DF without capacity specification, the number of management pages is set to “FFh”. The management page number is a variable stored in the directory of the file, and indicates the capacity managed by the file.

エラーチェックは、以下の項目について行う。
1)サイズ変更対象ファイルがMF/IEFでないこと。これは、カレントEF又はカレントDFのアドレスによって指定されるファイルのディレクトリを参照することにより判断される。
2)CRT−APとCRT−DPとMFディレクトリの空き容量の整合性があっていること。これは、MFのディレクトリに記録されているEEPROM15の空き容量と、CRT−APとCRT−DPの差を比較することにより判断される。なお、CRT−APは、新しいデータ格納エリアを格納することが可能な領域の先頭アドレスを指し示すポインタであり、CRT−DPは、新しいディレクトリを格納することが可能な領域の先頭アドレスを指し示すポインタである。
The error check is performed for the following items.
1) The file to be resized is not MF / IEF. This is determined by referring to the directory of the file specified by the address of the current EF or current DF.
2) The free space of CRT-AP, CRT-DP, and MF directory must be consistent. This is determined by comparing the free space of the EEPROM 15 recorded in the MF directory with the difference between CRT-AP and CRT-DP. CRT-AP is a pointer that points to the start address of an area that can store a new data storage area, and CRT-DP is a pointer that points to the start address of an area where a new directory can be stored. is there.

3)ディレクトリテーブルの全エントリのCRCがあっていること。これは、各ファイルディレクトリが有するCRCコードを用いて行われる。
4)全レコード形式WEFの全レコードのCRCがあっていること。CHANGE−SIZEコマンドは、ファイルサイズを縮小させる場合もある。この場合に、既に格納されている情報を誤って消去する事態を防ぐために、予め既に情報が格納されているレコードを確認する必要がある。しかし、レコードが何らかの事情により破壊されている場合には、上記確認を的確に行うことができなくなるため、予め、レコードが適正な状態に維持されているか否かを確認するものである。
3) There is a CRC for all entries in the directory table. This is performed using a CRC code included in each file directory.
4) All record format WEF CRCs are present. The CHANGE-SIZE command may reduce the file size. In this case, in order to prevent a situation where information already stored is deleted by mistake, it is necessary to confirm a record in which information is already stored in advance. However, if the record is destroyed for some reason, the above confirmation cannot be performed accurately. Therefore, it is confirmed in advance whether the record is maintained in an appropriate state.

5)トランスペアレントWEFのファイル全体のCRCがあっていること。このチェックを行う理由は、上記4)と同じである。なお、トランスペアレントファイルにCRCチェックコードを備えない場合には、このチェック項目は省略される。
6)ファイルサイズ増加の場合に、領域管理DFの空きぺージ数以内にサイズ増加分が納まること。なお、本実施形態において、1ページは32バイトとなっている。
7)DFのサイズ縮小の場合に、そのDF下のすべてのファイルのサイズを加算したページ数以下にならないこと。DFは、その配下に1又は2以上の他のファイルを配置することが可能である。この場合に、配下のファイルの総容量以下に当該DFが縮小されたのでは、記憶されている情報を消去するおそれがあるからである。
5) There must be a CRC for the entire transparent WEF file. The reason for this check is the same as in 4) above. If the transparent file does not have a CRC check code, this check item is omitted.
6) When the file size increases, the size increase must be within the number of free pages in the area management DF. In this embodiment, one page is 32 bytes.
7) When the size of a DF is reduced, the size of all files under the DF must not be less than the total number of pages. DF can place one or more other files under it. In this case, if the DF is reduced below the total capacity of the subordinate files, the stored information may be erased.

8)WEF(循環順編成以外)のサイズ縮小の場合に、ライトアペンドポインタよりファイルサイズが小さくならないこと。
9)WEF(循環順編成ファイル)のサイズ縮小の場合、ローテーション済みのファイルでないこと。上記8)、9)は、既に格納されている情報を誤って失う事態を防止するための措置である。なお、上記エラーチェックは、EEPROM15の更新前に行われる。
8) The file size should not be smaller than the write append pointer when reducing the size of WEF (other than circular sequential organization).
9) In the case of size reduction of WEF (circular sequential file), it must not be a rotated file. The above 8) and 9) are measures for preventing a situation where information already stored is lost by mistake. The error check is performed before the EEPROM 15 is updated.

次に、領域管理DFを特定し、ファイルのサイズ変更後に、その管理領域DFの空き容量を変更する。領域管理DFの特定方法は、以下の通りである。サイズ変更するファイルの親DFの管理ページ数をチェックする。親DFの管理ページ数がFFhならば、1レベル上のDFをチェックする。サイズ変更するファイルのすべての親DFの管理ぺージ数がFFhならば、MFを領域管理DFとする。   Next, the area management DF is specified, and after the file size is changed, the free capacity of the management area DF is changed. The method for specifying the area management DF is as follows. Check the number of management pages of the parent DF of the file to be resized. If the number of management pages of the parent DF is FFh, the DF up one level is checked. If the number of management pages of all the parent DFs of the file to be resized is FFh, the MF is set as the area management DF.

図3は、DFのサイズ変更を説明する図である。DFは、データ格納エリアを持たないために、ディレクトリのみの書き換えとなる。なお、容量指定なし(管理ぺージ数FFh)のDFのサイズ変更はできない。図3(A)は、サイズ縮小の場合を示している。
#1:まず、DFの縮小ぺージ数が、DFの空きぺージ数以下であることを確認する。
#2:DFの管理ぺージ数及び空きぺージ数を縮小分減算する。
#3:領域管理DFの空きぺージ数を#1:で減算した分だけ加算する。
FIG. 3 is a diagram for explaining the DF size change. Since the DF has no data storage area, only the directory is rewritten. Note that the DF size cannot be changed without specifying the capacity (the number of management pages FFh). FIG. 3A shows the case of size reduction.
# 1: First, it is confirmed that the number of DF reduction pages is equal to or less than the number of DF empty pages.
# 2: Decrease the number of management pages and the number of empty pages of DF.
# 3: The number of empty pages of the area management DF is added by the amount subtracted at # 1 :.

図3(B)は、サイズ増加の場合を示している。
#1:まず、領域管理DFの空きぺージ数をサイズ変更DFの増加分だけ減算する。
#2:サイズ変更DFの管理ぺージ数及び空きぺージ数をサイズ変更DFの増加分だけ加算する。
FIG. 3B shows the case of size increase.
# 1: First, the number of empty pages in the area management DF is subtracted by the increment of the size change DF.
# 2: The number of management pages and the number of empty pages of the size change DF are added by the increment of the size change DF.

次に、WEFのサイズ変更について説明する。WEFは、データ格納エリアを持つために、ディレクトリのデータ書き換え及びデータ格納領域のデータ移動を行う。また、データ領域の移動を行うために、移動したファイルのディレクトリの内容を書き換える。   Next, WEF size change will be described. Since the WEF has a data storage area, it rewrites data in the directory and moves data in the data storage area. In addition, in order to move the data area, the contents of the directory of the moved file are rewritten.

[サイズ縮小の場合]まず、サイズ変更ファイルの変更を行なう。
#1:縮小を行うWEFが可変長のときには、後述する<アドレステーブルポインタ移動処理>を実行する。
#2:縮小を行うWEF−DIRの管理領域内バイト数、書込み可能最終アドレス、アドレステーブルポインタを縮小した分だけ減算した値に書き換える。
[For size reduction] First, the size-change file is changed.
# 1: When the WEF to be reduced has a variable length, <address table pointer movement processing> described later is executed.
# 2: The number of bytes in the management area of the WEF-DIR to be reduced, the writable last address, and the address table pointer are rewritten to values obtained by subtracting the reduced amount.

図4は、ファイルのデータ部分書き換え(縮小バイト分詰める)を説明する図である。
#1:縮小対象ファイルのDIRアドレスをターゲットとしてセットする。
#2:ターゲットアドレスより32を減算する。
#3:ターゲットアドレスがCRT−DPと同じときに終了する。
#4:ターゲットとなったDIRがWEF以外のとき‘#2:’へ戻る。
#5:ターゲットとなったDIRのデータ部分を縮小バイト分移動する。
#6:‘#2:’ヘ戻る。
FIG. 4 is a diagram for explaining rewriting of data in a file (packing reduced bytes).
# 1: The DIR address of the file to be reduced is set as a target.
# 2: 32 is subtracted from the target address.
# 3: End when the target address is the same as the CRT-DP.
# 4: When the target DIR is other than WEF, return to '# 2:'.
# 5: The data portion of the target DIR is moved by the reduced byte.
# 6: Return to '# 2:'.

次に、移動済WEF−DIRの内容修正処理について説明する。
#1:縮小対象ファイルのDIRアドレスをターゲットとしてセットする。
#2:ターゲットアドレスより32減算する。
#3:ターゲットアドレスがCRT−DPと同じときに終了する。
#4:ターゲットとなったDIRがWEF以外のときに‘#2:’へ戻る。
#5:DIRの管理領域内バイト数、書込み可能最終アドレス、アドレステーブルポインタ、WEFエリア開始アドレスを縮小した分だけ減算した値に書き換える。
#6:‘#2:’ヘ戻る。
Next, the content correction process of the moved WEF-DIR will be described.
# 1: The DIR address of the file to be reduced is set as a target.
# 2: Subtract 32 from the target address.
# 3: End when the target address is the same as the CRT-DP.
# 4: Return to '# 2:' when the target DIR is other than WEF.
# 5: Rewrite the number of bytes in the DIR management area, the writable final address, the address table pointer, and the WEF area start address by subtracting the reduced amount.
# 6: Return to '# 2:'.

図5は、データ部分を移動した結果生じた不要部分のFFhクリアを説明する図である。
#1:CRT−APより縮小した分だけ減算したアドレスを求める。
#2:このアドレスを先頭に削除データ(ファイルを縮小した容量)分FFhクリアする。
FIG. 5 is a diagram for explaining the FFh clear of the unnecessary portion that has occurred as a result of moving the data portion.
# 1: An address obtained by subtracting the reduced amount from the CRT-AP is obtained.
# 2: FFh is cleared by the deleted data (capacity obtained by reducing the file) starting from this address.

図6は、CRT−APの変更を説明する図である。
#1:CRT−APを、もとの値より削除(ファイルを縮小した容量)分だけ減算した値に書き換える。
FIG. 6 is a diagram for explaining the change of the CRT-AP.
# 1: Rewrite CRT-AP to a value obtained by subtracting the original value from the deleted value (capacity obtained by reducing the file size).

WEFリニア可変長「アドレステーブルポインタ」とCRCの書き換えについて説明する。
#1:縮小を行うWEF−DIRをチェック用DIRとしてセットする。
#2:チェック用DIRより32減算する。
#3:チェック用DIRがCRT−DPと同じときに終了する。
#4:チェック用DIRが「WEFリニア可変長」以外のときに‘#2:’ヘ戻る。
#5:「移動後差分アドレス」として縮小バイトをセットして、後述する<アドレステーブルポインタ修正処理>の#3:以降を実行する。
#6:後述する<アドレステーブルポインタCRC修正処理>を実行する。
#7:‘#2:’へ戻る。
The rewriting of the WEF linear variable length “address table pointer” and CRC will be described.
# 1: The WEF-DIR to be reduced is set as a check DIR.
# 2: Subtract 32 from the check DIR.
# 3: End when the check DIR is the same as the CRT-DP.
# 4: When the check DIR is other than “WEF linear variable length”, return to “# 2:”.
# 5: The reduced byte is set as the “post-movement differential address”, and # 3 and subsequent steps of <address table pointer correction processing> to be described later are executed.
# 6: <Address table pointer CRC correction processing> described later is executed.
# 7: Return to '# 2:'.

ここで、WEFリニア可変長「アドレステーブルポインタ」とCRCの書き換え動作について説明する。
#1:7F80hをチェック用DIRとしてセットする。7F80hは、図13に示す例では、トランスポートIEFディレクトリのアドレスであり、このアドレスより下位のアドレスにMF配下のDF、EFのディレクトリが格納されている。
#2:チェック用DIRより32減算する。
#3:チェック用DIRがCRT−DPと同じときに終了する。
#4:チェック用DIRが「WEFリニア可変長」以外のときに、‘#2:’へ戻る。
#5:<アドレステーブルポインタ修正処理>を実行する。
#6:<アドレステーブルポインタCRC修正処理>を実行する。
#7:‘#2:’へ戻る。
Here, the rewriting operation of the WEF linear variable length “address table pointer” and CRC will be described.
# 1: 7F80h is set as the check DIR. In the example shown in FIG. 13, 7F80h is the address of the transport IEF directory, and the DF and EF directories under the MF are stored at addresses lower than this address.
# 2: Subtract 32 from the check DIR.
# 3: End when the check DIR is the same as the CRT-DP.
# 4: When the check DIR is other than “WEF linear variable length”, the process returns to “# 2:”.
# 5: <Address table pointer correction processing> is executed.
# 6: <Address table pointer CRC correction process> is executed.
# 7: Return to '# 2:'.

次に、<アドレステーブルポインタ修正処理>について説明する。
#1:WEFデータエリア開始アドレス+管理領域バイト数−2で指し示す内容を移動前WEF先頭アドレスとして取得する。
#2:移動前WEF先頭アドレス−WEF消去サイズによって得た値を「移動後差分アドレス」として保存する。
#3:アドレステーブルポインタ+1を修正アドレスとしてRAM14に保存する。
#4:現在のレコード数を保存し、0のときに処理を終了する。
#5:修正アドレスを含むページを読み込みページデータとして保持する。
#6:修正アドレスを32で割った余りを‘ページ位置’として保持する。
#7:修正アドレスより2バイトを読み込む。
#8:読み込んだデータを移動した後に、差分アドレスを修正データとして保持する。
#9:修正データ上位をページデータの‘ページ位置’番目にセットする。
#10:‘ページ位置’に1加算し、32のときに、1ページの書き戻しを行い、‘ページ位置’を0クリアし、次ページの読み込みを行う。
#11:修正データの下位をページデータの‘ページ位置’番目にセットする。
#12:‘ページ位置’に1加算し、32のときに、1ページの書き戻しを行い、‘ページ位置’を0クリアする。
#13:現在のレコード数より1減算し、0のときに処理を終了する。
Next, <address table pointer correction process> will be described.
# 1: The content indicated by the WEF data area start address + the number of management area bytes−2 is acquired as the pre-movement WEF head address.
# 2: The value obtained by the WEF head address before movement−WEF erase size is stored as “differential address after movement”.
# 3: The address table pointer +1 is stored in the RAM 14 as a modified address.
# 4: The current number of records is saved, and when it is 0, the process is terminated.
# 5: The page including the correction address is read and held as page data.
# 6: The remainder obtained by dividing the correction address by 32 is held as 'page position'.
# 7: 2 bytes are read from the corrected address.
# 8: After the read data is moved, the differential address is held as correction data.
# 9: The correction data upper rank is set to the “page position” of the page data.
# 10: 1 is added to “page position”. When 32, one page is written back, “page position” is cleared to 0, and the next page is read.
# 11: The lower part of the correction data is set to the “page position” of the page data.
# 12: “1” is added to “page position”. When 32, one page is written back, and “page position” is cleared to zero.
# 13: 1 is subtracted from the current number of records, and when it is 0, the process is terminated.

次に、<アドレステーブルポインタCRC修正処理>について説明する。
#1:ファイル最終アドレスを保持し、レコード登録個数を取得する。
#2:レコード登録個数0のときに、処理を終了する。
#3:保持したアドレスにより2減算する。
#4:CRCチェック実行し、実行結果を保持する。
#5:レコード登録数を1減算する。
#6:‘#2:’へ戻る。
Next, <address table pointer CRC correction process> will be described.
# 1: Holds the last address of the file and obtains the number of registered records.
# 2: When the number of registered records is 0, the process is terminated.
# 3: 2 is subtracted by the held address.
# 4: CRC check is executed and the execution result is held.
# 5: The record registration count is decremented by 1.
# 6: Return to '# 2:'.

[サイズ拡大の場合]図7は、ファイルのデータ部分書き換え(拡大バイト分広げる)を説明する図である。
#1:CRT−DPをターゲットとしてセットする。
#2:ターゲットアドレスに32加算する。
#3:ターゲットアドレスがファイル拡大をするDIRと同じアドレスのときに終了する。
#4:ターゲットとなったDIRがWEF以外のときに‘#2:’へ戻る。
#5:ターゲットとなったDIRのデータ部分を拡大バイト分だけ「アドレス上位方向」ヘ移動する。
#6:‘#2:’ヘ戻る。
[In the case of size enlargement] FIG. 7 is a diagram for explaining data rewriting of a file (expanding an enlarged byte).
# 1: Set CRT-DP as a target.
# 2: 32 is added to the target address.
# 3: End when the target address is the same address as the DIR for file expansion.
# 4: Return to '# 2:' when the target DIR is other than WEF.
# 5: Move the data portion of the target DIR to the “address upper direction” by the enlarged bytes.
# 6: Return to '# 2:'.

移動済WEF−DIRの内容修正処理は、以下の通りである。
#1:拡大対象ファイルのDIRアドレスをターゲットとしてセットする。
#2:ターゲットアドレスより32減算する。
#3:ターゲットアドレスがCRT−DPと同じときに終了する。
#4:ターゲットとなったDIRがWEF以外のときに‘#2:’へ戻る。
#5:DIRの管理領域内バイト数、書込み可能最終アドレス、アドレステーブルポインタ、WEFエリア開始アドレスを拡大した分だけ加算した値に書き換える。
#6:‘#2:’へ戻る。
The content correction process of the moved WEF-DIR is as follows.
# 1: Set the DIR address of the file to be enlarged as a target.
# 2: Subtract 32 from the target address.
# 3: End when the target address is the same as the CRT-DP.
# 4: Return to '# 2:' when the target DIR is other than WEF.
# 5: The number of bytes in the DIR management area, the last writable address, the address table pointer, and the WEF area start address are rewritten to the added value.
# 6: Return to '# 2:'.

図8は、CRT−APの変更を説明する図である。
#1:CRT−APより拡大した分だけ加算した値に書き換える。
FIG. 8 is a diagram for explaining the change of the CRT-AP.
# 1: Rewrite to the value added by the amount enlarged from CRT-AP.

図9は、サイズ変更ファイルの格納領域の内容変更について説明する図である。
#1:拡大を行うWEFが可変長のときに、<アドレステーブルポインタ移動処理>を実行する。拡大を行うWEFが可変長以外のときに、拡大を行うWEF−DIRのWEF開始アドレス+管理領域内バイト数を先頭にFFhを書き込む。拡大を行うWEFが可変長以外のときには、#2:拡大を行うWEF−DIRの管理領域内バイト数、書込み可能最終アドレス、アドレステーブルポインタを拡大分加算した値に書き換える。
FIG. 9 is a diagram for explaining the content change of the storage area of the size change file.
# 1: <Address table pointer movement processing> is executed when the WEF to be enlarged has a variable length. When the WEF to be expanded is other than the variable length, FFh is written starting with the WEF-DIR WEF start address to be expanded + the number of bytes in the management area. When the WEF to be enlarged is other than the variable length, # 2: the number of bytes in the management area of the WEF-DIR to be enlarged, the writable final address, and the address table pointer are rewritten to the added value.

次に、WEFリニア可変長「アドレステーブルポインタ」とCRCの書き換えについて説明する。
#1:拡大を行うWEF−DIRチェック用DIRとしてセットする。
#2:チェック用DIRより32減算する。
#3:チェック用DIRがCRT−DPと同じときに終了する。
#4:チェック用DIRが「WEFリニア可変長」以外のときに‘#2:’ヘ戻る。
#5:「移動後差分アドレス」として、拡大バイトをビット反転して1を加えたもの(上位方向ヘファイル移動したために)をセットして<アドレステーブルポインタ修正処理>の#3:以降を実行する。
#6:<アドレステーブルポインタCRC修正処理>を実行する。
#7:‘#2:’ヘ戻る。
Next, rewriting of the WEF linear variable length “address table pointer” and CRC will be described.
# 1: Set as DIR for WEF-DIR check to be enlarged.
# 2: Subtract 32 from the check DIR.
# 3: End when the check DIR is the same as the CRT-DP.
# 4: When the check DIR is other than “WEF linear variable length”, return to “# 2:”.
# 5: As the “differential address after movement”, set the bit after reversing the expanded byte and adding 1 (because the file has been moved to the upper direction), and execute <3: Address table pointer correction processing> and subsequent steps To do.
# 6: <Address table pointer CRC correction process> is executed.
# 7: Return to '# 2:'.

ここで、WEFがローテーション済循環順編成ファイルの場合を説明する。レコードの格納順序を保持するために、サイズ増加の際に、以下の処理を行う。並び変え不要チェックは、ライトアペンドポインタの示すアドレスがサイズ増加前のファイルエンドを超えているときに、ローテーション済フラグを消去して、処理を終了する。   Here, the case where the WEF is a rotated circulation sequential organization file will be described. In order to maintain the record storage order, the following processing is performed when the size is increased. In the reordering unnecessary check, when the address indicated by the write append pointer exceeds the file end before the increase in size, the rotated flag is deleted and the process ends.

図10は、データ並び変え処理を示す流れ図である。データ並び変え処理は、以下の手順に従い行われる。
S901:ライトアペンドポインタまでのレコード数を計算し、その値を変数Aに代入する。
S902:操作開始レコードは、物理番号Aのレコードとする。
S903:変数X、Yを用意する。
S904:変数XにAを代入する。
S905:変数Xに基づいて関数Funcの計算を行い、その結果を変数Yに代入する。関数Funcの処理内容については、後述する。
S906:物理レコードAと物理レコードYを入れ替える。
S907:変数Yを変数Xに代入する。
S908:以上の処理がレコード数分行われたか否かが判断され、レコード数分行われていないときはS905に戻り、レコード数分行われている場合には処理を終了する。
FIG. 10 is a flowchart showing the data rearrangement process. The data rearrangement process is performed according to the following procedure.
S901: The number of records up to the write append pointer is calculated, and the value is substituted into variable A.
S902: The operation start record is a record of physical number A.
S903: Variables X and Y are prepared.
S904: Substitute A into the variable X.
S905: The function Func is calculated based on the variable X, and the result is substituted into the variable Y. The processing content of the function Func will be described later.
S906: The physical record A and the physical record Y are exchanged.
S907: Substitute variable Y for variable X.
S908: It is determined whether or not the above processing has been performed for the number of records. When the processing has not been performed for the number of records, the process returns to S905, and when the processing has been performed for the number of records, the processing ends.

次に、S905の関数Funcの計算内容を説明する。
S9051:変数AがX以上であるか否かを判断し、以上である場合はS9052の処理を、以上でない場合にはS9053の処理を実行する。
S9052:変数Yに変数X及び全レコード数を加算し、さらに変数Aを減算する。
S9053:変数Yに変数Xを加算し、さらに変数Aを減算する。
Next, the calculation contents of the function Func in S905 will be described.
S9051: It is determined whether or not the variable A is equal to or greater than X. If it is equal to or greater than the above, the process of S9052 is performed. If not, the process of S9053 is performed.
S9052: The variable X and the total number of records are added to the variable Y, and the variable A is further subtracted.
S9053: Variable X is added to variable Y, and variable A is further subtracted.

<アドレステーブルポインタ移動処理>は、以下の通りである。移動元、移動先アドレス、移動バイト数を取得し、(移動元)<(移動先)のときに、最終データより移動する。
#1:移動先アドレス+移動バイト数−1を移動先アドレス、移動元アドレス+移動バイト数−1を移動元アドレスとする。
#2:移動先アドレスを含むぺージを読み込む。
#3:移動先アドレス÷32をカウンタとしてセットする。
#4:読み込んだデータのカウンタ番目に、移動元アドレスの内容をセットする。
#5:カウンタが0でないときに‘#8:’へ進む。
#6:セットしたぺージデータをEEPROM15へ書き戻す。
#7:1ページ前を読み込み、カウンタに32をセットする。
#8:カウンタ、移動元アドレス、移動バイト数を1減算する。
#9:移動バイト数が0のときに、セットしたぺージデータをEEPROM15へ書き戻して、処理を終了する。
#10:‘#4:’ヘ戻る。
<Address table pointer movement processing> is as follows. The source, destination address, and number of bytes to move are acquired. When (Move source) <(Move destination), move from the last data.
# 1: The movement destination address + the number of movement bytes−1 is the movement destination address, and the movement source address + the number of movement bytes−1 is the movement source address.
# 2: Read the page containing the destination address.
# 3: The destination address / 32 is set as a counter.
# 4: Set the contents of the source address to the counter of the read data.
# 5: When the counter is not 0, proceed to '# 8:'.
# 6: The set page data is written back to the EEPROM 15.
# 7: Read the previous page and set 32 to the counter.
# 8: Subtract 1 from the counter, source address, and number of bytes moved.
# 9: When the number of moving bytes is 0, the set page data is written back to the EEPROM 15, and the process is terminated.
# 10: Return to '# 4:'.

(移動元)>(移動先)のときに、先頭データより移動する。
#1:移動先アドレスを含むぺージを読み込み。
#2:移動先アドレス÷32をカウンタとしてセットする。
#3:読み込んだデータのカウンタ番目に、移動元アドレスの内容をセットする。
#4:カウンタが31でないときに‘#7:’へ進む。
#5:セットしたぺージデータをEEPROM15へ書き戻す。
#6:1ページ後を読み込み、カウンタに0をセット。
#7:カウンタ、移動元アドレス、移動バイト数を1加算する。
#8:移動バイト数を1減算する。
#9:移動バイト数が0のときに、セットしたぺージデータをEEPROM15へ書き戻して、処理を終了する。
#10:‘#3:’ヘ戻る。
When (Move source)> (Move destination), move from the top data.
# 1: Read the page containing the destination address.
# 2: The destination address / 32 is set as a counter.
# 3: The content of the source address is set at the counter of the read data.
# 4: When the counter is not 31, proceed to '# 7:'.
# 5: The set page data is written back to the EEPROM 15.
# 6: After page 1, read 0 and set counter to 0.
# 7: 1 is added to the counter, the source address, and the number of bytes moved.
# 8: Subtract 1 from the number of moving bytes.
# 9: When the number of moving bytes is 0, the set page data is written back to the EEPROM 15, and the process is terminated.
# 10: Return to '# 3:'.

CHANGE−SIZEのコマンドAPDUを示す図である。It is a figure which shows the command APDU of CHANGE-SIZE. CHANGE−SIZEコマンドを処理するICカード10の動作を示す流れ図である。It is a flowchart which shows operation | movement of the IC card 10 which processes a CHANGE-SIZE command. DFのサイズ変更を説明する図である。It is a figure explaining size change of DF. ファイルのデータ部分書き換え(縮小バイト分詰める)についての説明図である。It is explanatory drawing about rewriting of the data part of a file (packing for a reduction byte). 不要部分FFhクリアを説明する図である。It is a figure explaining unnecessary part FFh clear. CRT−APの変更を説明する図である。It is a figure explaining change of CRT-AP. ファイルのデータ部分書き換え(拡大バイト分広げる)についての説明図である。It is explanatory drawing about the data partial rewriting (expanding by an expansion byte) of a file. CRT−APの変更を説明する図である。It is a figure explaining change of CRT-AP. サイズ変更ファイルの格納領域の内容変更についての説明図である。It is explanatory drawing about the content change of the storage area of a size change file. データ並び変え処理を示す流れ図である。It is a flowchart which shows a data rearrangement process. 従来のICカードの構成、及びそのICカードとリーダライタ装置との接続関係を示すブロック図である。It is a block diagram which shows the structure of the conventional IC card, and the connection relationship between the IC card and a reader / writer device. EEPROM15内のファイル構成を示す図である。2 is a diagram showing a file configuration in an EEPROM 15. FIG. EEPROMにおけるファイル格納イメージの一例を示す図である。It is a figure which shows an example of the file storage image in EEPROM. EEPROMにおけるファイル格納イメージの一例であって、図13に示すものと異なるものを示す図である。It is an example of the file storage image in EEPROM, Comprising: It is a figure which shows a different thing from what is shown in FIG.

符号の説明Explanation of symbols

11 I/Oインタフェース
12 CPU
13 ROM
14 RAM
15 EEPROM
20 リーダライタ装置
11 I / O interface 12 CPU
13 ROM
14 RAM
15 EEPROM
20 Reader / writer device

Claims (2)

1又は2以上のファイルを格納可能なメモリを有するICカードにおいて、
外部からの命令により、外部から指定された指定容量だけ選択されているファイルの容量を縮小又は拡大する容量変更手段を有し、
前記ファイルは、自己の空き容量を記憶する空き容量記憶部を有し、
前記容量変更手段は、前記ファイルを配下に有する親ファイルの前記空き容量記憶部の内容を、前記指定容量に基づいて変更し、
前記容量変更手段が前記ファイルの容量を縮小する場合に、前記選択されているファイルの容量から、前記指定容量を減算した値が、前記選択されているファイルが配下に有するファイルのサイズの総容量より小となる場合に、前記容量変更手段が前記選択されているファイルの容量を縮小することを許可しない親ファイル変更制限手段を有すること
を特徴とするICカード。
In an IC card having a memory capable of storing one or more files,
A capacity changing means for reducing or enlarging the capacity of the file selected by the designated capacity designated from outside by an external command;
The file has a free capacity storage unit for storing its own free capacity,
The capacity changing means changes the content of the free capacity storage unit of the parent file under the file based on the specified capacity,
When said capacity changing means to reduce the capacity of the file, the capacity of the file that is the selected value obtained by subtracting the designated capacity is the size of the files that the selected file is Yusuke under An IC card comprising: a parent file change restricting means that does not permit the capacity changing means to reduce the capacity of the selected file when the total capacity is smaller than the total capacity.
請求項1に記載のICカードにおいて、
前記ファイルが有するデータ領域を移動する移動手段を有し、
前記ファイルのディレクトリ領域は、前記メモリの一方の端部から未使用な領域が存在しないように順に格納され、前記ファイルのデータ領域は、前記メモリの他方の端部から未使用な領域が存在しないように順に格納されており、
前記容量変更手段は、前記選択されているファイルがデータ領域を有するファイルである場合は、前記データ領域を前記指定容量だけ縮小又は拡大し、
前記移動手段は、前記容量変更手段により縮小されたデータ領域より前記メモリの一方の端部側に他の前記データ領域が存在する場合は、前記メモリの他方の端部側へ前記指定容量だけ前記他のデータ領域を移動させる、又は、前記容量変更手段により拡大されるべきデータ領域より前記メモリの一方の端部側に他の前記データ領域が存在する場合は、前記メモリの一方の端部側へ、前記指定容量だけ前記他のデータ領域を移動させること
を特徴とするICカード。
In the IC card according to claim 1 ,
Moving means for moving the data area of the file;
The directory area of the file is stored in order so that there is no unused area from one end of the memory, and the data area of the file has no unused area from the other end of the memory. Are stored in order as
When the selected file is a file having a data area, the capacity changing unit reduces or enlarges the data area by the specified capacity,
The moving means has the specified capacity to the other end side of the memory when the other data area exists on one end side of the memory from the data area reduced by the capacity changing means. If another data area exists on the one end side of the memory from the data area to be moved or expanded by the capacity changing means, the one end side of the memory And moving the other data area by the specified capacity.
JP2007219026A 1995-12-22 2007-08-24 Ic card Pending JP2008016050A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007219026A JP2008016050A (en) 1995-12-22 2007-08-24 Ic card

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP33550995 1995-12-22
JP2007219026A JP2008016050A (en) 1995-12-22 2007-08-24 Ic card

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP8322692A Division JPH09231111A (en) 1995-12-22 1996-12-03 Ic card

Publications (1)

Publication Number Publication Date
JP2008016050A true JP2008016050A (en) 2008-01-24

Family

ID=39072937

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007219026A Pending JP2008016050A (en) 1995-12-22 2007-08-24 Ic card

Country Status (1)

Country Link
JP (1) JP2008016050A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015207255A (en) * 2014-04-23 2015-11-19 凸版印刷株式会社 Storage medium device, method of controlling storage medium, and program

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015207255A (en) * 2014-04-23 2015-11-19 凸版印刷株式会社 Storage medium device, method of controlling storage medium, and program

Similar Documents

Publication Publication Date Title
CN105975399B (en) Method for managing a memory device and related memory device
US7480775B2 (en) Method and apparatus for block-oriented memory management provided in smart card controllers
US6612490B1 (en) Extended card file system
US7529882B2 (en) Dynamic volume management for flash memories
US20090307291A1 (en) Smart card storage system and file management method therein
EP0583006A2 (en) IC card with hierarchical file structure
KR100703680B1 (en) Flash file system
EP1381966B1 (en) A method and apparatus for reducing ram size while maintaining fast data access
US5765211A (en) Segmenting non-volatile memory into logical pages sized to fit groups of commonly erasable data
US7895164B1 (en) Efficient checkpoint process
US7167964B1 (en) Memory defragmentation in chipcards
JP2008016050A (en) Ic card
CN112612753B (en) System and method for dynamically managing Java Card storage space
KR101102754B1 (en) Nand flash memory file system and method for accessing file thereof
JPH09231111A (en) Ic card
JP3801176B2 (en) Memory control method, storage device, control program, and readable recording medium
CN103354925A (en) Memory controller
JPH09231110A (en) Ic card
JPH06131517A (en) Ic card
WO2019074572A1 (en) System and method for securely storing data in a sim
CN100392765C (en) Secure writing of data
JPH089795Y2 (en) IC card
JP2002222120A (en) Memory access management device and management method
JP2008009636A (en) Storage device
JPH0827824B2 (en) IC card

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080205

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20080603