-  
       
- All Superinterfaces:
 -  
         
URIReference,XMLStructure 
public interface Reference extends URIReference, XMLStructure
在Reference中定义的Reference元素的表示 。 XML模式定义为:<element name="Reference" type="ds:ReferenceType"/> <complexType name="ReferenceType"> <sequence> <element ref="ds:Transforms" minOccurs="0"/> <element ref="ds:DigestMethod"/> <element ref="ds:DigestValue"/> </sequence> <attribute name="Id" type="ID" use="optional"/> <attribute name="URI" type="anyURI" use="optional"/> <attribute name="Type" type="anyURI" use="optional"/> </complexType> <element name="DigestValue" type="ds:DigestValueType"/> <simpleType name="DigestValueType"> <restriction base="base64Binary"/> </simpleType>可以通过调用
XMLSignatureFactory类的newReference方法之一来创建一个Reference实例; 例如:XMLSignatureFactory factory = XMLSignatureFactory.getInstance("DOM"); Reference ref = factory.newReference ("http://www.ietf.org/rfc/rfc3275.txt", factory.newDigestMethod(DigestMethod.SHA1, null)); 
-  
        
       
-  
             
方法摘要
所有方法 接口方法 抽象方法 Modifier and Type 方法 描述 byte[]getCalculatedDigestValue()在验证操作后返回此Reference的计算摘要值。DatagetDereferencedData()如果启用了 reference caching ,则返回取消引用的数据。InputStreamgetDigestInputStream()如果启用了 reference caching ,则返回预消化的输入流。DigestMethodgetDigestMethod()返回此Reference的摘要方法。byte[]getDigestValue()返回此Reference的摘要值。StringgetId()返回此Reference的可选Id属性,该属性允许从其他地方引用该引用。List<Transform>getTransforms()返回一个unmodifiable list的Transform包含在这个SReference。booleanvalidate(XMLValidateContext validateContext)验证此引用。-  
               
Methods inherited from interface javax.xml.crypto.URIReference
getType, getURI 
-  
               
Methods inherited from interface javax.xml.crypto.XMLStructure
isFeatureSupported 
 -  
               
 
 -  
             
 
-  
        
       
-  
             
方法详细信息
-  
getTransforms
List<Transform> getTransforms()
返回一个unmodifiable list的Transform包含在这个SReference。- 结果
 - 
               一个不可修改的列表 
              
Transforms(可能是空的,但从不null) 
 
-  
getDigestMethod
DigestMethod getDigestMethod()
返回此Reference的摘要方法。- 结果
 - 摘要方法
 
 
-  
getId
String getId()
返回此Reference的可选Id属性,该属性允许从其他地方引用此引用。- 结果
 -  
              
Id属性(如果没有指定可能是null) 
 
-  
getDigestValue
byte[] getDigestValue()
返回此Reference的摘要值。- 结果
 -  
              原始摘要值,或
null如果此引用尚未消化。 此方法的每次调用都将返回一个新的克隆以防止后续修改。 
 
-  
getCalculatedDigestValue
byte[] getCalculatedDigestValue()
在验证操作后返回此Reference的计算摘要值。 如果引用无法验证,此方法对于调试非常有用。- 结果
 -  
              计算的摘要值,如果此引用尚未被验证, 
null。 此方法的每次调用都将返回一个新的克隆以防止后续修改。 
 
-  
validate
boolean validate(XMLValidateContext validateContext) throws XMLSignatureException
验证此引用。 此方法验证此引用的摘要。此方法仅在第一次调用时验证引用。 在随后的调用中,它返回缓存的结果。
- 参数
 -  
              
validateContext- 验证上下文 - 结果
 -  
              
true如果此引用成功验证; 否则为false - 异常
 -  
              
NullPointerException- 如果validateContext是null -  
              
XMLSignatureException- 如果在验证引用时发生意外异常 
 
-  
getDereferencedData
Data getDereferencedData()
如果启用了reference caching ,则返回取消引用的数据。 这是在验证或生成操作期间取消引用此引用的URI的结果。- 结果
 - 
               取消引用的数据,或 
              
null如果引用缓存未启用或该引用尚未生成或验证 
 
-  
getDigestInputStream
InputStream getDigestInputStream()
如果启用了reference caching ,则返回预消化的输入流。 这是验证或签名操作期间摘要操作的输入。- 结果
 - 
               an input stream containing the pre-digested input, or 
              
nullif reference caching is not enabled or this reference has not been generated or validated 
 
 -  
 
 -