public final class Canonicalizer extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ALGO_ID_C14N_EXCL_OMIT_COMMENTS
The URL defined in XML-SEC Rec for exclusive c14n without comments.
|
static String |
ALGO_ID_C14N_EXCL_WITH_COMMENTS
The URL defined in XML-SEC Rec for exclusive c14n with comments.
|
static String |
ALGO_ID_C14N_OMIT_COMMENTS
The URL defined in XML-SEC Rec for inclusive c14n without comments.
|
static String |
ALGO_ID_C14N_PHYSICAL
Non-standard algorithm to serialize the physical representation for XML Encryption
|
static String |
ALGO_ID_C14N_WITH_COMMENTS
The URL defined in XML-SEC Rec for inclusive c14n with comments.
|
static String |
ALGO_ID_C14N11_OMIT_COMMENTS
The URI for inclusive c14n 1.1 without comments.
|
static String |
ALGO_ID_C14N11_WITH_COMMENTS
The URI for inclusive c14n 1.1 with comments.
|
static String |
ENCODING
The output encoding of canonicalized data
|
static String |
XPATH_C14N_WITH_COMMENTS_SINGLE_NODE
XPath Expression for selecting every node and continuous comments joined
in only one node
|
Modifier and Type | Method and Description |
---|---|
void |
canonicalize(byte[] inputBytes,
OutputStream writer,
boolean secureValidation)
This method tries to canonicalize the given bytes.
|
void |
canonicalizeSubtree(Node node,
OutputStream writer)
Canonicalizes the subtree rooted by
node . |
void |
canonicalizeSubtree(Node node,
String inclusiveNamespaces,
boolean propagateDefaultNamespace,
OutputStream writer)
Canonicalizes the subtree rooted by
node . |
void |
canonicalizeSubtree(Node node,
String inclusiveNamespaces,
OutputStream writer)
Canonicalizes the subtree rooted by
node . |
void |
canonicalizeXPathNodeSet(Set<Node> xpathNodeSet,
OutputStream writer)
Canonicalizes an XPath node set.
|
void |
canonicalizeXPathNodeSet(Set<Node> xpathNodeSet,
String inclusiveNamespaces,
OutputStream writer)
Canonicalizes an XPath node set.
|
static Canonicalizer |
getInstance(String algorithmURI)
Method getInstance
|
static void |
register(String algorithmURI,
Class<? extends CanonicalizerSpi> implementingClass)
Method register
|
static void |
register(String algorithmURI,
String implementingClass)
Method register
|
static void |
registerDefaultAlgorithms()
This method registers the default algorithms.
|
public static final String ENCODING
public static final String XPATH_C14N_WITH_COMMENTS_SINGLE_NODE
public static final String ALGO_ID_C14N_OMIT_COMMENTS
public static final String ALGO_ID_C14N_WITH_COMMENTS
public static final String ALGO_ID_C14N_EXCL_OMIT_COMMENTS
public static final String ALGO_ID_C14N_EXCL_WITH_COMMENTS
public static final String ALGO_ID_C14N11_OMIT_COMMENTS
public static final String ALGO_ID_C14N11_WITH_COMMENTS
public static final String ALGO_ID_C14N_PHYSICAL
public static final Canonicalizer getInstance(String algorithmURI) throws InvalidCanonicalizerException
algorithmURI
- InvalidCanonicalizerException
public static void register(String algorithmURI, String implementingClass) throws AlgorithmAlreadyRegisteredException, ClassNotFoundException
algorithmURI
- implementingClass
- AlgorithmAlreadyRegisteredException
SecurityException
- if a security manager is installed and the
caller does not have permission to register the canonicalizerClassNotFoundException
public static void register(String algorithmURI, Class<? extends CanonicalizerSpi> implementingClass) throws AlgorithmAlreadyRegisteredException, ClassNotFoundException
algorithmURI
- implementingClass
- AlgorithmAlreadyRegisteredException
SecurityException
- if a security manager is installed and the
caller does not have permission to register the canonicalizerClassNotFoundException
public static void registerDefaultAlgorithms()
public void canonicalize(byte[] inputBytes, OutputStream writer, boolean secureValidation) throws XMLParserException, IOException, CanonicalizationException
>a<...>/a<
.inputBytes
- writer
- OutputStream to write the canonicalization resultsecureValidation
- Whether secure validation is enabledCanonicalizationException
IOException
XMLParserException
public void canonicalizeSubtree(Node node, OutputStream writer) throws CanonicalizationException
node
.node
- The node to canonicalizewriter
- OutputStream to write the canonicalization resultCanonicalizationException
public void canonicalizeSubtree(Node node, String inclusiveNamespaces, OutputStream writer) throws CanonicalizationException
node
.node
- inclusiveNamespaces
- writer
- OutputStream to write the canonicalization resultCanonicalizationException
public void canonicalizeSubtree(Node node, String inclusiveNamespaces, boolean propagateDefaultNamespace, OutputStream writer) throws CanonicalizationException
node
.node
- inclusiveNamespaces
- writer
- OutputStream to write the canonicalization resultCanonicalizationException
public void canonicalizeXPathNodeSet(Set<Node> xpathNodeSet, OutputStream writer) throws CanonicalizationException
xpathNodeSet
- writer
- OutputStream to write the canonicalization resultCanonicalizationException
public void canonicalizeXPathNodeSet(Set<Node> xpathNodeSet, String inclusiveNamespaces, OutputStream writer) throws CanonicalizationException
xpathNodeSet
- inclusiveNamespaces
- writer
- OutputStream to write the canonicalization resultCanonicalizationException
Copyright © 2000–2020 The Apache Software Foundation. All rights reserved.