JavaTM 2 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 2 Platform
Standard Ed. 6

提交錯誤或意見

版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。