- 所有父级接口:
URIReference,XMLStructure
W3C 对 XML 签名语法和处理的推荐 中定义的 XML
RetrievalMethod 元素的表示。 RetrievalMethod 对象用于传达对存储在另一个位置的 KeyInfo 信息的引用。 XML 模式定义定义为:
<element name="RetrievalMethod" type="ds:RetrievalMethodType"/>
<complexType name="RetrievalMethodType">
<sequence>
<element name="Transforms" type="ds:TransformsType" minOccurs="0"/>
</sequence>
<attribute name="URI" type="anyURI"/>
<attribute name="Type" type="anyURI" use="optional"/>
</complexType>
可以通过调用 KeyInfoFactory 类的 newRetrievalMethod 方法之一创建 RetrievalMethod 实例,并将标识 KeyInfo 位置的 URI 传递给它,标识 KeyInfo 类型的可选类型 URI,以及Transform 的可选列表;例如:
KeyInfoFactory factory = KeyInfoFactory.getInstance("DOM");
RetrievalMethod rm = factory.newRetrievalMethod
("#KeyValue-1", KeyValue.DSA_TYPE, Collections.singletonList(Transform.BASE64));
- 自从:
- 1.6
- 参见:
-
方法总结
修饰符和类型方法描述dereference(XMLCryptoContext context) 取消引用此RetrievalMethod引用的KeyInfo信息并应用指定的Transforms。getURI()返回引用的KeyInfo信息的 URI。在接口 javax.xml.crypto.URIReference 中声明的方法
getType在接口 javax.xml.crypto.XMLStructure 中声明的方法
isFeatureSupported
-
方法详情
-
getTransforms
- 返回:
-
不可修改的
Transform对象列表(可能为空但绝不为null)。
-
getURI
String getURI()返回引用的KeyInfo信息的 URI。- 指定者:
getURI在接口URIReference中- 返回:
-
RFC 2396 格式的引用
KeyInfo信息的 URI(从不null)
-
dereference
取消引用此RetrievalMethod引用的KeyInfo信息并应用指定的Transforms。- 参数:
context- 一个XMLCryptoContext可能包含用于取消引用 URI 的其他有用信息。上下文的baseURI和dereferencer参数(如果指定)用于解析和取消引用此RetrievalMethod- 返回:
-
一个
Data对象,表示此RetrievalMethod引用的KeyInfo信息的原始内容。调用者负责将返回的数据转换为适当的KeyInfo对象。 - 抛出:
NullPointerException- 如果context是nullURIReferenceException- 如果取消引用时出现错误
-