JavaTM Platform
Standard Ed. 6

javax.xml.crypto.dsig.keyinfo
インタフェース KeyValue

すべてのスーパーインタフェース:
XMLStructure

public interface KeyValue
extends XMLStructure

W3C Recommendation for XML-Signature Syntax and Processing」で定義されている XML KeyValue 要素の表現。KeyValue オブジェクトには、署名の検証に便利な単一の公開鍵が格納されます。XML スキーマ定義は、次のように定義されます。

    <element name="KeyValue" type="ds:KeyValueType"/>
    <complexType name="KeyValueType" mixed="true">
      <choice>
        <element ref="ds:DSAKeyValue"/>
        <element ref="ds:RSAKeyValue"/>
        <any namespace="##other" processContents="lax"/>
      </choice>
    </complexType>

    <element name="DSAKeyValue" type="ds:DSAKeyValueType"/>
    <complexType name="DSAKeyValueType">
      <sequence>
        <sequence minOccurs="0">
          <element name="P" type="ds:CryptoBinary"/>
          <element name="Q" type="ds:CryptoBinary"/>
        </sequence>
        <element name="G" type="ds:CryptoBinary" minOccurs="0"/> 
        <element name="Y" type="ds:CryptoBinary"/> 
        <element name="J" type="ds:CryptoBinary" minOccurs="0"/>
        <sequence minOccurs="0">
          <element name="Seed" type="ds:CryptoBinary"/> 
          <element name="PgenCounter" type="ds:CryptoBinary"/> 
        </sequence>
      </sequence>
    </complexType>

    <element name="RSAKeyValue" type="ds:RSAKeyValueType"/>
    <complexType name="RSAKeyValueType">
      <sequence>
        <element name="Modulus" type="ds:CryptoBinary"/> 
        <element name="Exponent" type="ds:CryptoBinary"/>
      </sequence>
    </complexType>
 
KeyValue インスタンスは、KeyInfoFactory クラスの newKeyValue メソッドを呼び出し、公開鍵の値を表現する PublicKey に渡すことによって作成されます。次に、KeyStore 内に格納される CertificateDSAPublicKey から KeyValue を作成する例を示します。
 KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
 PublicKey dsaPublicKey = keyStore.getCertificate("myDSASigningCert").getPublicKey();
 KeyInfoFactory factory = KeyInfoFactory.getInstance("DOM");
 KeyValue keyValue = factory.newKeyValue(dsaPublicKey);
 
このクラスは、型 DSAPublicKey および RSAPublicKey のオブジェクトとして、それぞれ DSAKeyValue および RSAKeyValue を返します。スキーマ内のすべてのフィールドが、これらの型のパラメータとしてアクセス可能であるわけではありません。

導入されたバージョン:
1.6
関連項目:
KeyInfoFactory.newKeyValue(PublicKey)

フィールドの概要
static String DSA_TYPE
          DSA KeyValue KeyInfo 型を識別する URI: http://www.w3.org/2000/09/xmldsig#DSAKeyValue。
static String RSA_TYPE
          RSA KeyValue KeyInfo 型を識別する URI: http://www.w3.org/2000/09/xmldsig#RSAKeyValue。
 
メソッドの概要
 PublicKey getPublicKey()
          この KeyValue の公開鍵を返します。
 
インタフェース javax.xml.crypto.XMLStructure から継承されたメソッド
isFeatureSupported
 

フィールドの詳細

DSA_TYPE

static final String DSA_TYPE
DSA KeyValue KeyInfo 型を識別する URI: http://www.w3.org/2000/09/xmldsig#DSAKeyValue。これは、RetrievalMethod クラスの type パラメータの値として指定して、リモートの DSAKeyValue 構造を記述できます。

関連項目:
定数フィールド値

RSA_TYPE

static final String RSA_TYPE
RSA KeyValue KeyInfo 型を識別する URI: http://www.w3.org/2000/09/xmldsig#RSAKeyValue。これは、RetrievalMethod クラスの type パラメータの値として指定して、リモートの RSAKeyValue 構造を記述できます。

関連項目:
定数フィールド値
メソッドの詳細

getPublicKey

PublicKey getPublicKey()
                       throws KeyException
この KeyValue の公開鍵を返します。

戻り値:
この KeyValue の公開鍵
例外:
KeyException - KeyValuePublicKey に変換できない場合

JavaTM Platform
Standard Ed. 6

バグの報告と機能のリクエスト
さらに詳しい API リファレンスおよび開発者ドキュメントについては、Java SE 開発者用ドキュメントを参照してください。開発者向けの詳細な解説、概念の概要、用語の定義、バグの回避策、およびコード実例が含まれています。

Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Documentation Redistribution Policy も参照してください。