APIdia Launch Partner
Top Description Fields Methods
javax.xml.crypto.dsig

public Interface Transform

extends XMLStructure, AlgorithmMethod
Known Direct Subinterfaces
javax.xml.crypto.dsig.CanonicalizationMethod
Known Direct Implementers
javax.xml.crypto.dsig.TransformService, org.jcp.xml.dsig.internal.dom.DOMTransform
Imports
java.io.OutputStream, java.security.spec.AlgorithmParameterSpec, javax.xml.crypto.AlgorithmMethod, .Data, .OctetStreamData, .XMLCryptoContext, .XMLStructure, javax.xml.crypto.dsig.spec.TransformParameterSpec

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.
Authors
Sean Mullan, JSR 105 Expert Group
Since
1.6
See Also
XMLSignatureFactory#newTransform(String, TransformParameterSpec)

Field Summary

Modifier and TypeField and Description
public static final String
BASE64

The Base64 transform algorithm URI.

public static final String
ENVELOPED

The Enveloped Signature transform algorithm URI.

public static final String
XPATH

The XPath transform algorithm URI.

public static final String
XPATH2

The XPath Filter 2 transform algorithm URI.

public static final String
XSLT

The XSLT transform algorithm URI.

Method Summary

Modifier and TypeMethod and Description
public AlgorithmParameterSpec

Returns:

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

Redeclares javax.xml.crypto.AlgorithmMethod.getParameterSpec.

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

public Data

Returns:

the transformed data
transform
(Data
the data to be transformed
data
,
XMLCryptoContext
the XMLCryptoContext containing additional context (may be null if not applicable)
context
)

Transforms the specified data using the underlying transform algorithm.

public Data

Returns:

the transformed data (or null if the data was written to the OutputStream parameter)
transform
(Data
the data to be transformed
data
,
XMLCryptoContext
the XMLCryptoContext containing additional context (may be null if not applicable)
context
,
OutputStream
the OutputStream that should be used to write the transformed data to
os
)

Transforms the specified data using the underlying transform algorithm.

Inherited from javax.xml.crypto.AlgorithmMethod:
getAlgorithm
Inherited from javax.xml.crypto.XMLStructure:
isFeatureSupported

Field Detail

BASE64back to summary
public static final String BASE64

The Base64 transform algorithm URI.

ENVELOPEDback to summary
public static final String ENVELOPED

The Enveloped Signature transform algorithm URI.

XPATHback to summary
public static final String XPATH

The XPath transform algorithm URI.

XPATH2back to summary
public static final String XPATH2

The XPath Filter 2 transform algorithm URI.

XSLTback to summary
public static final String XSLT

The XSLT transform algorithm URI.

Method Detail

getParameterSpecback to summary
public AlgorithmParameterSpec getParameterSpec()

Redeclares javax.xml.crypto.AlgorithmMethod.getParameterSpec.

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

The returned parameters can be typecast to a TransformParameterSpec object.

Returns:AlgorithmParameterSpec

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

transformback to summary
public Data transform(Data data, XMLCryptoContext context) throws TransformException

Transforms the specified data using the underlying transform algorithm.

Parameters
data:Data

the data to be transformed

context:XMLCryptoContext

the XMLCryptoContext containing additional context (may be null if not applicable)

Returns:Data

the transformed data

Exceptions
TransformException:
if an error occurs while executing the transform
NullPointerException:
if data is null
transformback to summary
public Data transform(Data data, XMLCryptoContext context, OutputStream os) throws TransformException

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:Data

the data to be transformed

context:XMLCryptoContext

the XMLCryptoContext containing additional context (may be null if not applicable)

os:OutputStream

the OutputStream that should be used to write the transformed data to

Returns:Data

the transformed data (or null if the data was written to the OutputStream parameter)

Exceptions
TransformException:
if an error occurs while executing the transform
NullPointerException:
if data or os is null