public interface KeyValue extends XMLStructure
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 内に格納される Certificate の DSAPublicKey から 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 要素を返します。スキーマ内のすべてのフィールドが、これらの型のパラメータとしてアクセス可能であるわけではありません。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 の公開鍵を返します。 |
isFeatureSupportedstatic final String DSA_TYPE
RetrievalMethod クラスの type パラメータの値として指定して、リモートの DSAKeyValue 構造を記述できます。static final String RSA_TYPE
RetrievalMethod クラスの type パラメータの値として指定して、リモートの RSAKeyValue 構造を記述できます。PublicKey getPublicKey() throws KeyException
KeyValue の公開鍵を返します。KeyValue の公開鍵KeyException - この KeyValue を PublicKey に変換できない場合 バグまたは機能を送信
詳細な API リファレンスおよび開発者ドキュメントについては、Java SE のドキュメントを参照してください。そのドキュメントには、概念的な概要、用語の定義、回避方法、有効なコード例などの、開発者を対象にしたより詳細な説明が含まれています。
Copyright © 1993, 2013, Oracle and/or its affiliates. All rights reserved.