|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.rsa.certj.xml.Transformer | +--com.rsa.certj.xml.Base64Transformer
This class implements a Base64
transformation
that decodes input data.
This transformation is useful if an application needs to sign the raw data
associated with the encoded content of an element.
See Also
Fields inherited from class com.rsa.certj.xml.Transformer |
BASE64_LIST, C14N_LIST, C14N_WITH_COMMENTS_LIST, ENVELOPED_SIGNATURE_LIST, XPATH_LIST |
Constructor Summary |
|
Base64Transformer()
Generates a |
Method Summary |
|
clone()
Overrides the default |
|
static byte[] |
decodeBase64Data(byte[] input,
int inputOffset,
int inputLength)
Decodes the Base64-encoded input data. |
static byte[] |
encodeBase64(byte[] input,
int inputOffset,
int inputLength)
Encodes the input data with |
getTransformAlgorithm()
Returns the transformation algorithm. |
|
byte[] |
performTransformation(byte[] input,
int inputOffset,
int inputLength)
Performs a |
org.w3c.dom.NodeList |
performTransformation(org.w3c.dom.NodeList inputNodes)
Performs a |
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 |
public Base64Transformer()
Base64Transformer
instance by initializing
the transform algorithm to the default Base64 algorithm
in Transformer
, which is the first algorithm in the
BASE64_LIST
.Method Detail |
public byte[] performTransformation(byte[] input, int inputOffset, int inputLength) throws XMLException
Base64
transformation on input, where input
is a byte
array.
This method should be
called only in signature verification.
Overrides
performTransformation
in class Transformer
Parameters
input | A | ||
inputOffset | The starting index of the input data. | ||
inputLength | The length of the input data. |
Returns
byte
array buffer
that holds the transformation result.Throws
XMLException
- If a
Base64-encoding error occurs, or if
input is null
.public org.w3c.dom.NodeList performTransformation(org.w3c.dom.NodeList inputNodes) throws XMLException
Base64
transformation on
inputNodes.
This method takes a node-set as input data.
It strips away the start and end tags
of the identified nodes and any of their descendant elements,
including descendant comments and processing instructions, and converts
it to an octet stream. Then the Base64
transformation
is performed on the octet stream.
This method should be called only in signature verification.Overrides
performTransformation
in class Transformer
Parameters
inputNodes | A |
Returns
NodeList
object containing a node set, which is
the transformation output.Throws
XMLException
- If an error occurs while performing the
transformation.public String getTransformAlgorithm()
Overrides
getTransformAlgorithm
in class Transformer
Returns
String
.public static byte[] encodeBase64(byte[] input, int inputOffset, int inputLength) throws XMLException
Base64
encoding.
Parameters
input | A | ||
inputOffset | The starting index of the input data. | ||
inputLength | The length of the input data. |
Returns
byte
array buffer that holds the encoded data.Throws
XMLException
- If an encoding error occurs, or if
input is null
.public static byte[] decodeBase64Data(byte[] input, int inputOffset, int inputLength) throws XMLException
Parameters
input | A | ||
inputOffset | The starting index of the | ||
inputLength | The length of the |
Returns
byte
array buffer that holds the decoded data.Throws
XMLException
- If a decoding error occurs, or if
input is null
.public Object clone() throws CloneNotSupportedException
clone
method to get a deeper clone.
Returns
Base64Transformer
object,
a copy of this object.Throws
CloneNotSupportedException
- If the cloning operation is not
successful.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |