接口 RetrievalMethod

所有父级接口:
URIReference , XMLStructure

public interface RetrievalMethod extends 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
参见:
  • 方法详情

    • getTransforms

      List <Transform > getTransforms()
      返回此 RetrievalMethodTransform unmodifiable list
      返回:
      不可修改的 Transform 对象列表(可能为空但绝不为 null )。
    • getURI

      String  getURI()
      返回引用的 KeyInfo 信息的 URI。
      指定者:
      getURI 在接口 URIReference
      返回:
      RFC 2396 格式的引用 KeyInfo 信息的 URI(从不 null
    • dereference

      Data  dereference(XMLCryptoContext  context) throws URIReferenceException
      取消引用此 RetrievalMethod 引用的 KeyInfo 信息并应用指定的 Transform s。
      参数:
      context - 一个 XMLCryptoContext 可能包含用于取消引用 URI 的其他有用信息。上下文的 baseURIdereferencer 参数(如果指定)用于解析和取消引用此 RetrievalMethod
      返回:
      一个 Data 对象,表示此 RetrievalMethod 引用的 KeyInfo 信息的原始内容。调用者负责将返回的数据转换为适当的 KeyInfo 对象。
      抛出:
      NullPointerException - 如果 contextnull
      URIReferenceException - 如果取消引用时出现错误