public interface KeyInfo extends XMLStructure
KeyInfo元在
W3C Recommendation for XML-Signature Syntax and Processing定义。一个
KeyInfo包含一个列表的
XMLStructures,其中包含的信息,使接收者(S)获得需要验证的XML签名的密钥。XML架构定义的定义是:
<元名称=“keyinfo”type=“ds:keyinfotype” />< complexType名称=“keyinfotype混合=“真实”>
<选择maxoccurs =“无界”>
<元ref=“ds:键名” />
<元ref=“ds:keyvalue” />
<元ref=“ds:检索方法” />
<元ref=“ds:x509data” />
<元ref=“ds:pgpdata” />
<元ref=“ds:spkidata” />
<元ref=“ds:mgmtdata” />
<任何processcontents =“宽松”的命名空间="“#" #其他” /><!-(1,1)元素(0,无界)命名空间-->< /选择>
<属性名称=“标识”类型=“可选”=“可选” < 称>属性名称=“标识”类型=“可选”=“可选”>
选择maxoccurs>一
KeyInfo实例可以通过调用一个类的
KeyInfoFactory
newKeyInfo方法创建的,通过一个或多个
XMLStructures和可选的id参数;例如:
keyinfofactory厂= keyinfofactory getInstance(DOM);消息的消息= factory.newkeyinfo(集合。singletonlist(工厂。newkeyname(“爱丽丝”),“keyinfo-1”));
KeyInfo对象也可以调动到XML通过调用marshal方法。
KeyInfoFactory.newKeyInfo(List),
KeyInfoFactory.newKeyInfo(List, String)
| Modifier and Type | Method and Description |
|---|---|
List |
getContent()
返回一个
unmodifiable list包含关键信息。
|
String |
getId()
返回此
KeyInfo可选的id属性,可参照本
KeyInfo从其他XML结构是有用的。
|
void |
marshal(XMLStructure parent, XMLCryptoContext context)
将关键信息以XML。
|
isFeatureSupportedList getContent()
unmodifiable list包含关键信息。每一项的列表是一个
XMLStructure。
如果有代表XMLStructure类型的公共类,它是这个类的一个实例恢复(例如:一个X509Data元素将作为X509Data实例返回)。
KeyInfo一个或一个以上的
XMLStructures一个不可修改的列表。永远不会返回
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如果关键信息无法整理
null
parent
NullPointerException
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.