Class Transforms
java.lang.Object
org.apache.xml.security.utils.ElementProxy
org.apache.xml.security.utils.SignatureElementProxy
org.apache.xml.security.transforms.Transforms
- Direct Known Subclasses:
XMLCipher.Factory.TransformsImpl
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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.slf4j.Logger
private boolean
static final String
Transform - Required base64 decodingstatic final String
Canonicalization - Required Exclusive Canonicalization (omits comments)static final String
Canonicalization - Recommended Exclusive Canonicalization with Commentsstatic final String
Canonicalization - Required Canonical XML (omits comments)static final String
Canonicalization - Recommended Canonical XML with Commentsstatic final String
Canonicalization - Required Canonical XML 1.1 (omits comments)static final String
Canonicalization - Recommended Canonical XML 1.1 with Commentsstatic final String
Transform - Required Enveloped Signaturestatic final String
Transform - Recommended XPathstatic final String
Transform - XPath Filterstatic final String
Transform - XPointerstatic final String
Transform - Optional XSLTprivate Element[]
Fields inherited from class org.apache.xml.security.utils.ElementProxy
baseURI
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Transforms
(Document doc) ConstructsTransforms
.Transforms
(Element element, String baseURI) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addTransform
(String transformURI) Adds theTransform
with the specifiedTransform algorithm URI
void
addTransform
(String transformURI, Element contextElement) Adds theTransform
with the specifiedTransform algorithm URI
void
addTransform
(String transformURI, NodeList contextNodes) Adds theTransform
with the specifiedTransform algorithm URI
.private void
addTransform
(Transform transform) Adds a user-provided Transform step.private void
checkSecureValidation
(Transform transform) Returns the localname of the Elements of the sub-class.int
Return the nonnegative number of transformations.private void
item
(int i) Return the ith
.Transform
performTransforms
(XMLSignatureInput xmlSignatureInput) Applies all includedTransform
s to xmlSignatureInput and returns the result of these transformations.performTransforms
(XMLSignatureInput xmlSignatureInput, OutputStream os) Applies all includedTransform
s to xmlSignatureInput and returns the result of these transformations.void
setSecureValidation
(boolean secureValidation) Set whether secure validation is enabled or not.Methods inherited from class org.apache.xml.security.utils.SignatureElementProxy
getBaseNamespace
Methods inherited from class 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
Canonicalization - Required Canonical XML (omits comments)- See Also:
-
TRANSFORM_C14N_WITH_COMMENTS
Canonicalization - Recommended Canonical XML with Comments- See Also:
-
TRANSFORM_C14N11_OMIT_COMMENTS
Canonicalization - Required Canonical XML 1.1 (omits comments)- See Also:
-
TRANSFORM_C14N11_WITH_COMMENTS
Canonicalization - Recommended Canonical XML 1.1 with Comments- See Also:
-
TRANSFORM_C14N_EXCL_OMIT_COMMENTS
Canonicalization - Required Exclusive Canonicalization (omits comments)- See Also:
-
TRANSFORM_C14N_EXCL_WITH_COMMENTS
Canonicalization - Recommended Exclusive Canonicalization with Comments- See Also:
-
TRANSFORM_XSLT
Transform - Optional XSLT- See Also:
-
TRANSFORM_BASE64_DECODE
Transform - Required base64 decoding- See Also:
-
TRANSFORM_XPATH
Transform - Recommended XPath- See Also:
-
TRANSFORM_ENVELOPED_SIGNATURE
Transform - Required Enveloped Signature- See Also:
-
TRANSFORM_XPOINTER
Transform - XPointer- See Also:
-
TRANSFORM_XPATH2FILTER
Transform - XPath Filter- See Also:
-
LOG
private static final org.slf4j.Logger LOG -
transforms
-
secureValidation
private boolean secureValidation
-
-
Constructor Details
-
Transforms
protected Transforms() -
Transforms
ConstructsTransforms
.- Parameters:
doc
- theDocument
in whichXMLSignature
will be placed
-
Transforms
public Transforms(Element element, String baseURI) throws DOMException, XMLSignatureException, InvalidTransformException, TransformationException, XMLSecurityException - Parameters:
element
- isTransforms
elementbaseURI
- the URI where the XML instance was stored- Throws:
DOMException
InvalidTransformException
TransformationException
XMLSecurityException
XMLSignatureException
-
-
Method Details
-
setSecureValidation
public void setSecureValidation(boolean secureValidation) Set whether secure validation is enabled or not. The default is false. -
addTransform
Adds theTransform
with 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(String transformURI, Element contextElement) throws TransformationException Adds theTransform
with the specifiedTransform algorithm URI
- Parameters:
transformURI
- the URI form of transform that indicates which transformation is applied to datacontextElement
-- Throws:
TransformationException
-
addTransform
Adds theTransform
with the specifiedTransform algorithm URI
.- Parameters:
transformURI
- the URI form of transform that indicates which transformation is applied to datacontextNodes
-- Throws:
TransformationException
-
addTransform
Adds a user-provided Transform step.- Parameters:
transform
-Transform
object
-
performTransforms
public XMLSignatureInput performTransforms(XMLSignatureInput xmlSignatureInput) throws TransformationException Applies all includedTransform
s to xmlSignatureInput and returns the result of these transformations.- Parameters:
xmlSignatureInput
- the input for theTransform
s- Returns:
- the result of the
Transforms
- Throws:
TransformationException
-
performTransforms
public XMLSignatureInput performTransforms(XMLSignatureInput xmlSignatureInput, OutputStream os) throws TransformationException Applies all includedTransform
s to xmlSignatureInput and returns the result of these transformations.- Parameters:
xmlSignatureInput
- the input for theTransform
sos
- where to output the last transformation.- Returns:
- the result of the
Transforms
- Throws:
TransformationException
-
checkSecureValidation
- Throws:
TransformationException
-
getLength
public int getLength()Return the nonnegative number of transformations.- Returns:
- the number of transformations
-
item
- Parameters:
i
- index ofTransform
to return- Returns:
- the ith Transform
- Throws:
TransformationException
-
initTransforms
private void initTransforms() -
getBaseLocalName
Returns the localname of the Elements of the sub-class.- Specified by:
getBaseLocalName
in classElementProxy
- Returns:
- the localname of the Elements of the sub-class.
-