XML Security, 1.6

com.ibm.xml.crypto.dsig.dom
Class ReferenceImpl

java.lang.Object
  extended by com.ibm.xml.crypto.dsig.dom.XMLStructureImpl
      extended by com.ibm.xml.crypto.dsig.dom.URIReferenceImpl
          extended by com.ibm.xml.crypto.dsig.dom.ReferenceImpl
All Implemented Interfaces:
DOMURIReference, Reference, URIReference, XMLStructure

 class ReferenceImpl
extends URIReferenceImpl
implements Reference


Field Summary
(package private) static java.lang.String PROP_CACHEREFERENCE
           
(package private)  java.util.List transforms
           
 
Fields inherited from class com.ibm.xml.crypto.dsig.dom.URIReferenceImpl
signatureNode
 
Fields inherited from class com.ibm.xml.crypto.dsig.dom.XMLStructureImpl
afactory
 
Constructor Summary
ReferenceImpl(AlgorithmFactory f, java.lang.String uri, DigestMethod dm, java.util.List applied, Data result, java.util.List transforms, java.lang.String type, java.lang.String id, byte[] digestValue)
           
 
Method Summary
 byte[] getCalculatedDigestValue()
          Returns the calculated digest value of this Reference after a validation operation.
 Data getDereferencedData()
          Returns the dereferenced data, if reference caching is enabled.
 java.io.InputStream getDigestInputStream()
          Returns the pre-digested input stream, if reference caching is enabled.
 DigestMethod getDigestMethod()
          Returns the digest method of this Reference.
 byte[] getDigestValue()
          Return the DigestValue in a tree.
 java.lang.String getId()
          Returns the optional Id attribute of this Reference, which permits this reference to be referenced from elsewhere.
 java.util.List getTransforms()
          Returns an unmodifiable list of Transforms that are contained in this Reference.
(package private)  void setDigestValue(byte[] value)
          Called in sign() or in unmarshall().
(package private)  void setDigestValueNode(org.w3c.dom.Node node)
          Called by Marshalling.
(package private)  void sign(XMLSignContext scontext)
          Called by XMLSignatureImpl.sign()
 boolean validate(XMLValidateContext vcontext)
          Validates this reference.
 
Methods inherited from class com.ibm.xml.crypto.dsig.dom.URIReferenceImpl
getFactory, getHere, getType, getURI, setHere, setSignatureNode
 
Methods inherited from class com.ibm.xml.crypto.dsig.dom.XMLStructureImpl
isFeatureSupported
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.xml.crypto.URIReference
getType, getURI
 
Methods inherited from interface javax.xml.crypto.XMLStructure
isFeatureSupported
 

Field Detail

PROP_CACHEREFERENCE

static java.lang.String PROP_CACHEREFERENCE

transforms

java.util.List transforms
Constructor Detail

ReferenceImpl

ReferenceImpl(AlgorithmFactory f,
              java.lang.String uri,
              DigestMethod dm,
              java.util.List applied,
              Data result,
              java.util.List transforms,
              java.lang.String type,
              java.lang.String id,
              byte[] digestValue)
Method Detail

getDigestMethod

public DigestMethod getDigestMethod()
Description copied from interface: Reference
Returns the digest method of this Reference.

Specified by:
getDigestMethod in interface Reference
Returns:
the digest method

getId

public java.lang.String getId()
Description copied from interface: Reference
Returns the optional Id attribute of this Reference, which permits this reference to be referenced from elsewhere.

Specified by:
getId in interface Reference
Returns:
the Id attribute (may be null if not specified)

getTransforms

public java.util.List getTransforms()
Description copied from interface: Reference
Returns an unmodifiable list of Transforms that are contained in this Reference.

Specified by:
getTransforms in interface Reference
Returns:
an unmodifiable list of Transforms (may be empty but never null)

setDigestValue

void setDigestValue(byte[] value)
Called in sign() or in unmarshall().

Parameters:
d - may be null
dinput - may be null

setDigestValueNode

void setDigestValueNode(org.w3c.dom.Node node)
Called by Marshalling.


getDigestValue

public byte[] getDigestValue()
Return the DigestValue in a tree.

Specified by:
getDigestValue in interface Reference
Returns:
the raw digest value, or null if this reference has not been digested yet. Each invocation of this method returns a new clone to protect against subsequent modification.

getCalculatedDigestValue

public byte[] getCalculatedDigestValue()
Description copied from interface: Reference
Returns the calculated digest value of this Reference after a validation operation. This method is useful for debugging if the reference fails to validate.

Specified by:
getCalculatedDigestValue in interface Reference
Returns:
the calculated digest value, or null if this reference has not been validated yet. Each invocation of this method returns a new clone to protect against subsequent modification.

getDereferencedData

public Data getDereferencedData()
Description copied from interface: Reference
Returns the dereferenced data, if reference caching is enabled. This is the result of dereferencing the URI of this reference during a validation or generation operation.

Specified by:
getDereferencedData in interface Reference
Returns:
the dereferenced data, or null if reference caching is not enabled or this reference has not been generated or validated

getDigestInputStream

public java.io.InputStream getDigestInputStream()
Description copied from interface: Reference
Returns the pre-digested input stream, if reference caching is enabled. This is the input to the digest operation during a validation or signing operation.

Specified by:
getDigestInputStream in interface Reference
Returns:
an input stream containing the pre-digested input, or null if reference caching is not enabled or this reference has not been generated or validated

sign

void sign(XMLSignContext scontext)
    throws XMLSignatureException
Called by XMLSignatureImpl.sign()

Throws:
XMLSignatureException

validate

public boolean validate(XMLValidateContext vcontext)
                 throws XMLSignatureException
Description copied from interface: Reference
Validates this reference. This method verifies the digest of this reference.

This method only validates the reference the first time it is invoked. On subsequent invocations, it returns a cached result.

Specified by:
validate in interface Reference
Parameters:
vcontext - the validating context
Returns:
true if this reference was validated successfully; false otherwise
Throws:
XMLSignatureException - if an unexpected exception occurs while validating the reference

XML Security, 1.6

Portions Copyright 2003, 2012 IBM Corporation.
Portions Copyright 2003, 2012 Oracle and/or its affiliates.