org.apache.xml.security.transforms
Class Transforms

java.lang.Object
  |
  +--org.apache.xml.security.utils.ElementProxy
        |
        +--org.apache.xml.security.utils.SignatureElementProxy
              |
              +--org.apache.xml.security.transforms.Transforms

public class Transforms
extends SignatureElementProxy

Holder of the Transform steps to be performed on the data. The input to the first Transform is the result of dereferencing the URI attribute of the Reference element. The output from the last Transform is the input for the DigestMethod algorithm

Author:
Christian Geuer-Pollmann
See Also:
Transform, Reference

Field Summary
static java.lang.String TRANSFORM_BASE64_DECODE
          Transform - Required base64 decoding
static java.lang.String TRANSFORM_C14N_EXCL_OMIT_COMMENTS
          Canonicalization - Required Exclusive Canonicalization (omits comments)
static java.lang.String TRANSFORM_C14N_EXCL_WITH_COMMENTS
          Canonicalization - Recommended Exclusive Canonicalization with Comments
static java.lang.String TRANSFORM_C14N_OMIT_COMMENTS
          Canonicalization - Required Canonical XML (omits comments)
static java.lang.String TRANSFORM_C14N_WITH_COMMENTS
          Canonicalization - Recommended Canonical XML with Comments
static java.lang.String TRANSFORM_ENVELOPED_SIGNATURE
          Transform - Required Enveloped Signature
static java.lang.String TRANSFORM_XPATH
          Transform - Recommended XPath
static java.lang.String TRANSFORM_XPATH2FILTER
           
static java.lang.String TRANSFORM_XPATH2FILTER04
          Transform - XPath Filter v2.0
static java.lang.String TRANSFORM_XPATHFILTERCHGP
           
static java.lang.String TRANSFORM_XPOINTER
          Transform - XPointer
static java.lang.String TRANSFORM_XSLT
          Transform - Optional XSLT
 
Fields inherited from class org.apache.xml.security.utils.ElementProxy
_baseURI, _constructionElement, _doc, _state, MODE_CREATE, MODE_DECRYPT, MODE_ENCRYPT, MODE_PROCESS, MODE_SIGN, MODE_UNKNOWN, MODE_VERIFY
 
Constructor Summary
Transforms(org.w3c.dom.Document doc)
          Consturcts Transforms
Transforms(org.w3c.dom.Element element, java.lang.String BaseURI)
          Consturcts Transforms from Element which is Transforms Element
 
Method Summary
 void addTransform(java.lang.String transformURI)
          Adds the Transform with the specified Transform algorithm URI
 void addTransform(java.lang.String transformURI, org.w3c.dom.Element contextElement)
          Adds the Transform with the specified Transform algorithm URI
 void addTransform(java.lang.String transformURI, org.w3c.dom.NodeList contextNodes)
          Adds the Transform with the specified Transform algorithm URI
 java.lang.String getBaseLocalName()
          Returns the localname of the Elements of the sub-class.
 int getLength()
          Return the nonnegative number of transformations.
 Transform item(int i)
          Return the ith Transform.
 XMLSignatureInput performTransforms(XMLSignatureInput xmlSignatureInput)
          Applies all included Transforms to xmlSignatureInput and returns the result of these transformations.
 
Methods inherited from class org.apache.xml.security.utils.SignatureElementProxy
getBaseNamespace
 
Methods inherited from class org.apache.xml.security.utils.ElementProxy
addBase64Element, addBase64Text, addBigIntegerElement, addText, addTextElement, createElementForFamily, getBaseURI, getBigIntegerFromChildElement, getBytesFromChildElement, getBytesFromTextChild, getChildElementLocalName, getDefaultPrefix, getDocument, getElement, getElementPlusReturns, getTextFromChildElement, getTextFromTextChild, guaranteeThatElementInCorrectSpace, length, setDefaultPrefix, setElement, setXPathNamespaceContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRANSFORM_C14N_OMIT_COMMENTS

public static final java.lang.String TRANSFORM_C14N_OMIT_COMMENTS
Canonicalization - Required Canonical XML (omits comments)

See Also:
Constant Field Values

TRANSFORM_C14N_WITH_COMMENTS

public static final java.lang.String TRANSFORM_C14N_WITH_COMMENTS
Canonicalization - Recommended Canonical XML with Comments

See Also:
Constant Field Values

TRANSFORM_C14N_EXCL_OMIT_COMMENTS

