public abstract class TransformInstruction
extends java.lang.Object
Abstract base class representing a transform instruction.
| Modifier and Type | Field and Description |
|---|---|
protected AlgorithmFactory |
algorithmFactory_
Creates algorithms needed in case of verification.
|
protected java.lang.Object |
cachedTransformInput_
Stores the result of the last transform which has already been processed.
|
static boolean |
EXPLICITDATATYPE_RAW_
Constant for type of data set with method
setExplicitData(java.lang.Object, boolean). |
static boolean |
EXPLICITDATATYPE_RESULT_
Constant for type of data set with method
setExplicitData(java.lang.Object, boolean). |
protected boolean |
finalC14NApplied_
Stores whether the final canonicalization has been applied if member
posOfLastInvokedTransform_
equals the number of transforms specified for this transform instruction. |
protected int |
posOfLastInvokedTransform_
Stores the position of the last transform which has already been processed.
|
protected java.util.List |
transforms_
A list of references to
Transform elements, each of which represents a transform algorithm
used to generate the result of this transform instruction from the refered data. |
protected org.w3c.dom.Element |
transInstrDOMElem_
DOM element representation of the transform instruction element.
|
protected org.w3c.dom.Attr |
typeAttr_
DOM attribute representation of the transform instruction's attribute named "Type".
|
protected org.w3c.dom.Attr |
uriAttr_
DOM attribute representation of the transform instruction's attribute named "URI".
|
protected URIResolverParameters |
uriResolverParameters_
Structure encapsulating some parameters for resolving URIs.
|
| Modifier | Constructor and Description |
|---|---|
protected |
TransformInstruction(org.w3c.dom.Element transInstrDOMElem,
iaik.ixsil.core.SignatureHandler signatureHandler)
Creates a transform instruction object, depending on the specified use case.
|
protected |
TransformInstruction(org.w3c.dom.Element transInstrDOMElem,
URIResolverParameters uriResolverParameters,
boolean useCase)
Creates a transform instruction object, depending on the specified use case.
|
| Modifier and Type | Method and Description |
|---|---|
protected org.w3c.dom.Element |
createAndInsertTransforms()
Creates and adds the Transforms DOM element as first child of the DOM element representing the
transform instruction.
|
org.w3c.dom.Element |
getDOMElement()
Gets the DOM Element representing the transform instruction.
|
java.io.InputStream |
getExplicitData(boolean explicitDataType)
Gets either the raw data (data resulting from resolving the URI attribute of the reference) or the
result data (data resulting from the last of the specified transforms).
|
Transform[] |
getTransforms()
Gets an array with all
Transform objects registerred for this transform instruction. |
int |
getTransformsNumber()
Gets the number of transforms inserted into this transform instruction so far.
|
java.lang.String |
getType()
Gets the Type attribute value of the Element representing the transform instruction.
|
java.lang.String |
getURI()
Gets the URI attribute value of the Element representing the transform instruction.
|
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 transform instruction.
|
protected java.lang.Object |
internalProcessTransforms(int positionOfLastIncludedTransform,
boolean applyFinalC14N,
boolean cloneResult)
Resolves the transform instruction'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 transform instruction.
|
void |
setExplicitData(java.lang.Object explicitData,
boolean explicitDataType)
Sets one of two possible kinds of explicit data:
|
void |
setType(URI type)
Sets the Type attribute value of the Element representing the transform instruction.
|
void |
setURI(URI uri)
Sets the URI attribute value of the Element representing the transform instruction.
|
protected void |
signingInit(org.w3c.dom.Element transInstrDOMElem)
Initializes this transform instruction object for the signature creation use case.
|
protected void |
verifyingInit(org.w3c.dom.Element transInstrDOMElem)
Initializes this transform instruction object for the signature verification use case.
|
public static final boolean EXPLICITDATATYPE_RAW_
setExplicitData(java.lang.Object, boolean).public static final boolean EXPLICITDATATYPE_RESULT_
setExplicitData(java.lang.Object, boolean).protected org.w3c.dom.Element transInstrDOMElem_
protected org.w3c.dom.Attr uriAttr_
protected org.w3c.dom.Attr typeAttr_
protected URIResolverParameters uriResolverParameters_
protected AlgorithmFactory algorithmFactory_
protected java.util.List transforms_
Transform elements, each of which represents a transform algorithm
used to generate the result of this transform instruction from the refered data.protected java.lang.Object cachedTransformInput_
protected int posOfLastInvokedTransform_
cachedTransformInput_.protected boolean finalC14NApplied_
posOfLastInvokedTransform_
equals the number of transforms specified for this transform instruction.protected TransformInstruction(org.w3c.dom.Element transInstrDOMElem,
URIResolverParameters uriResolverParameters,
boolean useCase)
throws TransformInstructionException
transInstrDOMElem - The DOM element representation of the transform instruction.uriResolverParameters - Some parameters which are used for resolving URI references.useCase - Indicates if this constructor is invoked in the the context of signing or verification.
Please use the values SignatureHandler.SIGNING_ or SignatureHandler.VERIFYING_.TransformInstructionException - if constructing the transform instruction object fails for any
reason.protected TransformInstruction(org.w3c.dom.Element transInstrDOMElem,
iaik.ixsil.core.SignatureHandler signatureHandler)
throws TransformInstructionException
transInstrDOMElem - The DOM element representation of the transform instruction.signatureHandler - The signature handler responsible for the Signature bearing this
TransformInstruction.TransformInstructionException - if constructing the transform instruction object fails for any
reason.protected void signingInit(org.w3c.dom.Element transInstrDOMElem)
transInstrDOMElem - The DOM element representation of the transform instruction.protected void verifyingInit(org.w3c.dom.Element transInstrDOMElem)
throws TransformInstructionException
transInstrDOMElem - The DOM element representation of the transform instruction.TransformInstructionException - if initialization of the reference object fails for any
reason.public void setURI(URI uri)
null, the
possibly existing URI attribute will be removed.uri - The URI for the attribute value.public java.lang.String getURI()
null if the URI attribute is not available.public void setType(URI type)
null, the
possibly existing Type attribute will be removed.type - The URI for the attribute value.public java.lang.String getType()
null if the Type attribute is not available.public org.w3c.dom.Element getDOMElement()
public 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.protected org.w3c.dom.Element createAndInsertTransforms()
public int getTransformsNumber()
public void removeTransformAt(int position)
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.public Transform[] getTransforms()
Transform objects registerred for this transform instruction.Transform objects, or null if there are no transforms.public 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 result data). Please use the
values EXPLICITDATATYPE_RAW_ or EXPLICITDATATYPE_RESULT_.public java.io.InputStream getExplicitData(boolean explicitDataType)
Gets either the raw data (data resulting from resolving the URI attribute of the reference) or the result 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, this method will return
null. If the data is not available as an java.io.InputStream, this method will also
return null.
explicitDataType - Determines the type of explicit data (raw or digest input). Please use the
values EXPLICITDATATYPE_RAW_ or EXPLICITDATATYPE_RESULT_.protected java.lang.Object internalProcessTransforms(int positionOfLastIncludedTransform,
boolean applyFinalC14N,
boolean cloneResult)
throws TransformInstructionException
Resolves the transform instruction'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 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
transform instruction 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 an InputStream instead.cloneResult - Determines wheter the result of this method should be cloned (only in case that it
is an InputStream) or not.TransformInstructionException - if neither the URI attribute has been set nor a cached
transform input exists, or if processing the transforms fails
for any other reason.