com.rsa.certj.xml

Class Transformer

java.lang.Object
  |
  +--com.rsa.certj.xml.Transformer
All Implemented Interfaces:
Cloneable, Serializable
Direct Known Subclasses:
Base64Transformer, C14NTransformer, EnvelopedTransformer, XPATHTransformer

public abstract class Transformer
extends Object
implements Cloneable, Serializable

This class is a base class for different transformers. A transformed element is an optional list of processing steps to apply to the resource's content before it is digested. It can include operations such as canonicalization, encoding/decoding, XPath and XSLT specified by the transformAlgorithm. Supported transforms include: Base64, Canonicalization without comments, Canonicalization with comments, XPath, and Enveloped-Signature.

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

See Also

Serialized Form

Field Summary

static String[]

BASE64_LIST

Specifies all supported Base64 transform algorithms as a list of URLs.

static String[]

C14N_LIST

Specifies the algorithm name lists for the canonicalization without comments, including all the URLs of the canonicalization specification since June 2000.

static String[]

C14N_WITH_COMMENTS_LIST

Specifies the algorithm name lists for the canonicalization with comments, including all the URLs of the canonicalization specification since June 2000.

static String[]

ENVELOPED_SIGNATURE_LIST

Specifies all supported Enveloped-Signature transform algorithms as a list of URLs

static String[]

XPATH_LIST

Specifies all supported XPath transform algorithms as a list of URLs.

 

Constructor Summary

Transformer()

 

 

Method Summary

static Hashtable

getAllTransformsInfo()

Returns the hash table that stores all the supported transformations.

static Transformer

getInstance(String transformAlgorithm)

Generates a new Transform object specified by transformAlgorithm.

abstract  String

getTransformAlgorithm()

Returns the transform algorithm.

abstract  byte[]

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

Applies the transform operation to a byte array input.

abstract  org.w3c.dom.NodeList

performTransformation(org.w3c.dom.NodeList inputNodes)

This method applies the transform operation to a node-set.

 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BASE64_LIST

public static final String[] BASE64_LIST
Specifies all supported Base64 transform algorithms as a list of URLs.

C14N_LIST

public static final String[] C14N_LIST
Specifies the algorithm name lists for the canonicalization without comments, including all the URLs of the canonicalization specification since June 2000.

C14N_WITH_COMMENTS_LIST

public static final String[] C14N_WITH_COMMENTS_LIST
Specifies the algorithm name lists for the canonicalization with comments, including all the URLs of the canonicalization specification since June 2000.

XPATH_LIST

public static final String[] XPATH_LIST
Specifies all supported XPath transform algorithms as a list of URLs.

ENVELOPED_SIGNATURE_LIST

public static final String[] ENVELOPED_SIGNATURE_LIST
Specifies all supported Enveloped-Signature transform algorithms as a list of URLs
Constructor Detail

Transformer

public Transformer()
Method Detail

getAllTransformsInfo

public static Hashtable getAllTransformsInfo()
Returns the hash table that stores all the supported transformations.

Returns

The Hashtable object that stores all the supported Transformer classes.

getTransformAlgorithm

public abstract String getTransformAlgorithm()
Returns the transform algorithm.

Returns

A String object containing the transform algorithm name.

getInstance

public static Transformer getInstance(String transformAlgorithm)
                               throws XMLException
Generates a new Transform object specified by transformAlgorithm. It looks up the internal hash table to determine whether the Transformer class of transformAlgorithm is defined.

Parameters

         transformAlgorithm  

A URL string specifying the name of the transform algorithm.

Returns

The Transformer object specified by the transformAlgorithm.

Throws

XMLException - If an error occurs while instantiating a Transformer object.

performTransformation

public abstract byte[] performTransformation(byte[] input,
                                             int inOffset,
                                             int inputLength)
                                      throws XMLException
Applies the transform operation to a byte array input. Transforms such as Base64 should use this method.

Parameters

         input  

The byte array to transform.

         inOffset  

The starting position of the data to transform in input.

         inputLength  

The length of the data to transform in input.

Returns

A byte array that contains the transformation.

Throws

XMLException - If an error occurs while performing the transformation.

performTransformation

public abstract org.w3c.dom.NodeList performTransformation(org.w3c.dom.NodeList inputNodes)
                                                    throws XMLException
This method applies the transform operation to a node-set. Transforms such as XPath should use this method.

Parameters

         inputNodes  

A Node object to transform.

Returns

A NodeList object containing the transformed data.

Throws

XMLException - If an error occurs during the transformation.


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