public static final java.lang.String TRANSFORM_C14N_EXCL_OMIT_COMMENTS
Canonicalization - Required Exclusive Canonicalization (omits comments)

See Also:
Constant Field Values

TRANSFORM_C14N_EXCL_WITH_COMMENTS

public static final java.lang.String TRANSFORM_C14N_EXCL_WITH_COMMENTS
Canonicalization - Recommended Exclusive Canonicalization with Comments

See Also:
Constant Field Values

TRANSFORM_XSLT

public static final java.lang.String TRANSFORM_XSLT
Transform - Optional XSLT

See Also:
Constant Field Values

TRANSFORM_BASE64_DECODE

public static final java.lang.String TRANSFORM_BASE64_DECODE
Transform - Required base64 decoding

See Also:
Constant Field Values

TRANSFORM_XPATH

public static final java.lang.String TRANSFORM_XPATH
Transform - Recommended XPath

See Also:
Constant Field Values

TRANSFORM_ENVELOPED_SIGNATURE

public static final java.lang.String TRANSFORM_ENVELOPED_SIGNATURE
Transform - Required Enveloped Signature

See Also:
Constant Field Values

TRANSFORM_XPOINTER

public static final java.lang.String TRANSFORM_XPOINTER
Transform - XPointer

See Also:
Constant Field Values

TRANSFORM_XPATH2FILTER04

public static final java.lang.String TRANSFORM_XPATH2FILTER04
Transform - XPath Filter v2.0

See Also:
Constant Field Values

TRANSFORM_XPATH2FILTER

public static final java.lang.String TRANSFORM_XPATH2FILTER
See Also:
Constant Field Values

TRANSFORM_XPATHFILTERCHGP

public static final java.lang.String TRANSFORM_XPATHFILTERCHGP
See Also:
Constant Field Values
Constructor Detail

Transforms

public Transforms(org.w3c.dom.Document doc)
Consturcts Transforms

Parameters:
doc - the Document in which XMLsignature will be placed

Transforms

public Transforms(org.w3c.dom.Element element,
                  java.lang.String BaseURI)
           throws org.w3c.dom.DOMException,
                  XMLSignatureException,
                  InvalidTransformException,
                  TransformationException,
                  XMLSecurityException
Consturcts Transforms from Element which is Transforms Element

Parameters:
element - is Transforms element
BaseURI - the URI where the XML instance was stored
Throws:
org.w3c.dom.DOMException
InvalidTransformException
TransformationException
XMLSecurityException
XMLSignatureException
Method Detail

addTransform

public void addTransform(java.lang.String transformURI)
                  throws TransformationException
Adds the Transform with the specified Transform algorithm URI

Parameters:
transformURI - the URI form of transform that indicates which transformation is applied to data
Throws:
TransformationException

addTransform

public void addTransform(java.lang.String transformURI,
                         org.w3c.dom.Element contextElement)
                  throws TransformationException
Adds the Transform with the specified Transform algorithm URI

Parameters:
transformURI - the URI form of transform that indicates which transformation is applied to data
contextElement -
Throws:
TransformationException
See Also:
Transform.getInstance(Document doc, String algorithmURI, Element childElement)

addTransform

public void addTransform(java.lang.String transformURI,
                         org.w3c.dom.NodeList contextNodes)
                  throws TransformationException
Adds the Transform with the specified Transform algorithm URI

Parameters:
transformURI - the URI form of transform that indicates which transformation is applied to data
contextNodes -
Throws:
TransformationException
See Also:
Transform.getInstance(Document doc, String algorithmURI, NodeList contextNodes)

performTransforms

public XMLSignatureInput performTransforms(XMLSignatureInput xmlSignatureInput)
                                    throws TransformationException
Applies all included Transforms to xmlSignatureInput and returns the result of these transformations.

Parameters:
xmlSignatureInput - the input for the Transforms
Returns:
the result of the Transforms
Throws:
TransformationException

getLength

public int getLength()
              throws TransformationException
Return the nonnegative number of transformations.

Returns:
the number of transformations
Throws:
TransformationException

item

public Transform item(int i)
               throws TransformationException
Return the ith Transform. Valid i values are 0 to getLength()-1.

Parameters:
i - index of Transform to return
Returns:
the ith transforms
Throws:
TransformationException

getBaseLocalName

public java.lang.String getBaseLocalName()
Description copied from class: ElementProxy
Returns the localname of the Elements of the sub-class.

Specified by:
getBaseLocalName in class ElementProxy
Returns:
the localname of the Elements of the sub-class.