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

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

public final class DOMReference
extends DOMStructure
implements Reference, DOMURIReference

DOM-based implementation of Reference.

Author:
Sean Mullan, Joyce Leung

Field Summary
static int MAXIMUM_TRANSFORM_COUNT
          The maximum number of transforms per reference, if secure validation is enabled.
 
Constructor Summary
DOMReference(Element refElem, XMLCryptoContext context, Provider provider)
          Creates a DOMReference from an element.
DOMReference(String uri, String type, DigestMethod dm, List<? extends Transform> appliedTransforms, Data result, List<? extends Transform> transforms, String id, byte[] digestValue, Provider provider)
           
DOMReference(String uri, String type, DigestMethod dm, List<? extends Transform> appliedTransforms, Data result, List<? extends Transform> transforms, String id, Provider provider)
           
DOMReference(String uri, String type, DigestMethod dm, List<? extends Transform> transforms, String id, Provider provider)
          Creates a Reference from the specified parameters.
 
Method Summary
 void digest(XMLSignContext signContext)
           
 boolean equals(Object o)
           
 byte[] getCalculatedDigestValue()
           
 Data getDereferencedData()
           
 InputStream getDigestInputStream()
           
 DigestMethod getDigestMethod()
           
 byte[] getDigestValue()
           
 Node getHere()
           
 String getId()
           
 List<Transform> getTransforms()
           
 String getType()
           
 String getURI()
           
 int hashCode()
           
 void marshal(XmlWriter xwriter, String dsPrefix, XMLCryptoContext context)
           
 boolean validate(XMLValidateContext validateContext)
           
 
Methods inherited from class org.apache.jcp.xml.dsig.internal.dom.BaseStructure
isFeatureSupported, textOfNode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.xml.crypto.XMLStructure
isFeatureSupported
 

Field Detail

MAXIMUM_TRANSFORM_COUNT

public static final int MAXIMUM_TRANSFORM_COUNT
The maximum number of transforms per reference, if secure validation is enabled.

See Also:
Constant Field Values
Constructor Detail

DOMReference

public DOMReference(String uri,
                    String type,
                    DigestMethod dm,
                    List<? extends Transform> transforms,
                    String id,
                    Provider provider)
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<? extends Transform> appliedTransforms,
                    Data result,
                    List<? extends Transform> transforms,
                    String id,
                    Provider provider)

DOMReference

public DOMReference(String uri,
                    String type,
                    DigestMethod dm,
                    List<? extends Transform> appliedTransforms,
                    Data result,
                    List<? extends Transform> transforms,
                    String id,
                    byte[] digestValue,
                    Provider provider)

DOMReference

public DOMReference(Element refElem,
                    XMLCryptoContext context,
                    Provider provider)
             throws MarshalException
Creates a DOMReference from an element.

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

getDigestMethod

public DigestMethod getDigestMethod()
Specified by:
getDigestMethod in interface Reference

getId

public String getId()
Specified by:
getId in interface Reference

getURI

public String getURI()
Specified by:
getURI in interface URIReference

getType

public String getType()
Specified by:
getType in interface URIReference

getTransforms

public List<Transform> getTransforms()
Specified by:
getTransforms in interface Reference

getDigestValue

public byte[] getDigestValue()
Specified by:
getDigestValue in interface Reference

getCalculatedDigestValue

public byte[] getCalculatedDigestValue()
Specified by:
getCalculatedDigestValue in interface Reference

marshal

public void marshal(XmlWriter xwriter,
                    String dsPrefix,
                    XMLCryptoContext context)
             throws MarshalException
Specified by:
marshal in class DOMStructure
Throws:
MarshalException

digest

public void digest(XMLSignContext signContext)
            throws XMLSignatureException
Throws:
XMLSignatureException

validate

public boolean validate(XMLValidateContext validateContext)
                 throws XMLSignatureException
Specified by:
validate in interface Reference
Throws:
XMLSignatureException

getDereferencedData

public Data getDereferencedData()
Specified by:
getDereferencedData in interface Reference

getDigestInputStream

public InputStream getDigestInputStream()
Specified by:
getDigestInputStream in interface Reference

getHere

public Node getHere()
Specified by:
getHere in interface DOMURIReference

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2000–2014 The Apache Software Foundation. All rights reserved.