検索

第374章 XML Security コンポーネント

download PDF

Camel バージョン 2.12 以降で利用可能

この Apache Camel コンポーネントを使用すると、W3C 標準の XML 署名の構文と処理 で説明されているように、または後継 バージョン 1.1 で説明されているように、XML 署名を生成および検証できます。XML 暗号化のサポートについては、XML セキュリティー データ形式 を参照してください。

XML 署名の概要については、こちら を参照してください。コンポーネントの実装は、W3C 標準に対応する Java API である JSR 105 に基づいており、Apache Santuario と JSR 105 の JDK プロバイダーをサポートしています。実装は、最初に Apache Santuario プロバイダーの使用を試みます。Santuario プロバイダーが見つからない場合は、JDK プロバイダーが使用されます。さらに、実装は DOM ベースです。

Camel 2.15.0 以降、署名者エンドポイント用の XAdES-BES/EPES もサポートしています。サブセクション署名者エンドポイントの XAdES-BES/EPES を参照してください。

Maven ユーザーは、このコンポーネントの pom.xml に以下の依存関係を追加する必要があります。

<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-xmlsecurity</artifactId>
    <version>x.x.x</version>
    <!-- use the same version as your Camel core version -->
</dependency>

374.1. XML 署名のラッピングモード

XML 署名は、enveloped、enveloping、detached XML 署名で異なります。enveloped XML 署名の場合、XML 署名は署名済み XML ドキュメントによってラップされます。これは、XML 署名要素が、署名済み XML ドキュメントに属する親要素の子要素であることを意味します。enveloping XML 署名の場合、XML 署名には署名されたコンテンツが含まれます。他のすべてのケースは、detached XML 署名と呼ばれます。2.14.0 以降、特定の形式のdetached XML 署名がサポートされています。

enveloped XML 署名 の場合、サポートされる生成された XML 署名は次の構造を持ちます (変数は [] で囲まれます)。

<[parent element]>
   ... <!-- Signature element is added as last child of the parent element-->
   <Signature Id="generated_unique_signature_id">
       <SignedInfo>
             <Reference URI="">
                   <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
                   (<Transform>)* <!-- By default "http://www.w3.org/2006/12/xml-c14n11" is added to the transforms -->
                   <DigestMethod>
                   <DigestValue>
             </Reference>
             (<Reference URI="#[keyinfo_Id]">
                   <Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
                   <DigestMethod>
                   <DigestValue>
             </Reference>)?
             <!-- further references possible, see option 'properties' below -->
      </SignedInfo>
      <SignatureValue>
      (<KeyInfo Id="[keyinfo_id]">)?
      <!-- Object elements possible, see option 'properties' below -->
  </Signature>
</[parent element]>

enveloping XML 署名 の場合、サポートされている生成された XML 署名の構造は次のとおりです。

<Signature Id="generated_unique_signature_id">
  <SignedInfo>
         <Reference URI="#generated_unique_object_id" type="[optional_type_value]">
               (<Transform>)* <!-- By default "http://www.w3.org/2006/12/xml-c14n11" is added to the transforms -->
               <DigestMethod>
               <DigestValue>
         </Reference>
         (<Reference URI="#[keyinfo_id]">
               <Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
               <DigestMethod>
               <DigestValue>
         </Reference>)?
          <!-- further references possible, see option 'properties' below  -->
  </SignedInfo>
  <SignatureValue>
  (<KeyInfo Id="[keyinfo_id]">)?
  <Object Id="generated_unique_object_id"/> <!-- The Object element contains the in-message body; the object ID can either be generated or set by the option parameter "contentObjectId" -->
  <!-- Further Object elements possible, see option 'properties' below -->
</Signature>

2.14.0 の時点で、次の構造を持つ detached XML 署名 がサポートされています (サブチャプターの署名付き要素のシブリングとしての XML 署名も参照してください)。

(<[signed element] Id="[id_value]">
<!-- signed element must have an attribute of type ID -->
      ...

</[signed element]>
<other sibling/>*
<!-- between the signed element and the corresponding signature element, there can be other siblings.
 Signature element is added as last sibling. -->
<Signature Id="generated_unique_ID">
   <SignedInfo>
      <CanonicalizationMethod>
      <SignatureMethod>
      <Reference URI="#[id_value]" type="[optional_type_value]">
      <!-- reference URI contains the ID attribute value of the signed element -->
            (<Transform>)* <!-- By default "http://www.w3.org/2006/12/xml-c14n11" is added to the transforms -->
            <DigestMethod>
            <DigestValue>
      </Reference>
      (<Reference URI="#[generated_keyinfo_Id]">
            <Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
            <DigestMethod>
            <DigestValue>
      </Reference>)?
   </SignedInfo>
   <SignatureValue>
   (<KeyInfo Id="[generated_keyinfo_id]">)?
</Signature>)+
Red Hat logoGithubRedditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

© 2024 Red Hat, Inc.