











本発明は、例えば電子署名として電子文書のハッシュ値を外部機器に送信する技術に関するものである。 The present invention relates to a technique for transmitting a hash value of an electronic document to an external device as an electronic signature, for example.
近年、さまざまな文書が電子データとして扱われるようになり、電子データの重要性が増大している。電子データはコピーや編集が容易であることが長所であるが、逆に改竄も容易である。電子データの改竄を検出するために電子署名と呼ばれる技術があり、すでに広く使われている。 In recent years, various documents have been handled as electronic data, and the importance of electronic data has increased. The advantage of electronic data is that it is easy to copy and edit, but it is also easy to tamper. In order to detect tampering of electronic data, there is a technique called electronic signature, which is already widely used.
XPS(XML Paper Specification、非特許文献1参照)も電子データフォーマットの一つであり、電子署名を含めることができる。XPSファイルは、「パート」と呼ばれるデータを複数集め、Zip形式でまとめたものとなっている。電子署名パートもXPSファイル中の1つのパートとして含まれている。電子署名パートの書式はXML電子署名仕様(非特許文献2参照)を基にしており、更にいくつかの制限を加えたものである。 XPS (XML Paper Specification, see Non-Patent Document 1) is also one of electronic data formats, and can include an electronic signature. The XPS file is a collection of a plurality of pieces of data called “parts” collected in a Zip format. The electronic signature part is also included as one part in the XPS file. The format of the electronic signature part is based on the XML electronic signature specification (see Non-Patent Document 2), and is further limited in some ways.
  XPSの電子署名を含む文書(以下、電子署名文書)は図1に示す構成になっている。電子署名文書101全体はSignature要素となっている。Signature要素の先頭にはSignedInfo要素102があり、さらにその中にReference要素(又は参照要素)103がある。この中にはObject要素105のハッシュ値が格納されている。SignatureValue要素104には署名値111が格納されている。署名値111はSignedInfo要素102のハッシュ値を、署名者の秘密鍵で暗号化したものである。Object要素105はManifest要素106を含み、さらにその中には通常複数個のReference要素が含まれる。これらのReference要素は署名の対象となるパート1つにつき1つ作成され、署名対象パートのハッシュ値が含まれている。なお、通常、XPS文書に含まれるXMLデータは名前空間宣言や名前空間プレフィックスを持つが、本明細書中では省略している。  A document including an XPS electronic signature (hereinafter referred to as an electronic signature document) has the configuration shown in FIG. The entire
  これら各要素の関係から、パート109、パート110の情報から電子署名文書101を作成するには、まずObject要素の作成とハッシュ値の計算を行う必要がある。その後、SignedInfo要素の作成、SignedInfo要素のハッシュ値計算および暗号化、さらにSignatureValueの作成となる。しかし、この手順では電子署名文書全体を一旦(計算書理に必要な)メモリに保持しなければならない。これは、SignedInfo要素およびSignatureValue要素の作成にはObject要素が完成する必要があるが、そのObject要素がSignatureValue要素より後ろにあるためである。仮にObject要素が先頭であれば、Object要素のハッシュ値を計算してハッシュ値のみ保持し、Object要素そのものは先に外部機器に送信してメモリ上から破棄することができる。しかし、各要素の順序はXML電子署名仕様およびXPS仕様で定められており変更することはできない。  In order to create the
