|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
public interface KeyInfo
W3C Recommendation for XML-Signature Syntax and Processing 中定義的 XML KeyInfo 元素的表示形式。KeyInfo 套件含 XMLStructure 的列表,其中每一個 XMLStructure 都包含支持接受方獲取驗證 XML 簽章所需的密鑰的資訊。XML Schema Definition 的定義如下:
<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>通過調用
KeyInfoFactory 類別的 newKeyInfo 方法之一,並向其傳遞一個或多個 XMLStructure 列表以及一個可選的 id 參數,可以創建 KeyInfo 實例,例如:
KeyInfoFactory factory = KeyInfoFactory.getInstance("DOM");
KeyInfo keyInfo = factory.newKeyInfo
(Collections.singletonList(factory.newKeyName("Alice"), "keyinfo-1"));
還可以通過調用 marshal 方法將 KeyInfo 物件編組為 XML。
KeyInfoFactory.newKeyInfo(List),
KeyInfoFactory.newKeyInfo(List, String)| 方法摘要 | |
|---|---|
List |
getContent()
返回包含密鑰資訊的 unmodifiable list。 |
String |
getId()
返回此 KeyInfo 的可選 Id 屬性,這對於從其他 XML 結構參考此 KeyInfo 可能很有用。 |
void |
marshal(XMLStructure parent,
XMLCryptoContext context)
將密鑰資訊編組為 XML。 |
| 從介面 javax.xml.crypto.XMLStructure 繼承的方法 |
|---|
isFeatureSupported |
| 方法詳細資訊 |
|---|
List getContent()
unmodifiable list。列表中的每一項都是一個 XMLStructure。
如果有一個表示 XMLStructure 型別的公共子類別,那麼它將作為該類別的實例返回(比如:X509Data 元素將作為 X509Data 的實例返回)。
KeyInfo 中的一個或多個 XMLStructure 的不可修改列表。不會返回 null 或空列表。String getId()
KeyInfo 的可選 Id 屬性,這對於從其他 XML 結構參考此 KeyInfo 可能很有用。
KeyInfo 的 Id 屬性(如果未指定,則返回 null)
void marshal(XMLStructure parent,
XMLCryptoContext context)
throws MarshalException
parent - 特定於機制的結構,包含將追加已編組密鑰資訊中的父節點context - 套件含其他上下文的 XMLCryptoContext(如果不適用,則為 null)
ClassCastException - 如果 parent 或 context 的型別與此密鑰資訊不相容
MarshalException - 如果無法編組密鑰資訊
NullPointerException - 如果 parent 為 null
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。