public interface VerifierReference
| Modifier and Type | Field and Description |
|---|---|
static boolean |
EXPLICITDATATYPE_DIGESTINPUT_
Constant for type of data set with method
setExplicitData(java.lang.Object, boolean). |
static boolean |
EXPLICITDATATYPE_RAW_
Constant for type of data set with method
setExplicitData(java.lang.Object, boolean). |
| Modifier and Type | Method and Description |
|---|---|
VerifierManifest |
dereferenceManifest()
Creates a manifest object from the data the reference points to.
|
Object |
dereferenceObject()
Creates an object container from the data the reference points to.
|
VerifierSignatureProperties |
dereferenceSignatureProperties()
Creates a signature property container from the data the reference points to.
|
SignatureProperty |
dereferenceSignatureProperty()
Creates a signature property from the data the reference points to.
|
byte[] |
getCalculatedDigest()
Gets the digest value that has been calculated by this object.
|
byte[] |
getDigest()
Get the digest value of this reference element.
|
DigestAlgorithm |
getDigestAlgorithm()
Gets the digest algorithm employed by this reference.
|
org.w3c.dom.Element |
getDOMElement()
Gets the DOM Element representing the reference.
|
java.io.InputStream |
getExplicitData(boolean explicitDataType)
Gets either the raw data (data resulting from resolving the URI attribute of the reference) or the
digest input data (data resulting from the last of the specified transforms).
|
java.lang.String |
getId()
Gets the Id attribute value of the Reference element.
|
Transform[] |
getTransforms()
Gets an array with all
Transform objects registerred for this reference. |
java.lang.String |
getType()
Gets the Type attribute value of the Reference Element.
|
java.lang.String |
getURI()
Gets the URI attribute value of the Reference Element.
|
java.lang.Object |
processTransforms(int positionOfLastIncludedTransform,
boolean applyFinalC14N)
Resolves the Reference's URI (or takes the expicite data set previously respectively) and invokes all
transforms starting with the first and ending with the one specified by means of the parameter
positionOfLastIncludedTransform. |
boolean |
refersToManifest()
Checks if the Type attribute of this reference indicates that the reference refers to a manifest.
|
boolean |
refersToObject()
Checks if the Type attribute of this reference indicates that the reference refers to an object
container.
|
boolean |
refersToSignatureProperties()
Checks if the Type attribute of this reference indicates that the reference refers to a signature
property container.
|
boolean |
refersToSignatureProperty()
Checks if the Type attribute of this reference indicates that the reference refers to a signature
property.
|
void |
setCalculatedDigest(byte[] calculatedDigestValue)
Sets the digest value that has been calculated for this reference.
|
void |
setExplicitData(java.lang.Object explicitData,
boolean explicitDataType)
Sets one of two possible kinds of explicit data:
|
boolean |
verifyDigest()
Verifies the digest value of this Reference.
|
static final boolean EXPLICITDATATYPE_RAW_
setExplicitData(java.lang.Object, boolean).static final boolean EXPLICITDATATYPE_DIGESTINPUT_
setExplicitData(java.lang.Object, boolean).java.lang.String getId()
null if the Id attribute is not available.java.lang.String getURI()
null if the URI attribute is not available.java.lang.String getType()
null if the Type attribute is not available.org.w3c.dom.Element getDOMElement()
DigestAlgorithm getDigestAlgorithm()
null if it has not been specified yet.Transform[] getTransforms()
Transform objects registerred for this reference.Transform objects, or null if there are no transforms.void setExplicitData(java.lang.Object explicitData,
boolean explicitDataType)
This method can be used for some reasons:
explicitData - The explicit data bytes to be set. Must not be null and must either
be of type InputStream or NodeList.explicitDataType - Determines the type of explicit data (raw or digest input). Please use the
values EXPLICITDATATYPE_RAW_ or EXPLICITDATATYPE_DIGESTINPUT_.java.io.InputStream getExplicitData(boolean explicitDataType)
Gets either the raw data (data resulting from resolving the URI attribute of the reference) or the digest input data (data resulting from the last of the specified transforms). Which kind of data is desired must be indicated with the explicitDataType flag.
This method will not compute the desired data. If it is not available due to previous invokation of
method setExplicitData(java.lang.Object, boolean) or VerifierSignature.computeDigestInputs(), this method will
return null.
explicitDataType - Determines the type of explicit data (raw or digest input). Please use the
values EXPLICITDATATYPE_RAW_ or EXPLICITDATATYPE_DIGESTINPUT_.java.lang.Object processTransforms(int positionOfLastIncludedTransform,
boolean applyFinalC14N)
throws ReferenceException
Resolves the Reference's URI (or takes the expicite data set previously respectively) and invokes all
transforms starting with the first and ending with the one specified by means of the parameter
positionOfLastIncludedTransform.
The result of this computation is returned; it can either be an java.io.InputStream or
a org.w3c.dom.NodeList, depending on the result type of the last transform.
Further invokations of this method with a value of positionOfLastIncludedTransform higher
than its current value, or the final computation of the digest value triggered by method
SignerSignature.sign() or VerifierSignature.verify() will not reinvoke all the transforms,
but use the (cached) result of this method instead.
positionOfLastIncludedTransform - The position of the last transform included in the computation
described above. A value 0 means that no transform
is invoked at all; in such a case the input for the first
transform is returned.applyFinalC14N - This parameter is evaluated only if the parameter
positionOfLastIncludedTransform equals the number of transforms specified for this
Reference and if the last transform provides the result as a NodeList. In such a
case the parameter determines whether this method returns that NodeList or applies
the final canonicalization and returns a InputStream instead.java.io.InputStream, or the
computation result itself, if it is a org.w3c.dom.NodeList.ReferenceException - if neither the URI attribute has been set nor a cached transform input
exists, or if positionOfLastIncludedTransform contains a
number higher than the number of specified transforms.boolean verifyDigest()
throws ReferenceException
true, if verification succeeds, false otherwise.ReferenceException - if performing the verification of the digest value fails for any reason.byte[] getDigest()
throws ReferenceException
ReferenceException - Parsing or decoding the digest values fails.byte[] getCalculatedDigest()
getDigest().null if it has not been
calculated yet.void setCalculatedDigest(byte[] calculatedDigestValue)
calculatedDigestValue - The calculated digest value or
null if it has not been
calculated yet.boolean refersToManifest()
true if the reference refers to a manifest, false otherwise.boolean refersToObject()
true if the reference refers to an object container, false otherwise.boolean refersToSignatureProperties()
true if the reference refers to a signature property container, false
otherwise.boolean refersToSignatureProperty()
true if the reference refers to a signature property, false
otherwise.VerifierManifest dereferenceManifest() throws ReferenceException
ReferenceException - if the URI attribute has not been set, or if the referenced data is not
a Manifest XML element, or if creating the manifest object fails for any
other reason.Object dereferenceObject() throws ReferenceException
ReferenceException - if the URI attribute has not been set, or if the referenced data is not
an Object XML element, or if creating the object container fails for any
other reason.VerifierSignatureProperties dereferenceSignatureProperties() throws ReferenceException
ReferenceException - if the URI attribute has not been set, or if the referenced data is not
a SignatureProperties XML element, or if creating the signature property
container fails for any other reason.SignatureProperty dereferenceSignatureProperty() throws ReferenceException
ReferenceException - if the URI attribute has not been set, or if the referenced data is not
a SignatureProperty XML element, or if creating the signature property
fails for any other reason.