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, 2014, Oracle and/or its affiliates. All rights reserved.