このことは署名対象パートが少ない場合には大きな問題とはならないが、多いときにはメモリやハードディスクなどの記憶装置に収まらなくなる可能性がある。前述のとおり署名対象パート1つにつき1つのReference要素が作成されてObject要素内に格納されるため、署名対象パートが多いとObject要素が肥大していく。特に、計算資源の少ない小型機器ではメモリや外部記憶装置に収まらなくなり、多くのパートからなるXPS文書に対して署名を付与できなくなるという問題があった。 This is not a big problem when the number of parts to be signed is small, but it may not fit in a storage device such as a memory or a hard disk when it is large. As described above, one Reference element is created for each signature target part and stored in the Object element. Therefore, if there are many signature target parts, the Object element is enlarged. In particular, there is a problem that a small device with few computing resources cannot be stored in a memory or an external storage device, and a signature cannot be given to an XPS document composed of many parts.
メモリなどの計算資源が乏しいあるいは非力な環境での電子署名の作成方法としては、電子署名の作成を計算資源の豊富な外部の機器に任せる、という方法がある(例えば、特許文献1参照)。 As a method for creating an electronic signature in an environment where computing resources such as memory are scarce or weak, there is a method in which creation of an electronic signature is left to an external device rich in computing resources (see, for example, Patent Document 1).
しかしながら、外部の機器を利用する方法では署名値を計算する際に使われる秘密鍵を外部に出さなくてはならなくなるという課題がある。秘密鍵はその電子署名の署名者を判別する重要な情報であるため、外部の機器に出すことはセキュリティの面を考慮すると回避する必要がある場合がある。また、この方法では外部の機器がない状況では電子署名を作成できず、利便性が損なわれるという課題もある。そこで本発明は複数のデータ(パート)各々に対してハッシュ値を持つような形式の電子署名を、メモリなどの資源が乏しい環境、及び電子署名のための外部の機器がない環境で作成可能とすることを目的とする。 However, a method using an external device has a problem that a secret key used for calculating a signature value must be output to the outside. Since the private key is important information for determining the signer of the electronic signature, it may be necessary to avoid giving it to an external device in view of security. In addition, this method has a problem in that an electronic signature cannot be created in a situation where there is no external device, and convenience is impaired. Therefore, the present invention can create an electronic signature having a hash value for each of a plurality of data (parts) in an environment where resources such as a memory are scarce and an external device for electronic signature is not provided. The purpose is to do.
本発明の電子署名作成装置は、複数のパートにより構成される電子文書の電子署名を生成する電子署名生成装置であって、前記複数のパートそれぞれに対して、前記パートに関連する情報と前記第一のハッシュ値とを含む参照要素を生成する参照要素生成手段と、 前記参照要素生成手段により生成された参照要素を、符号化テーブルに基づいて符号化して、保持する保持手段と、前記保持手段に保持されている符号化された参照要素を逐次読み出し、前記符号化テーブルに基づいて復号化した参照要素を合成することにより、前記電子文書の全体に対する第二のハッシュ値を生成する生成手段と、生成手段により生成された前記電子文書の全体に対する第二のハッシュ値を前記外部機器に送信し、その後、前記保持手段に保持されている符号化された参照要素を逐次復号化し、前記外部機器に送信する送信手段とを有することを特徴とする。An electronic signature generation apparatus according to the present invention is an electronic signature generation apparatus that generates an electronic signature of an electronic document composed of a plurality of parts. For each of the plurality of parts, information related to the part and the Reference element generation means for generating a reference element including one hash value,holding means for encodingand holding the reference element generated by the reference element generation means based on an encoding table,and theholding means reads the coded reference element areheld sequentially, by synthesizing the reference element which is decoded based on the coding table, and generating means for generating a second hash value for the entire of said electronic document The second hash value for the whole electronic document generated by the generating unit is transmitted to the external device, and then the codeheld in theholding unit Transmitting means for sequentially decoding the converted reference elements and transmitting them to the external device.
本発明により、複数のデータ(パート)各々に対するハッシュ値を持つような形式の電子署名を、メモリなどの資源が乏しい環境、及び電子署名のための外部の機器がない環境で作成可能となる。 According to the present invention, an electronic signature having a hash value for each of a plurality of data (parts) can be created in an environment where resources such as a memory are scarce and an external device for electronic signature is not provided.
  (実施例1)
  本実施形態の電子署名生成装置を構成するスキャナ装置(情報処理装置)の構成について、図2のブロック図を参照して説明する。スキャナ装置は単一の装置で実現してもよいし、必要に応じた複数の装置に各機能を分散して実現するようにしてもよい。複数の装置で構成される場合は、互いに通信可能なようにLocal  Area  Network(LAN)やWide  Area  Network(WAN)などで接続されている。Example 1
 The configuration of the scanner device (information processing device) constituting the electronic signature generation device of this embodiment will be described with reference to the block diagram of FIG. The scanner device may be realized by a single device, or may be realized by distributing each function to a plurality of devices as necessary. When configured by a plurality of devices, they are connected by a local area network (LAN) or a wide area network (WAN) so that they can communicate with each other.
  図2において、Central  Processing  Unit(CPU)201は、スキャナ装置200全体を制御する。Read  Only  Memory(ROM)202は、変更を必要としないプログラムやパラメータを格納する。Random  Access  Memory(RAM)203は、外部装置などから供給されるプログラムやデータを一時記憶する。記憶装置204は、スキャナ装置200に設置されたハードディスク、着脱可能なフレキシブルディスク(FD)やCompact  Disc(CD)などの光ディスク、磁気カードなどである。一般に、記憶装置204はRAM203に比べて大容量である一方、データへのアクセスに時間がかかる。このような特性の違いから、RAM203は各種計算処理(例えば、符号化、復号化処理)に必要な記憶領域を提供し、記憶装置204は、データを一時退避するなどの機能を提供する。スキャン部205は、紙文書などを読み取って電子データとして出力する。ネットワークインターフェース206は、外部の機器と接続するためのインターフェースである。操作部207は、ユーザの操作を受け、データを入力するポインティグデバイスやキーボードなどの入力装置である。システムバス208は、CPU201や操作部207のスキャナ装置200内の各ユニットを通信可能に接続する。また、スキャナ装置はMFP(Multi  Function  Printer)等の情報処理装置の一部として構成されていてもよい。  In FIG. 2, a central processing unit (CPU) 201 controls the
  スキャナ装置200は、スキャン部205で紙原稿を読み取り、そのデータをXPS文書として生成、さらに電子署名を付けてネットワーク上の別の機器に送信することが可能である。以降、この場合を例として説明する。  The
  本実施形態のソフトウェア構成を図3に示す。ハッシュ生成部301は、任意のデータからそのデータのハッシュ値を計算して生成する。ハッシュ生成部301が行うハッシュ関数は、データの分割処理、すなわち大きなデータであってもそれを分割して逐次処理し、一定のメモリサイズでデータ全体のハッシュ値を求めることが可能なアルゴリズムを利用している。このようなアルゴリズムには例えばMD5(Message  Digest  5)やSHA1(Secure  Hash  Algorithm1)などがある。暗号化部302は、図1のSignedInfo要素の署名値を作成する。暗号化処理のアルゴリズムには、通常RSAやDSAなどの公開鍵暗号方式が用いられる。符号化処理部303は、符号化テーブル307を用いてReference要素(又は参照要素)を符号化して圧縮を行う。Reference要素は、パートに関連する情報(例えば、パート名やパートのハッシュ値を生成するためのハッシュ値計算アルゴリズム)を含む。復号化部304は、符号化テーブル307を用いて符号化Reference要素を復号化する。ハッシュ保持部305は、ハッシュ生成部301が生成したハッシュ値を保持するメモリであり、例えば、RAM203内のメモリ領域の一部である。前述のとおりハッシュ生成部301は、ハッシュ計算の逐次処理に対応しており、ハッシュ保持部305は、その処理過程の一時データを保持、及び更新することに使用される。ハッシュ保持部305は、例えば、RAM203内のメモリ領域の一部である。符号化Reference要素保持部306は、符号化処理部303によって符号化されたReference要素を保持するメモリであり、例えば、記憶装置204内のメモリ領域の一部である。XPS文書生成部308は、電子署名パート以外のXPS文書パートを生成し、更に電子署名パートと組み合わせて電子署名付きXPS文書を生成する。XPS文書生成部308は、OCR機能、グラフィカルオブジェクト検出機能(ベクトル図形検出機能)や画像抽出機能等を有し、更に、抽出された文字列や画像に対してXPS文書パートを生成する。XML正規化部309は、XML文書を正規化する。XMLの正規化とは、XML文書の書式を統一するものであり、ハッシュ値の計算の前処理として使用されることがある。  The software configuration of this embodiment is shown in FIG. The
XPS文書生成部308の詳細について説明する。XPS文書生成部308は、スキャン部205によって読み取られた紙原稿のデジタルデータからXPS文書を構成するパートを生成する。また、電子署名を付与する場合には電子署名に関する設定情報も出力する。生成されるパートの種類(コンテントタイプ)の一例を図7(a)に示す。コンテントタイプの識別子はURIの形式であり、図7(a)の3列目に示されている。ただし、本文書では便宜上1列目に示すコンテントタイプ略称を用いて説明する。この略称は説明の簡略化のためであり、実際のコンテントタイプの識別には常にURIが使われる。また、fdocやxamlのように、URIが“xml”で終わるものはXML形式である。 Details of the XPS document generation unit 308 will be described. The XPS document generation unit 308 generates parts constituting the XPS document from digital data of a paper document read by the scanning unit 205. When an electronic signature is given, setting information related to the electronic signature is also output. An example of the type (content type) of the generated part is shown in FIG. The content type identifier is in URI format, and is shown in the third column of FIG. However, in this document, the content type abbreviation shown in the first column will be used for convenience. This abbreviation is for simplification of explanation, and a URI is always used to identify an actual content type. In addition, when the URI ends with “xml”, such as fdoc and xaml, the XML format is used.
XPSでは任意のパート名を使用することが可能だが、XPS文書生成部308は、図7(b)の命名規則に従ってパート名を生成する。fdocやfdseqなどは1つのXPS文書につき1つのみ生成され、パート名は毎回同じものになる。fpageはページ毎に1つ生成され、“1.fpage”、“2.fpage”のようにページ番号を持つ名前となる。JPG、PNG、TIFは画像ファイルであり、各ページに含まれる画像ごとに1つずつ生成される。名前はページ番号とページ内画像番号とからなる名前を持つ。例えば、1ページ目の最初のJPGの画像データは“1−1.JPG”、2ページ目の3番目のPNGの画像データは“2−3.PNG”などとなる。また、fpageと画像データのディレクトリ名はそれぞれ固定のものである。odttfは1つのXPS文書につき1つだが、パート名はランダムな文字列であり文書毎に異なる。 Although any part name can be used in XPS, the XPS document generation unit 308 generates a part name according to the naming rule of FIG. Only one fdoc or fdseq is generated for one XPS document, and the part name is the same every time. One fpage is generated for each page, and has names with page numbers such as “1.fpage” and “2.fpage”. JPG, PNG, and TIF are image files, and are generated for each image included in each page. The name has a name composed of a page number and an in-page image number. For example, the image data of the first JPG on the first page is “1-1.JPG”, and the image data of the third PNG on the second page is “2-3.PNG”. Further, the directory names of fpage and image data are fixed. Although odttf is one for one XPS document, the part name is a random character string and is different for each document.
relsは、やや特殊な規則を持つ。relsは通常他の特定のパートに付随するものであり、各fdoc、fdseq、fpageパートに対して1つ生成される。パート名は”{付随するパートのあるディレクトリ}/_rels/{付随するパートのファイル名}.rels”という名前になる。例えば”/Documents/1/Pages/1.fpage”という名前のパートに対するrelsパートの名前は”/Documents/1/Pages/_rels/1.fpage.rels”となる。また、他のパートに付随しないrelsパートも文書に必ず1つ含まれている。これはPackageRelationshipパートと呼ばれ、パート名は”/_rels/.rels”である。なお、本実施形態ではこのPackageRelationshipのことをprelと呼び、その他のrelsパートとは区別する。 rels has a somewhat special rule. The rels are usually attached to other specific parts, and one rels is generated for each fdoc, fdseq, and fpage part. The part name is “{directory with accompanying part} / _ rels / {file name of accompanying part} .rels”. For example, the name of the rels part for the part named “/Documents/1/Pages/1.fpage” is “/Documents/1/Pages/_rels/1.fpage.rels”. Also, one rels part that does not accompany other parts is always included in the document. This is called a PackageRelationship part, and the part name is “/_rels/.rels”. In the present embodiment, this PackageRelationship is called prel and is distinguished from other rels parts.
また、XML形式の文書の場合は、さらに正規化設定も出力される。正規化にはいくつかの方法があるが、XPS文書生成部308は、relsとprel以外には正規化の設定は行わない。relsとprelについてはRelationships Transformと標準XML正規化の2つが指定されるのが一般的であり、XPS文書生成部308もこれに従う。Relationships TransformはXPS仕様に含まれるアルゴリズムであり、さらにいくつかのオプションを持つ。このオプションはSourceTypeと呼ばれ、図8に示す13個のオプションを1つ以上選択することが可能であるが、prelは常に図8の1、5、12がセットされている。標準XML正規化は、W3C標準の正規化である(http://www.w3.org/TR/xml−c14n)。正規化のアルゴリズムおよびSourceTypeはすべてURI形式で識別される。 In the case of an XML format document, the normalization setting is also output. Although there are several methods for normalization, the XPS document generation unit 308 does not perform normalization settings other than rels and prel. For rels and prel, two types of relations transform and standard XML normalization are generally specified, and the XPS document generation unit 308 also follows this. The Relationships Transform is an algorithm included in the XPS specification and has several options. This option is called SourceType, and one or more of the 13 options shown in FIG. 8 can be selected, but prel is always set to 1, 5, and 12 in FIG. Standard XML normalization is a normalization of the W3C standard (http://www.w3.org/TR/xml-c14n). Normalization algorithms and SourceType are all identified in URI format.
以上のように、XPS文書生成部308は、パート名、パートのデータ、コンテントタイプを出力し、さらにrelsやprelの場合は正規化設定(SourceType含む)も出力する。また、fpageと画像データは紙原稿を1枚スキャンする毎に生成され、さらに各ページにおいては最初にfpageが出力され、その後に画像データが生成される。従って、“1.fpage”より先に“2.fpage”が生成されたり、“2.fpage”より先に“2−1.JPG”が生成されたりすることはない。 As described above, the XPS document generation unit 308 outputs the part name, part data, and content type, and also outputs normalization settings (including SourceType) in the case of rels or prel. Further, fpage and image data are generated every time a paper document is scanned, and fpage is output first for each page, and then image data is generated. Therefore, “2.fpage” is not generated before “1.fpage”, and “2-1.JPG” is not generated before “2.fpage”.
  本実施形態の電子署名生成装置が、以上の規則で生成されるXPS文書の電子署名を生成する処理全体の流れを図4に示す。まず署名文書となるSignature要素の初期設定を行う(S402)。この初期設定の結果を図6に示す。XPS電子署名の書式にほぼ従っているが、DigestValue要素611、SignatureValue要素614、およびManifest要素(616〜617)は空である。  FIG. 4 shows the overall flow of processing in which the electronic signature generation apparatus of this embodiment generates an electronic signature of an XPS document generated according to the above rules. First, initial setting of a Signature element to be a signature document is performed (S402). The result of this initial setting is shown in FIG. Although approximately following the format of the XPS digital signature, the
  Object要素はManifest要素の他にSignatureProperties要素(618〜625)等が含まれている。これらの属性はXPS仕様およびXML  Signature仕様に従ったものであり、詳細については本実施形態では説明は省略する。  次に、XPS文書生成部308が生成した全てのパートに対して、S403からS406の間の処理、すなわち、S404、S405の処理を行う。まず、パートのハッシュ生成部301を使ってハッシュ値を求める(S404)。ハッシュのアルゴリズムはSHA1である。パート名・コンテントタイプ・ハッシュ値、relsの場合はさらに正規化設定の情報からReference要素を生成して保持する(S405)。S405の詳細を図5に示す。まず、パートの署名設定情報とハッシュ値からReference要素を生成する(S502)。  The Object element includes a SignatureProperties element (618 to 625) in addition to the Manifest element. These attributes are in accordance with the XPS specification and the XML Signature specification, and the details are not described in the present embodiment. Next, the processing from S403 to S406, that is, the processing of S404 and S405 is performed on all the parts generated by the XPS document generation unit 308. First, the hash value is obtained by using the
  Reference要素の例を図11に示す。図11からもわかるように、Reference要素には、ハッシュ値と、そのハッシュ値を生成するための情報(例えばハッシュ値計算アルゴリズム)とを含む。Reference要素はハッシュ要素とも呼ばれる。1101のURI属性が署名対象パートのパート名とコンテントタイプを表しており、‘?’で区切られている。つまり、パート名は“/Documents/1/_rels/FixedDocument.fdoc.rels”であり、コンテントタイプはrelsである。Transform要素(1103、1109)は正規化設定である。正規化アルゴリズムはAlgorithm属性で指定されており、それぞれRelationships  Transformと標準XML正規化である。1104〜1107はSouceTypeであり、図8における6、11、8、5が指定されている。ハッシュ値計算のアルゴリズムはDigestMethod要素(1111)で指定されており、SHA1である。  An example of the Reference element is shown in FIG. As can be seen from FIG. 11, the Reference element includes a hash value and information for generating the hash value (for example, a hash value calculation algorithm). The Reference element is also called a hash element. The
  次に、Reference要素退避モードになっているかを確認する(S503)。Reference要素退避モードは、ユーザーが任意に設定する。例えば、ユーザーは情報処理単位でReference要素退避モードか否かを設定しても良いし、或いは、署名要素対象文書単位で設定しても良い。Reference退避モードでなければ保持しているReference要素(又はパート数)の数と所定数n(例えば、100個)とを比較・判断する(S505)。n個未満(又は所定数以下)であれば生成したReference要素をそのままメモリ中に保持しておき、処理を終了する。Reference要素の個数がn個以上の場合はReference要素退避モードをtrueにする。更に、すでに保持しているReference要素すべてを符号化し、符号化Reference要素保持部306に記憶(退避)する(S507)。また、今回生成されたReference要素も同様に符号化して記憶(退避)する(S508、S509)。S503において、Reference要素退避モードが、trueの場合(是の場合)も生成されたReference要素を符号化して符号化Reference要素保持部306に記憶(退避)する。S507における退避処理はS508およびS509の処理と同じである。符号化は符号化処理部303が、符号化テーブル307を用いて行う。符号化テーブルには図7(a)のテーブルと図7(b)のテーブルに示すパート名生成規則が含まれている。  Next, it is confirmed whether the Reference element save mode is set (S503). The reference element save mode is arbitrarily set by the user. For example, the user may set whether or not the Reference element save mode is in information processing units, or may be set in signature element target document units. If not in the reference save mode, the number of reference elements (or the number of parts) held and a predetermined number n (for example, 100) are compared and judged (S505). If the number is less than n (or a predetermined number or less), the generated Reference element is retained in the memory as it is, and the process is terminated. If the number of reference elements is n or more, the reference element save mode is set to true. Further, all the reference elements already held are encoded and stored (saved) in the encoded reference element holding unit 306 (S507). Further, the reference element generated this time is similarly encoded and stored (saved) (S508, S509). In S <b> 503, the generated reference element is encoded and stored (saved) in the encoded reference
符号化はそのパートのコンテントタイプによって異なる方法となる。fdoc・fdseq・otf・coreprop・xaml・prelの場合は、図9(a)に示すフォーマットで保存する。記号Cはコンテントタイプであり、図7(a)の符号(1バイト)が用いられる。SHA1の場合は20バイトである。例えば、fdocの場合は[01 ダイジェスト値]となる。これらのパートのパート名は一意であるため保存する必要はない。 Encoding differs depending on the content type of the part. In the case of fdoc / fdseq / otf / coreprop / xaml / prel, the file is stored in the format shown in FIG. Symbol C is a content type, and the code (1 byte) in FIG. 7A is used. In the case of SHA1, it is 20 bytes. For example, in the case of fdoc, it is [01 digest value]. These part names are unique and do not need to be saved.
fpageは図9(b)のフォーマットで保存する。記号Pはページ番号であり2バイト(16ビット)である。従って最大65535ページとなる。JPG・PNG・TIFは図9(c)のフォーマットで保存する。記号Pはページ番号、記号Nはページ内識別番号であり、それぞれ2バイトである。例えば”2−3.JPG”の場合は[11 00 02 00 03 ダイジェスト値]となる。 The fpage is saved in the format of FIG. Symbol P is a page number and is 2 bytes (16 bits). Therefore, the maximum is 65535 pages. JPG, PNG, and TIF are stored in the format shown in FIG. Symbol P is a page number, and symbol N is an in-page identification number, each of which is 2 bytes. For example, in the case of “2-3.JPG”, [11 00 02 00 03 digest value] is obtained.
odttfは図9(d)のフォーマットである。odttfのパート名は毎回異なる名前が生成されるため、パート名をそのまま保持する。記号PLはパート名の長さであり、記号PartNameはパート名である。 odttf has the format of FIG. Since a different name is generated for each part name of odttf, the part name is retained as it is. The symbol PL is the length of the part name, and the symbol PartName is the part name.
なお、図9(a)から9(d)のフォーマットを使うパートは、正規化設定が一意であり、それらの情報は保存する必要はない。 In addition, the normalization setting is unique for the parts using the formats of FIGS. 9A to 9D, and it is not necessary to save the information.
relsはやや特殊であり図9(e)のフォーマットである。記号STはSourceTypeであり2バイト、つまり16ビットである。この16ビットの下位ビットから順に図8のビットが対応する。また、前述のとおりrelsパートは他のパートに付随したものになっており、記号PartInfoはその対応するパートのフォーマットである。 rels is somewhat special and has the format shown in FIG. The symbol ST is SourceType and is 2 bytes, that is, 16 bits. The bits of FIG. 8 correspond in order from the lower 16 bits. Further, as described above, the rels part is attached to another part, and the symbol PartInfo is the format of the corresponding part.
例えば、図11に示すrelsパートに対するReference要素の場合を考える。まず、コンテントタイプからこのパートがrelsであることがわかり、先頭バイトは21である。また前述のとおり、Relationships TransformのSourceType設定は図8における6、11、8、5である。2バイト(16ビット)下位6、11、8、5ビットを立てたものは0000100101100000である(0から数えるため実際には右から6、7、9、12ビット目が1)。これを16進数で表すと[09 60]である。PartInfoは付随パートの情報が必要だが、付随パートはパート名から判別でき、“/Documents/1/FixedDocument.fdoc”である。図7(b)から、付随するパートのコンテントタイプがfdocであることがわかる。fdocは図9(a)の形式で符号化し、コンテントタイプは01である。従って、図11のReference要素を符号化すると[21 09 06 01 ダイジェスト値]である。このようにして、relsのハッシュ値および署名設定情報を保存する。 For example, consider the case of the Reference element for the rels part shown in FIG. First, it can be seen from the content type that this part is rels, and the first byte is 21. Further, as described above, the SourceType setting of the Relationships Transform is 6, 11, 8, and 5 in FIG. 20000 (16 bits) lower 6th, 11th, 8th and 5th bits are 0000100101100000 (in order to count from 0, the 6th, 7th, 9th and 12th bits from the right are 1). This is expressed as [09 60] in hexadecimal. PartInfo needs information on the accompanying part, but the accompanying part can be identified from the part name, and is “/Documents/1/FixedDocument.fdoc”. From FIG. 7B, it can be seen that the content type of the accompanying part is fdoc. The fdoc is encoded in the format of FIG. 9A, and the content type is 01. Therefore, when the Reference element in FIG. 11 is encoded, it is [21 09 06 01 digest value]. In this way, the hash value of rels and signature setting information are stored.
  なお、本実施形態では1つのReference要素に関する情報をエントリと呼ぶ。符号化Reference要素保持部306は0個以上のエントリから構成される。  In the present embodiment, information regarding one Reference element is referred to as an entry. The encoded reference
  すべての署名対象パートに対するReference要素の作成および符号化Reference要素の作成・退避が終われば、次にObject要素のハッシュ値生成処理S407を行う。この処理の詳細を図10に示す。まず、Object、Manifest開始タグ、つまり615、616を正規化してハッシュ生成部301に入力する(1002)。途中結果はハッシュ保持部305に格納される。正規化のアルゴリズムは607に記述されており、標準XML正規化である。また、1007、1009での正規化も同様である。Reference要素退避モードがtrueでない場合(署名対象パートがn、例えば100以下だった場合)は、Reference要素はすべてRAM203上にある。従ってこれをそのまま正規化し、ハッシュ生成部に入力する(1012)。  When the creation of the Reference elements for all the parts to be signed and the creation / saving of the encoded Reference elements are completed, a hash value generation process S407 for the Object elements is performed. Details of this processing are shown in FIG. First, the Object and Manifest start tags, that is, 615 and 616 are normalized and input to the hash generation unit 301 (1002). The intermediate result is stored in the
  退避されていた場合は、符号化Reference要素保持部306の末尾に達するまでエントリをRAM203に逐次読み出して(1005)、Reference要素を復号化し(1006)、ハッシュ生成部301に入力する(1007)。  If it has been saved, the entries are sequentially read out to the
Reference要素の復号化にはコンテントタイプ、パート名、ダイジェスト値、relsの場合はさらにSourceTypeが必要である。コンテントタイプは各エントリの1バイト目に記述されている。その他の情報についてはコンテントタイプによって異なる。図9(a)のフォーマットの場合はパート名が決まっており容易に復号化できる。図9(b)のフォーマット(fpage)の場合は、最初のfpageの場合に”1.fpage”、以降はページ番号を増やして”2.fpage”、”3.fpge”とし、固定のディレクトリ名を加えればよい。図9(c)のフォーマット(JPG、PNG、TIF)の場合は、ページ番号はこれまで出現したfpageの数、ページ内識別番号は各ページ内で1、2、3……の順に増やしていくことで復号化できる。図9(d)(odttf)の場合は2バイト目にパート名の長さがあり、3バイト目以降にパート名が含まれている。図9(e)(rels)の場合は2バイト目にSourceTypeがあり、3バイト目以降に付随するパートのフォーマットでパート名、コンテントタイプなどの情報が含まれている。これらの情報から元のReference要素を復号化することが可能である。 Decoding of the Reference element requires a ContentType in the case of content type, part name, digest value, and rels. The content type is described in the first byte of each entry. Other information depends on the content type. In the case of the format of FIG. 9A, the part name is determined and can be easily decrypted. In the case of the format (fpage) in FIG. 9B, the fixed directory name is “1.fpage” in the case of the first fpage, and thereafter the page number is increased to “2.fpage” and “3.fpge”. Should be added. In the case of the format (JPG, PNG, TIF) in FIG. 9C, the page number is increased in the order of 1, 2, 3,... Can be decrypted. In the case of FIG. 9D (odttf), the length of the part name is in the second byte, and the part name is included in the third and subsequent bytes. In the case of FIG. 9E (rels), the source type is the second byte, and information such as the part name and content type is included in the format of the part that accompanies the third and subsequent bytes. It is possible to decode the original Reference element from these pieces of information.
  なお、符号化Reference要素保持部にある情報はこの段階では破棄されずに残っている。一方RAM203に逐次読みだされた符号化Reference要素および復号化されたReference要素は、ハッシュ生成部に入力した時点で破棄する。従ってすべての復号化されたReference要素をRAM203上に持つことなく処理することが可能である。  Note that the information in the encoded Reference element holding unit remains without being discarded at this stage. On the other hand, the encoded Reference element and the decoded Reference element sequentially read out to the
  図12は、S1007でのハッシュ生成部301の処理を示したフローである。S1005で読み込まれた復号化されたReference要素に対するハッシュ値を求める(S1201)。そして、求められたハッシュ値に基づいて、ハッシュ保持部305に保持されているハッシュ値を更新する(S1202)。具体的には、求められたハッシュ値を、ハッシュ保持部305に保持されているハッシュ値に合成することにより、ハッシュ保持部305に保持されているハッシュ値を更新する。そして、ハッシュ値が更新された後、S1005で読み込まれた復号化されたReference要素、及びそのハッシュ値はRAM203上から削除される(S1203)。  FIG. 12 is a flowchart showing the processing of the
  S1004からS1008までの処理を全ての符号化Reference要素に対して実行する。Object要素に対するハッシュ値を求めるためには、全てのReference要素を復号化する必要があるが、上記のように「逐次的に」復号化することにより、大きなRAM203を用意する必要はない。  The processing from S1004 to S1008 is executed for all the encoded Reference elements. In order to obtain the hash value for the Object element, it is necessary to decode all the Reference elements, but it is not necessary to prepare a
  全てのReference要素のハッシュ生成部への入力が終わると、以降のObject、つまり617から626までを正規化して入力する(1009)。さらに生成されたハッシュ値を取得し、ハッシュ保持部305に保持されているハッシュ値を更新することにより、Object要素全体のハッシュ値を生成する(1010)。このハッシュ値は611のDigestValue要素内に格納される。これで図10の処理、すなわちS407は完了である。  When the input to the hash generation unit of all the Reference elements is completed, the subsequent objects, that is, 617 to 626 are normalized and input (1009). Furthermore, the generated hash value is acquired, and the hash value held in the
  SignedInfo要素が完成すると次に署名値の生成を行う(S408)。署名値は前述のとおりSignedInfo要素のハッシュ値を暗号化処理したものである。署名値は614のSignatureValue要素内に格納される。このときのハッシュ生成アルゴリズムと暗号化アルゴリズムはSignatureMethod要素605に記述されており、SHA1とRSAである。  When the SignedInfo element is completed, a signature value is generated (S408). As described above, the signature value is obtained by encrypting the hash value of the SignedInfo element. The signature value is stored in a 614 SignatureValue element. The hash generation algorithm and the encryption algorithm at this time are described in the
  最後に電子署名送信を行う。この段階で署名文書の601から616までは完成された状態であり、このまま送信する(S409)。次に、符号化Reference要素保持部306から1エントリずつ読み出し、復号化して送信する(S410)。この復号化は先ほどの方法と同じである。また、退避モードがtrueでないときは当然RAM203上にあるReference要素をそのまま送信する。最後に617から627を送信し(S411)、処理は終了である。退避モードがtrueでないときは、符号化・復号化の処理がないため、計算処理は早くなる。  Finally, electronic signature transmission is performed. At this stage,
  以上の処理でRAM203上に置かれるのは、Manifest要素内のReference要素が省かれたSignature要素(図6)、n個以下のReference要素、その他いくつかの少量データのみである。  With the above processing, only the Signature element (FIG. 6) from which the Reference element in the Manifest element is omitted, n or less Reference elements, and some other small amount of data are placed on the
なお、本実施例では図6および図11のようにXML文書そのものの形式で保持していたが、別のツリー形式で持つことも可能である。このようなツリー構造には例えばDOM(Document Object Model)がある。 In this embodiment, the XML document itself is held as shown in FIGS. 6 and 11, but may be held in another tree format. An example of such a tree structure is DOM (Document Object Model).
また、本実施例ではメモリ上のReference要素のカウント数nの閾値を例として100としたが、この所定数を減らすことでさらにメモリ使用量を削減することができる。閾値を1とすれば、メモリ上に置かれるReference要素を1つのみにして署名文書を作成することができる。このような処理を行うことで、計算資源の少ない機器においても大きな電子文書に対する電子署名の付与が可能となる。 In this embodiment, the threshold value of the reference element count number n in the memory is set to 100 as an example. However, the memory usage can be further reduced by reducing the predetermined number. If the threshold is 1, a signed document can be created with only one Reference element placed on the memory. By performing such processing, it is possible to attach an electronic signature to a large electronic document even on a device with few computing resources.
  (その他の実施例)
  また、本発明は、以下の処理を実行することによっても実現される。即ち、上述した実施形態の機能を実現するソフトウェア(プログラム)を、ネットワーク又は各種記憶媒体を介してシステム或いは装置に供給し、そのシステム或いは装置のコンピュータ(またはCPUやMPU等)がプログラムを読み出して実行する処理である。(Other examples)
 The present invention can also be realized by executing the following processing. That is, software (program) that realizes the functions of the above-described embodiments is supplied to a system or apparatus via a network or various storage media, and a computer (or CPU, MPU, or the like) of the system or apparatus reads the program. It is a process to be executed.
| Application Number | Priority Date | Filing Date | Title | 
|---|---|---|---|
| JP2009202682AJP5511270B2 (en) | 2009-09-02 | 2009-09-02 | Information processing apparatus and information processing method | 
| Application Number | Priority Date | Filing Date | Title | 
|---|---|---|---|
| JP2009202682AJP5511270B2 (en) | 2009-09-02 | 2009-09-02 | Information processing apparatus and information processing method | 
| Publication Number | Publication Date | 
|---|---|
| JP2011055269A JP2011055269A (en) | 2011-03-17 | 
| JP5511270B2true JP5511270B2 (en) | 2014-06-04 | 
| Application Number | Title | Priority Date | Filing Date | 
|---|---|---|---|
| JP2009202682AActiveJP5511270B2 (en) | 2009-09-02 | 2009-09-02 | Information processing apparatus and information processing method | 
| Country | Link | 
|---|---|
| JP (1) | JP5511270B2 (en) | 
| Publication number | Priority date | Publication date | Assignee | Title | 
|---|---|---|---|---|
| KR101311287B1 (en)* | 2012-02-21 | 2013-09-25 | 주식회사 파수닷컴 | Apparatus and method for generating e-book, and apparatus and method for verifying e-book integrity | 
| JP7445135B2 (en) | 2020-08-27 | 2024-03-07 | 富士通株式会社 | Communication program, communication device, communication method, and communication system | 
| Publication number | Priority date | Publication date | Assignee | Title | 
|---|---|---|---|---|
| JP4578119B2 (en)* | 2004-02-23 | 2010-11-10 | 大日本印刷株式会社 | Information processing apparatus and security ensuring method in information processing apparatus | 
| JP5046984B2 (en)* | 2008-02-04 | 2012-10-10 | キヤノン株式会社 | Information processing apparatus, information processing method, and program | 
| Publication number | Publication date | 
|---|---|
| JP2011055269A (en) | 2011-03-17 | 
| Publication | Publication Date | Title | 
|---|---|---|
| JP4993674B2 (en) | Information processing apparatus, verification processing apparatus, control method thereof, computer program, and storage medium | |
| US7706568B2 (en) | Information processing apparatus, information processing method, and computer readable storage medium | |
| US7552335B2 (en) | Information processing apparatus, method therefor, computer program, and computer-readable storage medium | |
| US8621222B1 (en) | Archiving electronic content having digital signatures | |
| US20060117183A1 (en) | Digital image data authenticity assuring method, and digital image data disclosure system | |
| US20100246962A1 (en) | Information processing system, information processing method, image processing apparatus, program, and recording medium | |
| US8108906B2 (en) | Electronic data authenticity assurance method and program | |
| US7849308B2 (en) | Data generating device and control method thereof, data analyzing device and control method thereof, data processing system, program and machine-readable storage medium | |
| JP2004310386A (en) | Image verification device, image verification method, computer program, and computer-readable recording medium | |
| JP4865282B2 (en) | Image processing apparatus control method, image processing apparatus, program code, and storage medium | |
| JP5108285B2 (en) | Signature method, information processing apparatus, and signature program | |
| CN100334518C (en) | Document digital nano signing and method of reatizing electron seal and hand writing name signing | |
| US20250007720A1 (en) | An apparatus, computer program and method | |
| JP5511270B2 (en) | Information processing apparatus and information processing method | |
| US8725776B2 (en) | Digests to identify elements in a signature process | |
| CN108563396B (en) | Safe cloud object storage method | |
| Boyar et al. | Quotable signatures for authenticating shared quotes | |
| CN114547562B (en) | Method and device for adding and applying text watermark | |
| US11671243B2 (en) | Apparatus, computer program and method | |
| KR100773854B1 (en) | Information processing apparatus, information processing method, and computer readable storage medium | |
| JP2004184516A (en) | Digital data transmission terminal | |
| JP3814618B2 (en) | Text processing apparatus and control method | |
| JP2002108851A (en) | Sentence processor, method therefor and storage medium | 
| Date | Code | Title | Description | 
|---|---|---|---|
| A621 | Written request for application examination | Free format text:JAPANESE INTERMEDIATE CODE: A621 Effective date:20120823 | |
| A131 | Notification of reasons for refusal | Free format text:JAPANESE INTERMEDIATE CODE: A131 Effective date:20131001 | |
| A521 | Written amendment | Free format text:JAPANESE INTERMEDIATE CODE: A523 Effective date:20131202 | |
| 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:20140225 | |
| A61 | First payment of annual fees (during grant procedure) | Free format text:JAPANESE INTERMEDIATE CODE: A61 Effective date:20140325 | |
| R151 | Written notification of patent or utility model registration | Ref document number:5511270 Country of ref document:JP Free format text:JAPANESE INTERMEDIATE CODE: R151 |