public interface

Transform

implements AlgorithmMethod XMLStructure
javax.xml.crypto.dsig.Transform
Known Indirect Subclasses

Class Overview

A representation of the XML Transform element as defined in the W3C Recommendation for XML-Signature Syntax and Processing. The XML Schema Definition is defined as:

 <element name="Transform" type="ds:TransformType"/>
   <complexType name="TransformType" mixed="true">
     <choice minOccurs="0" maxOccurs="unbounded">
       <any namespace="##other" processContents="lax"/>
       <!-- (1,1) elements from (0,unbounded) namespaces -->
       <element name="XPath" type="string"/>
     </choice>
     <attribute name="Algorithm" type="anyURI" use="required"/>
   </complexType>
 
A Transform instance may be created by invoking the newTransform method of the XMLSignatureFactory class.

Summary

Constants
String BASE64 The Base64 transform algorithm URI.
String ENVELOPED The Enveloped Signature transform algorithm URI.
String XPATH The XPath transform algorithm URI.
String XPATH2 The XPath Filter 2 transform algorithm URI.
String XSLT The XSLT transform algorithm URI.
Public Methods
abstract AlgorithmParameterSpec getParameterSpec()
Returns the algorithm-specific input parameters associated with this Transform.
abstract Data transform(Data data, XMLCryptoContext context)
Transforms the specified data using the underlying transform algorithm.
abstract Data transform(Data data, XMLCryptoContext context, OutputStream os)
Transforms the specified data using the underlying transform algorithm.
[Expand]
Inherited Methods
From interface javax.xml.crypto.AlgorithmMethod
From interface javax.xml.crypto.XMLStructure

Constants

public static final String BASE64

The Base64 transform algorithm URI.

Constant Value: "http://www.w3.org/2000/09/xmldsig#base64"

public static final String ENVELOPED

The Enveloped Signature transform algorithm URI.

Constant Value: "http://www.w3.org/2000/09/xmldsig#enveloped-signature"

public static final String XPATH

The XPath transform algorithm URI.

Constant Value: "http://www.w3.org/TR/1999/REC-xpath-19991116"

public static final String XPATH2

The XPath Filter 2 transform algorithm URI.

Constant Value: "http://www.w3.org/2002/06/xmldsig-filter2"

public static final String XSLT

The XSLT transform algorithm URI.

Constant Value: "http://www.w3.org/TR/1999/REC-xslt-19991116"

Public Methods

public abstract AlgorithmParameterSpec getParameterSpec ()

Returns the algorithm-specific input parameters associated with this Transform.

The returned parameters can be typecast to a TransformParameterSpec object.

Returns
  • the algorithm-specific input parameters (may be null if not specified)

public abstract Data transform (Data data, XMLCryptoContext context)

Transforms the specified data using the underlying transform algorithm.

Parameters
data the data to be transformed
context the XMLCryptoContext containing additional context (may be null if not applicable)
Returns
  • the transformed data
Throws
NullPointerException if data is null
TransformException if an error occurs while executing the transform

public abstract Data transform (Data data, XMLCryptoContext context, OutputStream os)

Transforms the specified data using the underlying transform algorithm. If the output of this transform is an OctetStreamData, then this method returns null and the bytes are written to the specified OutputStream. Otherwise, the OutputStream is ignored and the method behaves as if transform(Data, XMLCryptoContext) were invoked.

Parameters
data the data to be transformed
context the XMLCryptoContext containing additional context (may be null if not applicable)
os the OutputStream that should be used to write the transformed data to
Returns
  • the transformed data (or null if the data was written to the OutputStream parameter)
Throws
NullPointerException if data or os is null
TransformException if an error occurs while executing the transform