- 所有超级接口:
-
URIReference,XMLStructure
表示XML中
RetrievalMethod元素的表示形式,如W3C关于XML签名语法和处理的推荐标准中定义。 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方法之一,并传递标识KeyInfo位置的URI,标识KeyInfo类型的可选URI,以及可选的Transform列表来创建RetrievalMethod实例;例如:
KeyInfoFactory factory = KeyInfoFactory.getInstance("DOM");
RetrievalMethod rm = factory.newRetrievalMethod
("#KeyValue-1", KeyValue.DSA_TYPE, Collections.singletonList(Transform.BASE64));
- 自版本:
- 1.6
- 参见:
-
Method Summary
Modifier and TypeMethodDescriptiondereference(XMLCryptoContext context) 解引用由此RetrievalMethod引用的KeyInfo信息,并应用指定的Transform。getURI()返回引用的KeyInfo信息的URI。Methods declared in interface javax.xml.crypto.URIReference
getTypeMethods declared in interface javax.xml.crypto.XMLStructure
isFeatureSupported
-
Method Details
-
getTransforms
- 返回:
-
Transform对象的不可修改列表(可能为空,但绝不为null)。
-
getURI
String getURI()返回引用的KeyInfo信息的URI。- 指定者:
-
getURI在接口URIReference - 返回:
-
引用的
KeyInfo信息的URI,采用RFC 2396格式(绝不为null)
-
dereference
解引用由此RetrievalMethod引用的KeyInfo信息,并应用指定的Transform。- 参数:
-
context- 可能包含用于解引用URI的附加有用信息的XMLCryptoContext。上下文的baseURI和dereferencer参数(如果指定)用于解析和解引用此RetrievalMethod - 返回:
-
代表由此
RetrievalMethod引用的KeyInfo信息的原始内容的Data对象。调用者有责任将返回的数据转换为适当的KeyInfo对象。 - 抛出:
-
NullPointerException- 如果context为null -
URIReferenceException- 如果解引用时出现错误
-