public final class DOMReference extends DOMStructure implements Reference, DOMURIReference
| Modifier and Type | Field and Description |
|---|---|
static int |
MAXIMUM_TRANSFORM_COUNT
The maximum number of transforms per reference, if secure validation is enabled.
|
| Constructor and Description |
|---|
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. |
| Modifier and Type | Method and Description |
|---|---|
void |
digest(XMLSignContext signContext) |
boolean |
equals(Object o) |
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. |
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()
|
String |
getType()
Returns the type of data referenced by this URI.
|
String |
getURI()
Returns the URI of the referenced data object.
|
int |
hashCode() |
void |
marshal(Node parent,
String dsPrefix,
DOMCryptoContext context) |
boolean |
validate(XMLValidateContext validateContext)
Validates this reference.
|
isFeatureSupportedclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitisFeatureSupportedpublic static final int MAXIMUM_TRANSFORM_COUNT
public DOMReference(String uri, String type, DigestMethod dm, List<? extends Transform> transforms, String id, Provider provider)
Reference from the specified parameters.uri - the URI (may be null)type - the type (may be null)dm - the digest methodtransforms - 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)NullPointerException - if dm is nullClassCastException - if any of the transforms are
not of type Transformpublic DOMReference(String uri, String type, DigestMethod dm, List<? extends Transform> appliedTransforms, Data result, List<? extends Transform> transforms, String id, Provider provider)
public DOMReference(String uri, String type, DigestMethod dm, List<? extends Transform> appliedTransforms, Data result, List<? extends Transform> transforms, String id, byte[] digestValue, Provider provider)
public DOMReference(Element refElem, XMLCryptoContext context, Provider provider) throws MarshalException
DOMReference from an element.refElem - a Reference elementMarshalExceptionpublic DigestMethod getDigestMethod()
ReferenceReference.getDigestMethod in interface Referencepublic String getId()
ReferenceId attribute of this
Reference, which permits this reference to be
referenced from elsewhere.public String getURI()
URIReferencegetURI in interface URIReferencenull if not specified)public String getType()
URIReferencegetType in interface URIReferencenull
if not specified)public List getTransforms()
ReferencegetTransforms in interface ReferenceTransforms
(may be empty but never null)public byte[] getDigestValue()
ReferenceReference.getDigestValue in interface Referencenull if this reference has
not been digested yet. Each invocation of this method returns a new
clone to protect against subsequent modification.public byte[] getCalculatedDigestValue()
ReferenceReference
after a validation operation. This method is useful for debugging if
the reference fails to validate.getCalculatedDigestValue in interface Referencenull if this
reference has not been validated yet. Each invocation of this method
returns a new clone to protect against subsequent modification.public void marshal(Node parent, String dsPrefix, DOMCryptoContext context) throws MarshalException
marshal in class DOMStructureMarshalExceptionpublic void digest(XMLSignContext signContext) throws XMLSignatureException
XMLSignatureExceptionpublic boolean validate(XMLValidateContext validateContext) throws XMLSignatureException
ReferenceThis method only validates the reference the first time it is invoked. On subsequent invocations, it returns a cached result.
validate in interface ReferencevalidateContext - the validating contexttrue if this reference was validated successfully;
false otherwiseXMLSignatureException - if an unexpected exception occurs while
validating the referencepublic Data getDereferencedData()
ReferencegetDereferencedData in interface Referencenull if reference
caching is not enabled or this reference has not been generated or
validatedpublic InputStream getDigestInputStream()
ReferencegetDigestInputStream in interface Referencenull if reference caching is not enabled or this
reference has not been generated or validatedpublic Node getHere()
DOMURIReferencegetHere in interface DOMURIReferenceCopyright © 2000–2022 The Apache Software Foundation. All rights reserved.