public interface SignerReference
| 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 |
|---|---|
byte[] |
getCalculatedDigest()
Gets the digest value that has been calculated by this object.
|
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. |
int |
getTransformsNumber()
Gets the number of transforms inserted into this reference so far.
|
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.
|
void |
insertTransformAt(Transform transform,
int position)
Inserts the specified transform at the specified position into the list of transforms which should be
applied to the data refered by this reference to get the input for the digest algorithm.
|
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. |
void |
removeTransformAt(int position)
Removes the transform at the specified position from the list of transforms which should be applied to
the data refered by this reference to get the input for the digest algorithm.
|
void |
setCalculatedDigest(byte[] calculatedDigestValue)
Sets the digest value that has been calculated for this reference.
|
void |
setDigestAlgorithm(DigestAlgorithm digestAlgorithm)
Sets the digest algorithm for this reference.
|
void |
setExplicitData(java.lang.Object explicitData,
boolean explicitDataType)
Sets one of two possible kinds of explicit data:
|
void |
setId(java.lang.String id)
Sets the Id attribute value of the reference.
|
void |
setType(URI type)
Sets the Type attribute value of the Reference Element.
|
void |
setURI(URI uri)
Sets the URI attribute value of the Reference Element.
|
static final boolean EXPLICITDATATYPE_RAW_
setExplicitData(java.lang.Object, boolean).static final boolean EXPLICITDATATYPE_DIGESTINPUT_
setExplicitData(java.lang.Object, boolean).void setId(java.lang.String id)
null, the possibly existing Id attribute will be
removed. If the reference has already been added to a SignerManifest or SignerSignedInfo container, this method will have no effect.id - The Id attribute value.java.lang.String getId()
null if the Id attribute is not available.void setURI(URI uri)
null, the possibly existing URI attribute will
be removed.uri - The URI for the attribute value.java.lang.String getURI()
null if the URI attribute is not available.void setType(URI type)
null, the possibly existing Type
attribute will be removed.type - The URI for the attribute value.java.lang.String getType()
null if the Type attribute is not available.org.w3c.dom.Element getDOMElement()
void setDigestAlgorithm(DigestAlgorithm digestAlgorithm) throws ReferenceException
digestAlgorithm - The digest algorithm used to create the message digest for the data refered by
this reference. Must not be null.ReferenceException - if requesting the DOM element representation from the digest algorithm
fails.DigestAlgorithm getDigestAlgorithm()
null if it has not been specified yet.void insertTransformAt(Transform transform, int position) throws ReferenceException
transform - The transform to be inserted. Must not be null.position - The position where to insert the transform into the list. Must be greater or equal 0
and must be less or equal the number of transforms inserted so far.ReferenceException - if requesting the DOM element representation from the transform fails.int getTransformsNumber()
void removeTransformAt(int position)
throws ReferenceException
position - The position of the tranform to be removed in the list. Must be greater or equal 0 and
must be less than the number of transforms which have been inserted so far.ReferenceException - if removing the transform fails for any reason.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 SignerSignature.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.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.