public interface KeyInfo extends XMLStructure
KeyInfo元素的表示 。
甲KeyInfo包含的列表XMLStructure个 S,其中的每一个包含能够使接收者(一个或多个),以获得验证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>
可以通过调用KeyInfoFactory类的newKeyInfo方法之一并传递一个或多个XMLStructure和可选的id参数的列表来创建KeyInfo实例。
例如:
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)
| Modifier and Type | Method and Description |
|---|---|
List |
getContent()
返回一个
unmodifiable list包含关键信息。
|
String |
getId()
返回此
KeyInfo的可选Id属性,这对于从其他XML结构引用此
KeyInfo可能很有用。
|
void |
marshal(XMLStructure parent, XMLCryptoContext context)
将关键信息传达给XML。
|
isFeatureSupportedList getContent()
unmodifiable list包含关键信息。
列表的每个条目都是XMLStructure 。
如果有一个表示类型为XMLStructure的公共子类,则作为该类的实例返回(例如: X509Data元素将作为X509Data的实例返回)。
XMLStructure S IN此KeyInfo 。
永远不会返回null或空列表。
String getId()
KeyInfo的可选Id属性,这对于从其他XML结构引用此
KeyInfo可能很有用。
KeyInfo (可以是
null如果未指定)
void marshal(XMLStructure parent, XMLCryptoContext context) throws MarshalException
parent - 一个机制特定的结构,包含编组的密钥信息将被附加到的父节点
context - 包含附加上下文的
XMLCryptoContext (如果不适用,可以为null)
ClassCastException - 如果
parent或
context的类型与此关键信息不兼容
MarshalException - 如果密钥信息无法编组
NullPointerException - 如果
parent是
null
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.