public interface KeyInfo extends XMLStructure
KeyInfo 要素の表現。KeyInfo には、XMLStructure のリストが含まれています。それぞれの XMLStructure には、XML 署名を検証するために必要な鍵を受信者が取得できるようにする情報が格納されています。XML スキーマ定義は、次のように定義されます。
<element name="KeyInfo" type="ds:KeyInfoType"/>
<complexType name="KeyInfoType" mixed="true">
<choice maxOccurs="unbounded">
<element ref="ds:KeyName"/>
<element ref="ds:KeyValue"/>
<element ref="ds:RetrievalMethod"/>
<element ref="ds:X509Data"/>
<element ref="ds:PGPData"/>
<element ref="ds:SPKIData"/>
<element ref="ds:MgmtData"/>
<any processContents="lax" namespace="##other"/>
<!-- (1,1) elements from (0,unbounded) namespaces -->
</choice>
<attribute name="Id" type="ID" use="optional"/>
</complexType>
KeyInfo インスタンスは、KeyInfoFactory クラスの newKeyInfo メソッドの 1 つを呼び出し、それに 1 つ以上の XMLStructure およびオプションの id パラメータのリストを渡すことによって作成されます。次に例を示します。
KeyInfoFactory factory = KeyInfoFactory.getInstance("DOM");
KeyInfo keyInfo = factory.newKeyInfo
(Collections.singletonList(factory.newKeyName("Alice"), "keyinfo-1"));
KeyInfo オブジェクトは、marshal メソッドを呼び出すことによっても XML に整列化できます。
KeyInfoFactory.newKeyInfo(List), KeyInfoFactory.newKeyInfo(List, String)| 修飾子と型 | メソッドと説明 |
|---|---|
List |
getContent()
鍵情報を格納する
unmodifiable list を返します。 |
String |
getId()
この
KeyInfo のオプションの id 属性を返します。KeyInfo をほかの XML 構造から参照する場合に有用です。 |
void |
marshal(XMLStructure parent, XMLCryptoContext context)
鍵情報を XML に整列化します。
|
isFeatureSupportedList getContent()
unmodifiable list を返します。リストのそれぞれのエントリは XMLStructure です。
XMLStructure の型を表現する public サブクラスがある場合、そのクラスのインスタンスとして返されます。たとえば、X509Data 要素は X509Data のインスタンスとして返されます。
KeyInfo 内の 1 つ以上の XMLStructure の変更不可能なリスト。null または空のリストが返されることはない。String getId()
KeyInfo のオプションの id 属性を返します。KeyInfo をほかの XML 構造から参照する場合に有用です。KeyInfo の id 属性。指定されていない場合は null になることもあるvoid marshal(XMLStructure parent, XMLCryptoContext context) throws MarshalException
parent - 整列化された鍵情報が追加される親ノードを格納する、メカニズム固有の構造context - 追加のコンテキストを格納する XMLCryptoContext。該当しない場合は null も可ClassCastException - parent または context の型がこの鍵情報と互換性がない場合MarshalException - 鍵情報を整列化できない場合NullPointerException - parent が null である場合 バグまたは機能を送信
詳細な API リファレンスおよび開発者ドキュメントについては、Java SE のドキュメントを参照してください。そのドキュメントには、概念的な概要、用語の定義、回避方法、有効なコード例などの、開発者を対象にしたより詳細な説明が含まれています。
Copyright © 1993, 2013, Oracle and/or its affiliates. All rights reserved.