com.rsa.certj.xml.dsig

Class EnvelopedTransformer

java.lang.Object
  |
  +--com.rsa.certj.xml.Transformer
        |
        +--com.rsa.certj.xml.dsig.EnvelopedTransformer
All Implemented Interfaces:
Cloneable, Serializable

public class EnvelopedTransformer
extends Transformer
implements Cloneable, Serializable

This class implements an enveloped transformation. It removes the entire signature element containing the enveloped transform algorithm T from the digest calculation of the reference element containing T. The entire string of characters used by an XML processor to match the signature with the XML production element is removed. The input for this transformation is an XPath node-set. If the input is an octet stream, it is converted to an XPath node-set before implementing the transformation.

The output of the transformation is equivalent to the output resulting from replacing T with an XPath transformation containing the following XPath parameter element:

 < XPath xmlns:dsig="&dsig;" >
 count(ancestor-or-self::dsig:Signature |
 here()/ancestor::dsig:Signature[1])>
 count(ancestor-or-self::dsig:Signature) </XPath>
 

Copyright © RSA Security Inc., 2001-2002. All rights reserved.

See Also

Serialized Form

Fields inherited from class com.rsa.certj.xml.Transformer
BASE64_LIST, C14N_LIST, C14N_WITH_COMMENTS_LIST, ENVELOPED_SIGNATURE_LIST, XPATH_LIST
 

Constructor Summary

EnvelopedTransformer()

Generates an EnvelopedTransformer instance by initializing the transformation algorithm to the default one defined in Transformer which is the first algorithm in Transformer.ENVELOPED_SIGNATURE_LIST.

 

Method Summary

 Object

clone()

Overrides the default clone method to get a deeper clone.

 String

getTransformAlgorithm()

Returns the transformation algorithm.

 byte[]

performTransformation(byte[] input, int inOffset, int inputLength)

Processes the enveloped transformation using a byte array as input data.

 org.w3c.dom.NodeList

performTransformation(org.w3c.dom.NodeList inputNodes)

Processes the enveloped transformation using a node-set as input data.

 
Methods inherited from class com.rsa.certj.xml.Transformer
getAllTransformsInfo, getInstance
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnvelopedTransformer

public EnvelopedTransformer()
Generates an EnvelopedTransformer instance by initializing the transformation algorithm to the default one defined in Transformer which is the first algorithm in Transformer.ENVELOPED_SIGNATURE_LIST.
Method Detail

performTransformation

public byte[] performTransformation(byte[] input,
                                    int inOffset,
                                    int inputLength)
                             throws XMLException
Processes the enveloped transformation using a byte array as input data. It converts the array to an XPath node-set, produces a node-set as a result of the transformation, and then converts that node-set to an octet stream.

Overrides

performTransformation in class Transformer

Parameters

         input  

A byte array to transform.

         inOffset  

The starting index of input.

         inputLength  

The size of input.

Returns

A transformed byte array.

Throws

XMLException - If an error occurs while performing the transformation.

performTransformation

public org.w3c.dom.NodeList performTransformation(org.w3c.dom.NodeList inputNodes)
                                           throws XMLException
Processes the enveloped transformation using a node-set as input data. It removes the entire signature element that contains this transformation element from the digest calculation of the reference element containing this transform.

Overrides

performTransformation in class Transformer

Parameters

         inputNodes  

A NodeList object to transform.

Returns

A NodeList object containing a transformed node-set.

Throws

XMLException - If an error occurs while performing the transformation.

getTransformAlgorithm

public String getTransformAlgorithm()
Returns the transformation algorithm.

Overrides

getTransformAlgorithm in class Transformer

Returns

The transformation algorithm name as a String value.

clone

public Object clone()
             throws CloneNotSupportedException
Overrides the default clone method to get a deeper clone.

Returns

A new EnvelopedTransformer object, a copy of this object.

Throws

CloneNotSupportedException - If the cloning operation is not successful.


RSA BSAFE ® Cert-J 2.1.1 001-047007-211-001-000