JavaTM Platform
Standard Ed. 6

javax.xml.crypto.dsig.keyinfo
接口 RetrievalMethod

所有超级接口:
URIReference, XMLStructure

public interface RetrievalMethod
extends URIReference, XMLStructure

W3C Recommendation for XML-Signature Syntax and Processing 中定义的 XML RetrievalMethod 元素的表示形式。RetrievalMethod 对象用于传送对存储在另一个位置上的 KeyInfo 信息的引用。XML Schema Definition 的定义如下:

   <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
另请参见:
KeyInfoFactory.newRetrievalMethod(String), KeyInfoFactory.newRetrievalMethod(String, String, List)

方法摘要
 Data dereference(XMLCryptoContext context)
          取消引用此 RetrievalMethod 引用的 KeyInfo 信息,并应用指定的 Transform。
 List getTransforms()
          返回一个不可修改的列表,由此 RetrievalMethod 的 Transform 组成。
 String getURI()
          返回已引用的 KeyInfo 信息的 URI。
 
从接口 javax.xml.crypto.URIReference 继承的方法
getType
 
从接口 javax.xml.crypto.XMLStructure 继承的方法
isFeatureSupported
 

方法详细信息

getTransforms

List getTransforms()
返回一个不可修改的列表,由此 RetrievalMethod 的 Transform 组成。

返回:
不可修改的 Transform 对象列表(可以为空,但不能为 null)。

getURI

String getURI()
返回已引用的 KeyInfo 信息的 URI。

指定者:
接口 URIReference 中的 getURI
返回:
已引用 KeyInfo 信息(RFC 2396 格式)的 URI(不能为 null)

dereference

Data dereference(XMLCryptoContext context)
                 throws URIReferenceException
取消引用此 RetrievalMethod 引用的 KeyInfo 信息,并应用指定的 Transform。

参数:
context - XMLCryptoContext,包含用来取消引用 URI 的其他有用信息。上下文的 baseURI 和 dereferencer 参数(如果已指定)用于解析和取消引用此 RetrievalMethod
返回:
表示此 RetrievalMethod 引用的 KeyInfo 信息的原始内容的 Data 对象。调用者负责将返回的数据转换成适当的 KeyInfo 对象。
抛出:
NullPointerException - 如果 context 为 null
URIReferenceException - 如果在取消引用时发生错误

JavaTM Platform
Standard Ed. 6

提交错误或意见
有关更多的 API 参考资料和开发人员文档,请参阅 Java SE 开发人员文档。该文档包含更详细的、面向开发人员的描述,以及总体概述、术语定义、使用技巧和工作代码示例。

版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。