Package org.apache.xml.security.c14n
Class CanonicalizerSpi
java.lang.Object
org.apache.xml.security.c14n.CanonicalizerSpi
- Direct Known Subclasses:
CanonicalizerBase
Base class which all Canonicalization algorithms extend.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanReset the writer after a c14nprotected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]engineCanonicalize(byte[] inputBytes) Method canonicalizeabstract byte[]engineCanonicalizeSubTree(Node rootNode) C14n a node tree.abstract byte[]engineCanonicalizeSubTree(Node rootNode, String inclusiveNamespaces) C14n a node tree.abstract byte[]engineCanonicalizeSubTree(Node rootNode, String inclusiveNamespaces, boolean propagateDefaultNamespace) C14n a node tree.abstract byte[]engineCanonicalizeXPathNodeSet(Set<Node> xpathNodeSet) C14n a nodesetabstract byte[]engineCanonicalizeXPathNodeSet(Set<Node> xpathNodeSet, String inclusiveNamespaces) C14n a nodesetbyte[]engineCanonicalizeXPathNodeSet(NodeList xpathNodeSet) Method engineCanonicalizeXPathNodeSetbyte[]engineCanonicalizeXPathNodeSet(NodeList xpathNodeSet, String inclusiveNamespaces) Method engineCanonicalizeXPathNodeSetabstract booleanReturns true if comments are includedabstract StringReturns the URI of this engine.booleanvoidsetSecureValidation(boolean secureValidation) abstract voidSets the writer where the canonicalization ends.
-
Field Details
-
reset
protected boolean resetReset the writer after a c14n -
secureValidation
protected boolean secureValidation
-
-
Constructor Details
-
CanonicalizerSpi
public CanonicalizerSpi()
-
-
Method Details
-
engineCanonicalize
public byte[] engineCanonicalize(byte[] inputBytes) throws ParserConfigurationException, IOException, SAXException, CanonicalizationException Method canonicalize- Parameters:
inputBytes-- Returns:
- the c14n bytes.
- Throws:
CanonicalizationExceptionIOExceptionParserConfigurationExceptionSAXException
-
engineCanonicalizeXPathNodeSet
public byte[] engineCanonicalizeXPathNodeSet(NodeList xpathNodeSet) throws CanonicalizationException Method engineCanonicalizeXPathNodeSet- Parameters:
xpathNodeSet-- Returns:
- the c14n bytes
- Throws:
CanonicalizationException
-
engineCanonicalizeXPathNodeSet
public byte[] engineCanonicalizeXPathNodeSet(NodeList xpathNodeSet, String inclusiveNamespaces) throws CanonicalizationException Method engineCanonicalizeXPathNodeSet- Parameters:
xpathNodeSet-inclusiveNamespaces-- Returns:
- the c14n bytes
- Throws:
CanonicalizationException
-
engineGetURI
Returns the URI of this engine.- Returns:
- the URI
-
engineGetIncludeComments
public abstract boolean engineGetIncludeComments()Returns true if comments are included- Returns:
- true if comments are included
-
engineCanonicalizeXPathNodeSet
public abstract byte[] engineCanonicalizeXPathNodeSet(Set<Node> xpathNodeSet) throws CanonicalizationException C14n a nodeset- Parameters:
xpathNodeSet-- Returns:
- the c14n bytes
- Throws:
CanonicalizationException
-
engineCanonicalizeXPathNodeSet
public abstract byte[] engineCanonicalizeXPathNodeSet(Set<Node> xpathNodeSet, String inclusiveNamespaces) throws CanonicalizationException C14n a nodeset- Parameters:
xpathNodeSet-inclusiveNamespaces-- Returns:
- the c14n bytes
- Throws:
CanonicalizationException
-
engineCanonicalizeSubTree
C14n a node tree.- Parameters:
rootNode-- Returns:
- the c14n bytes
- Throws:
CanonicalizationException
-
engineCanonicalizeSubTree
public abstract byte[] engineCanonicalizeSubTree(Node rootNode, String inclusiveNamespaces) throws CanonicalizationException C14n a node tree.- Parameters:
rootNode-inclusiveNamespaces-- Returns:
- the c14n bytes
- Throws:
CanonicalizationException
-
engineCanonicalizeSubTree
public abstract byte[] engineCanonicalizeSubTree(Node rootNode, String inclusiveNamespaces, boolean propagateDefaultNamespace) throws CanonicalizationException C14n a node tree.- Parameters:
rootNode-inclusiveNamespaces-propagateDefaultNamespace- If true the default namespace will be propagated to the c14n-ized root element- Returns:
- the c14n bytes
- Throws:
CanonicalizationException
-
setWriter
Sets the writer where the canonicalization ends. ByteArrayOutputStream if none is set.- Parameters:
os-
-
isSecureValidation
public boolean isSecureValidation() -
setSecureValidation
public void setSecureValidation(boolean secureValidation)
-