Class DOMReference
- java.lang.Object
-
- org.apache.jcp.xml.dsig.internal.dom.DOMStructure
-
- 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.
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAXIMUM_TRANSFORM_COUNT
The maximum number of transforms per reference, if secure validation is enabled.
-
Constructor Summary
Constructors Constructor Description DOMReference(String uri, String type, DigestMethod dm, List<? extends Transform> transforms, String id, Provider provider)
Creates aReference
from the specified parameters.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(Element refElem, XMLCryptoContext context, Provider provider)
Creates aDOMReference
from an element.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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(Node parent, String dsPrefix, DOMCryptoContext context)
boolean
validate(XMLValidateContext validateContext)
-
Methods inherited from class org.apache.jcp.xml.dsig.internal.dom.DOMStructure
isFeatureSupported
-
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 aReference
from the specified parameters.- Parameters:
uri
- the URI (may be null)type
- the type (may be null)dm
- the digest methodtransforms
- a list ofTransform
s. The list is defensively copied to protect against subsequent modification. May benull
or empty.id
- the reference ID (may benull
)- Throws:
NullPointerException
- ifdm
isnull
ClassCastException
- if any of thetransforms
are not of typeTransform
-
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 aDOMReference
from an element.- Parameters:
refElem
- a Reference element- Throws:
MarshalException
-
-
Method Detail
-
getDigestMethod
public DigestMethod getDigestMethod()
- Specified by:
getDigestMethod
in interfaceReference
-
getURI
public String getURI()
- Specified by:
getURI
in interfaceURIReference
-
getType
public String getType()
- Specified by:
getType
in interfaceURIReference
-
getTransforms
public List<Transform> getTransforms()
- Specified by:
getTransforms
in interfaceReference
-
getDigestValue
public byte[] getDigestValue()
- Specified by:
getDigestValue
in interfaceReference
-
getCalculatedDigestValue
public byte[] getCalculatedDigestValue()
- Specified by:
getCalculatedDigestValue
in interfaceReference
-
marshal
public void marshal(Node parent, String dsPrefix, DOMCryptoContext context) throws MarshalException
- Specified by:
marshal
in classDOMStructure
- Throws:
MarshalException
-
digest
public void digest(XMLSignContext signContext) throws XMLSignatureException
- Throws:
XMLSignatureException
-
validate
public boolean validate(XMLValidateContext validateContext) throws XMLSignatureException
- Specified by:
validate
in interfaceReference
- Throws:
XMLSignatureException
-
getDereferencedData
public Data getDereferencedData()
- Specified by:
getDereferencedData
in interfaceReference
-
getDigestInputStream
public InputStream getDigestInputStream()
- Specified by:
getDigestInputStream
in interfaceReference
-
getHere
public Node getHere()
- Specified by:
getHere
in interfaceDOMURIReference
-
-