org.jcp.xml.dsig.internal.dom
Class DOMReference

java.lang.Object
  extended by org.jcp.xml.dsig.internal.dom.DOMStructure
      extended by org.jcp.xml.dsig.internal.dom.DOMReference
All Implemented Interfaces:
DOMURIReference, Reference, URIReference, XMLStructure

public final class DOMReference
extends DOMStructure
implements Reference, DOMURIReference

Disabled: no SafeJ information.

DOM-based implementation of Reference.


Constructor Summary
DOMReference(org.w3c.dom.Element refElem, XMLCryptoContext context, Provider provider)
          Creates a DOMReference from an element.
DOMReference(String uri, String type, DigestMethod dm, List appliedTransforms, Data result, List transforms, String id, byte[] digestValue, Provider provider)
           
DOMReference(String uri, String type, DigestMethod dm, List appliedTransforms, Data result, List transforms, String id, Provider provider)
           
DOMReference(String uri, String type, DigestMethod dm, List transforms, String id, Provider provider)
          Creates a Reference from the specified parameters.
 
Method Summary
 void digest(XMLSignContext signContext)
           
 boolean equals(Object o)
          Indicates whether some other object is "equal to" this one.
 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.
 InputStream getDigestInputStream()
          Returns the pre-digested input stream, if reference caching is enabled.
 DigestMethod getDigestMethod()
          Returns the digest method of this Reference.
 byte[] getDigestValue()
          Returns the digest value of this Reference.
 org.w3c.dom.Node getHere()
          Returns the here node.
 String getId()
          Returns the optional Id attribute of this Reference, which permits this reference to be referenced from elsewhere.
 List getTransforms()
          Returns an unmodifiable list of Transforms that are contained in this Reference.
 String getType()
          Returns the type of data referenced by this URI.
 String getURI()
          Returns the URI of the referenced data object.
 void marshal(org.w3c.dom.Node parent, String dsPrefix, DOMCryptoContext context)
           
 boolean validate(XMLValidateContext validateContext)
          Validates this reference.
 
Methods inherited from class org.jcp.xml.dsig.internal.dom.DOMStructure
isFeatureSupported
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.xml.crypto.XMLStructure
isFeatureSupported
 

Constructor Detail

DOMReference

public DOMReference(String uri,
                    String type,
                    DigestMethod dm,
                    List transforms,
                    String id,
                    Provider provider)
Class is disabled.

Creates a Reference from the specified parameters.

Parameters:
uri - the URI (may be null)
type - the type (may be null)
dm - the digest method
transforms - a list of Transforms. The list is defensively copied to protect against subsequent modification. May be null or empty.
id - the reference ID (may be null)
Throws:
NullPointerException - if dm is null
ClassCastException - if any of the transforms are not of type Transform

DOMReference

public DOMReference(String uri,
                    String type,
                    DigestMethod dm,
                    List appliedTransforms,
                    Data result,
                    List transforms,
                    String id,
                    Provider provider)
Class is disabled.


DOMReference

public DOMReference(String uri,
                    String type,
                    DigestMethod dm,
                    List appliedTransforms,
                    Data result,
                    List transforms,
                    String id,
                    byte[] digestValue,
                    Provider provider)
Class is disabled.


DOMReference

public DOMReference(org.w3c.dom.Element refElem,
                    XMLCryptoContext context,
                    Provider provider)
             throws MarshalException
Class is disabled.

Creates a DOMReference from an element.

Parameters:
refElem - a Reference element
Throws:
MarshalException
Method Detail

getDigestMethod

public DigestMethod getDigestMethod()
Class is disabled.

Description copied from interface: Reference
Returns the digest method of this Reference.

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

getId

public String getId()
Class is disabled.

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)

getURI

public String getURI()
Class is disabled.

Description copied from interface: URIReference
Returns the URI of the referenced data object.

Specified by:
getURI in interface URIReference
Returns:
the URI of the data object in RFC 2396 format (may be null if not specified)

getType

public String getType()
Class is disabled.

Description copied from interface: URIReference
Returns the type of data referenced by this URI.

Specified by:
getType in interface URIReference
Returns:
the type (a URI) of the data object (may be null if not specified)

getTransforms

public List getTransforms()
Class is disabled.

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)

getDigestValue

public byte[] getDigestValue()
Class is disabled.

Description copied from interface: Reference
Returns the digest value of this Reference.

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()
Class is disabled.

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.

marshal

public void marshal(org.w3c.dom.Node parent,
                    String dsPrefix,
                    DOMCryptoContext context)
             throws MarshalException
Class is disabled.

Specified by:
marshal in class DOMStructure
Throws:
MarshalException

digest

public void digest(XMLSignContext signContext)
            throws XMLSignatureException
Class is disabled.

Throws:
XMLSignatureException

validate

public boolean validate(XMLValidateContext validateContext)
                 throws XMLSignatureException
Class is disabled.

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:
validateContext - the validating context
Returns:
true if this reference was validated successfully; false otherwise
Throws:
XMLSignatureException - if an unexpected exception occurs while validating the reference

getDereferencedData

public Data getDereferencedData()
Class is disabled.

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 InputStream getDigestInputStream()
Class is disabled.

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

getHere

public org.w3c.dom.Node getHere()
Class is disabled.

Description copied from interface: DOMURIReference
Returns the here node.

Specified by:
getHere in interface DOMURIReference
Returns:
the attribute or processing instruction node or the parent element of the text node that directly contains the URI

equals

public boolean equals(Object o)
Enabled. assumes no non-deterministic equals methods in libraries

Description copied from class: Object
Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

The equals method for class Object implements the most discriminating possible equivalence relation on objects; that is, for any non-null reference values x and y, this method returns true if and only if x and y refer to the same object (x == y has the value true).

Note that it is generally necessary to override the hashCode method whenever this method is overridden, so as to maintain the general contract for the hashCode method, which states that equal objects must have equal hash codes.

Overrides:
equals in class Object
Parameters:
o - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.
See Also:
Object.hashCode(), HashMap