|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
public interface KeyValue
「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 内に格納される 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 の公開鍵を返します。 |
| インタフェース javax.xml.crypto.XMLStructure から継承されたメソッド |
|---|
isFeatureSupported |
| フィールドの詳細 |
|---|
static final String DSA_TYPE
RetrievalMethod クラスの type パラメータの値として指定して、リモートの DSAKeyValue 構造を記述できます。
static final String RSA_TYPE
RetrievalMethod クラスの type パラメータの値として指定して、リモートの RSAKeyValue 構造を記述できます。
| メソッドの詳細 |
|---|
PublicKey getPublicKey()
throws KeyException
KeyValue の公開鍵を返します。
KeyValue の公開鍵
KeyException - この KeyValue を PublicKey に変換できない場合
|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
Copyright 2009 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Documentation Redistribution Policy も参照してください。