- 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 intMAXIMUM_TRANSFORM_COUNTThe 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 aReferencefrom 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 aDOMReferencefrom an element.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddigest(XMLSignContext signContext)booleanequals(Object o)byte[]getCalculatedDigestValue()DatagetDereferencedData()InputStreamgetDigestInputStream()DigestMethodgetDigestMethod()byte[]getDigestValue()NodegetHere()StringgetId()List<Transform>getTransforms()StringgetType()StringgetURI()inthashCode()voidmarshal(Node parent, String dsPrefix, DOMCryptoContext context)booleanvalidate(XMLValidateContext validateContext)-
Methods inherited from class org.apache.jcp.xml.dsig.internal.dom.DOMStructure
equalsContent, 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 aReferencefrom the specified parameters.- Parameters:
uri- the URI (may be null)type- the type (may be null)dm- the digest methodtransforms- a list ofTransforms. The list is defensively copied to protect against subsequent modification. May benullor empty.id- the reference ID (may benull)- Throws:
NullPointerException- ifdmisnullClassCastException- if any of thetransformsare 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 aDOMReferencefrom an element.- Parameters:
refElem- a Reference element- Throws:
MarshalException
-
-
Method Detail
-
getDigestMethod
public DigestMethod getDigestMethod()
- Specified by:
getDigestMethodin interfaceReference
-
getURI
public String getURI()
- Specified by:
getURIin interfaceURIReference
-
getType
public String getType()
- Specified by:
getTypein interfaceURIReference
-
getTransforms
public List<Transform> getTransforms()
- Specified by:
getTransformsin interfaceReference
-
getDigestValue
public byte[] getDigestValue()
- Specified by:
getDigestValuein interfaceReference
-
getCalculatedDigestValue
public byte[] getCalculatedDigestValue()
- Specified by:
getCalculatedDigestValuein interfaceReference
-
marshal
public void marshal(Node parent, String dsPrefix, DOMCryptoContext context) throws MarshalException
- Specified by:
marshalin classDOMStructure- Throws:
MarshalException
-
digest
public void digest(XMLSignContext signContext) throws XMLSignatureException
- Throws:
XMLSignatureException
-
validate
public boolean validate(XMLValidateContext validateContext) throws XMLSignatureException
- Specified by:
validatein interfaceReference- Throws:
XMLSignatureException
-
getDereferencedData
public Data getDereferencedData()
- Specified by:
getDereferencedDatain interfaceReference
-
getDigestInputStream
public InputStream getDigestInputStream()
- Specified by:
getDigestInputStreamin interfaceReference
-
getHere
public Node getHere()
- Specified by:
getHerein interfaceDOMURIReference
-
-