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
DOM-based implementation of Reference.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Dataprivate byte[]private Dataprivate booleanprivate final DigestMethodprivate byte[]private InputStreamprivate Attrprivate final Stringprivate static final org.slf4j.Loggerstatic final intThe maximum number of transforms per reference, if secure validation is enabled.private MessageDigestprivate Providerprivate Elementprivate final Stringprivate final Stringprivate static booleanLook up useC14N11 system property.private booleanprivate boolean -
Constructor Summary
ConstructorsConstructorDescriptionDOMReference(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
Modifier and TypeMethodDescriptionprivate static DatacopyDerefData(Data dereferencedData) private Datadereference(XMLCryptoContext context) voiddigest(XMLSignContext signContext) booleanbyte[]byte[]getHere()getId()getType()getURI()inthashCode()(package private) booleanvoidmarshal(Node parent, String dsPrefix, DOMCryptoContext context) private byte[]transform(Data dereferencedData, XMLCryptoContext context) booleanvalidate(XMLValidateContext validateContext) Methods inherited from class DOMStructure
isFeatureSupportedMethods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface XMLStructure
isFeatureSupported
-
Field Details
-
MAXIMUM_TRANSFORM_COUNT
public static final int MAXIMUM_TRANSFORM_COUNTThe maximum number of transforms per reference, if secure validation is enabled.- See Also:
-
useC14N11
private static boolean useC14N11Look up useC14N11 system property. If true, an explicit C14N11 transform will be added if necessary when generating the signature. See section 3.1.1 of http://www.w3.org/2007/xmlsec/Drafts/xmldsig-core/ for more info. If true, overrides the same property if set in the XMLSignContext. -
LOG
private static final org.slf4j.Logger LOG -
digestMethod
-
id
-
transforms
-
allTransforms
-
appliedTransformData
-
here
-
uri
-
type
-
digestValue
private byte[] digestValue -
calcDigestValue
private byte[] calcDigestValue -
refElem
-
digested
private boolean digested -
validated
private boolean validated -
validationStatus
private boolean validationStatus -
derefData
-
dis
-
md
-
provider
-
-
Constructor Details
-
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
-
DOMReference
-
DOMReference
public DOMReference(Element refElem, XMLCryptoContext context, Provider provider) throws MarshalException Creates aDOMReferencefrom an element.- Parameters:
refElem- a Reference element- Throws:
MarshalException
-
-
Method Details
-
getDigestMethod
- Specified by:
getDigestMethodin interfaceReference
-
getId
-
getURI
- Specified by:
getURIin interfaceURIReference
-
getType
- Specified by:
getTypein interfaceURIReference
-
getTransforms
- Specified by:
getTransformsin interfaceReference
-
getDigestValue
public byte[] getDigestValue()- Specified by:
getDigestValuein interfaceReference
-
getCalculatedDigestValue
public byte[] getCalculatedDigestValue()- Specified by:
getCalculatedDigestValuein interfaceReference
-
marshal
- Specified by:
marshalin classDOMStructure- Throws:
MarshalException
-
digest
- Throws:
XMLSignatureException
-
validate
- Specified by:
validatein interfaceReference- Throws:
XMLSignatureException
-
getDereferencedData
- Specified by:
getDereferencedDatain interfaceReference
-
getDigestInputStream
- Specified by:
getDigestInputStreamin interfaceReference
-
dereference
- Throws:
XMLSignatureException
-
transform
private byte[] transform(Data dereferencedData, XMLCryptoContext context) throws XMLSignatureException - Throws:
XMLSignatureException
-
getHere
- Specified by:
getHerein interfaceDOMURIReference
-
equals
-
hashCode
-
isDigested
boolean isDigested() -
copyDerefData
-