Class Transforms
java.lang.Object
org.docx4j.org.apache.xml.security.utils.ElementProxy
org.docx4j.org.apache.xml.security.utils.SignatureElementProxy
org.docx4j.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,org.docx4j.org.apache.xml.security.signature.Reference
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringTRANSFORM_BASE64_DECODETransform - Required base64 decodingstatic java.lang.StringTRANSFORM_C14N_EXCL_OMIT_COMMENTSCanonicalization - Required Exclusive Canonicalization (omits comments)static java.lang.StringTRANSFORM_C14N_EXCL_WITH_COMMENTSCanonicalization - Recommended Exclusive Canonicalization with Commentsstatic java.lang.StringTRANSFORM_C14N_OMIT_COMMENTSCanonicalization - Required Canonical XML (omits comments)static java.lang.StringTRANSFORM_C14N_WITH_COMMENTSCanonicalization - Recommended Canonical XML with Commentsstatic java.lang.StringTRANSFORM_C14N11_OMIT_COMMENTSCanonicalization - Required Canonical XML 1.1 (omits comments)static java.lang.StringTRANSFORM_C14N11_WITH_COMMENTSCanonicalization - Recommended Canonical XML 1.1 with Commentsstatic java.lang.StringTRANSFORM_ENVELOPED_SIGNATURETransform - Required Enveloped Signaturestatic java.lang.StringTRANSFORM_XPATHTransform - Recommended XPathstatic java.lang.StringTRANSFORM_XPATH2FILTERTransform - XPath Filterstatic java.lang.StringTRANSFORM_XPOINTERTransform - XPointerstatic java.lang.StringTRANSFORM_XSLTTransform - Optional XSLT -
Constructor Summary
Constructors Modifier Constructor Description protectedTransforms()Transforms(org.w3c.dom.Document doc)ConstructsTransforms.Transforms(org.w3c.dom.Element element, java.lang.String baseURI) -
Method Summary
Modifier and Type Method Description voidaddTransform(java.lang.String transformURI)Adds theTransformwith the specifiedTransform algorithm URIvoidaddTransform(java.lang.String transformURI, org.w3c.dom.Element contextElement)Adds theTransformwith the specifiedTransform algorithm URIvoidaddTransform(java.lang.String transformURI, org.w3c.dom.NodeList contextNodes)Adds theTransformwith the specifiedTransform algorithm URI.java.lang.StringgetBaseLocalName()Returns the localname of the Elements of the sub-class.intgetLength()Return the nonnegative number of transformations.Transformitem(int i)Return thei th.TransformXMLSignatureInputperformTransforms(XMLSignatureInput xmlSignatureInput)Applies all includedTransforms to xmlSignatureInput and returns the result of these transformations.XMLSignatureInputperformTransforms(XMLSignatureInput xmlSignatureInput, java.io.OutputStream os)Applies all includedTransforms to xmlSignatureInput and returns the result of these transformations.voidsetSecureValidation(boolean secureValidation)Set whether secure validation is enabled or not.Methods inherited from class org.docx4j.org.apache.xml.security.utils.SignatureElementProxy
getBaseNamespaceMethods inherited from class org.docx4j.org.apache.xml.security.utils.ElementProxy
addBase64Element, addBase64Text, addBigIntegerElement, addReturnToSelf, addText, addTextElement, appendOther, appendSelf, appendSelf, createElementForFamily, createElementForFamilyLocal, createText, getBaseURI, getBigIntegerFromChildElement, getBytesFromTextChild, getDefaultPrefix, getDocument, getElement, getElementPlusReturns, getFirstChild, getLocalAttribute, getTextFromChildElement, getTextFromTextChild, length, registerDefaultPrefixes, setDefaultPrefix, setDocument, setElement, setElement, setLocalAttribute, setLocalIdAttribute, setXPathNamespaceContext
-
Field Details
-
TRANSFORM_C14N_OMIT_COMMENTS
public static final java.lang.String TRANSFORM_C14N_OMIT_COMMENTSCanonicalization - Required Canonical XML (omits comments)- See Also:
- Constant Field Values
-
TRANSFORM_C14N_WITH_COMMENTS
public static final java.lang.String TRANSFORM_C14N_WITH_COMMENTSCanonicalization - Recommended Canonical XML with Comments- See Also:
- Constant Field Values
-
TRANSFORM_C14N11_OMIT_COMMENTS
public static final java.lang.String TRANSFORM_C14N11_OMIT_COMMENTSCanonicalization - Required Canonical XML 1.1 (omits comments)- See Also:
- Constant Field Values
-
TRANSFORM_C14N11_WITH_COMMENTS
public static final java.lang.String TRANSFORM_C14N11_WITH_COMMENTSCanonicalization - Recommended Canonical XML 1.1 with Comments- See Also:
- Constant Field Values
-
TRANSFORM_C14N_EXCL_OMIT_COMMENTS
public static final java.lang.String TRANSFORM_C14N_EXCL_OMIT_COMMENTSCanonicalization - 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_COMMENTSCanonicalization - Recommended Exclusive Canonicalization with Comments- See Also:
- Constant Field Values
-
TRANSFORM_XSLT
public static final java.lang.String TRANSFORM_XSLTTransform - Optional XSLT- See Also:
- Constant Field Values
-
TRANSFORM_BASE64_DECODE
public static final java.lang.String TRANSFORM_BASE64_DECODETransform - Required base64 decoding- See Also:
- Constant Field Values
-
TRANSFORM_XPATH
public static final java.lang.String TRANSFORM_XPATHTransform - Recommended XPath- See Also:
- Constant Field Values
-
TRANSFORM_ENVELOPED_SIGNATURE
public static final java.lang.String TRANSFORM_ENVELOPED_SIGNATURETransform - Required Enveloped Signature- See Also:
- Constant Field Values
-
TRANSFORM_XPOINTER
public static final java.lang.String TRANSFORM_XPOINTERTransform - XPointer- See Also:
- Constant Field Values
-
TRANSFORM_XPATH2FILTER
public static final java.lang.String TRANSFORM_XPATH2FILTERTransform - XPath Filter- See Also:
- Constant Field Values
-
-
Constructor Details
-
Transforms
protected Transforms() -
Transforms
public Transforms(org.w3c.dom.Document doc)ConstructsTransforms.- Parameters:
doc- theDocumentin whichXMLSignaturewill be placed
-
Transforms
public Transforms(org.w3c.dom.Element element, java.lang.String baseURI) throws org.w3c.dom.DOMException, XMLSignatureException, InvalidTransformException, TransformationException, XMLSecurityException- Parameters:
element- isTransformselementbaseURI- the URI where the XML instance was stored- Throws:
org.w3c.dom.DOMExceptionInvalidTransformExceptionTransformationExceptionXMLSecurityExceptionXMLSignatureException
-
-
Method Details
-
setSecureValidation
public void setSecureValidation(boolean secureValidation)Set whether secure validation is enabled or not. The default is false. -
addTransform
Adds theTransformwith the specifiedTransform 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 TransformationExceptionAdds theTransformwith the specifiedTransform algorithm URI- Parameters:
transformURI- the URI form of transform that indicates which transformation is applied to datacontextElement-- Throws:
TransformationException
-
addTransform
public void addTransform(java.lang.String transformURI, org.w3c.dom.NodeList contextNodes) throws TransformationExceptionAdds theTransformwith the specifiedTransform algorithm URI.- Parameters:
transformURI- the URI form of transform that indicates which transformation is applied to datacontextNodes-- Throws:
TransformationException
-
performTransforms
public XMLSignatureInput performTransforms(XMLSignatureInput xmlSignatureInput) throws TransformationExceptionApplies all includedTransforms to xmlSignatureInput and returns the result of these transformations.- Parameters:
xmlSignatureInput- the input for theTransforms- Returns:
- the result of the
Transforms - Throws:
TransformationException
-
performTransforms
public XMLSignatureInput performTransforms(XMLSignatureInput xmlSignatureInput, java.io.OutputStream os) throws TransformationExceptionApplies all includedTransforms to xmlSignatureInput and returns the result of these transformations.- Parameters:
xmlSignatureInput- the input for theTransformsos- where to output the last transformation.- Returns:
- the result of the
Transforms - Throws:
TransformationException
-
getLength
public int getLength()Return the nonnegative number of transformations.- Returns:
- the number of transformations
-
item
- Parameters:
i- index ofTransformto return- Returns:
- the
i th Transform - Throws:
TransformationException
-
getBaseLocalName
public java.lang.String getBaseLocalName()Description copied from class:ElementProxyReturns the localname of the Elements of the sub-class.- Specified by:
getBaseLocalNamein classElementProxy- Returns:
- the localname of the Elements of the sub-class.
-