public 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 |
---|---|
byte[] |
canonicalize(byte[] inputBytes)
This method tries to canonicalize the given bytes.
|
byte[] |
canonicalizeSubtree(Node node)
Canonicalizes the subtree rooted by
node . |
byte[] |
canonicalizeSubtree(Node node,
String inclusiveNamespaces)
Canonicalizes the subtree rooted by
node . |
byte[] |
canonicalizeSubtree(Node node,
String inclusiveNamespaces,
boolean propagateDefaultNamespace)
Canonicalizes the subtree rooted by
node . |
byte[] |
canonicalizeXPathNodeSet(NodeList xpathNodeSet)
Canonicalizes an XPath node set.
|
byte[] |
canonicalizeXPathNodeSet(NodeList xpathNodeSet,
String inclusiveNamespaces)
Canonicalizes an XPath node set.
|
byte[] |
canonicalizeXPathNodeSet(Set<Node> xpathNodeSet)
Canonicalizes an XPath node set.
|
byte[] |
canonicalizeXPathNodeSet(Set<Node> xpathNodeSet,
String inclusiveNamespaces)
Canonicalizes an XPath node set.
|
String |
getImplementingCanonicalizerClass()
Returns the name of the implementing
CanonicalizerSpi class |
boolean |
getIncludeComments()
Method getIncludeComments
|
static Canonicalizer |
getInstance(String algorithmURI)
Method getInstance
|
String |
getURI()
Method getURI
|
boolean |
isSecureValidation() |
void |
notReset()
Set the canonicalizer behaviour to not reset.
|
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.
|
void |
setSecureValidation(boolean secureValidation) |
void |
setWriter(OutputStream os)
Sets the writer where the canonicalization ends.
|
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 final String getURI()
public boolean getIncludeComments()
public byte[] canonicalize(byte[] inputBytes) throws ParserConfigurationException, IOException, SAXException, CanonicalizationException
>a<...>/a<
.inputBytes
- CanonicalizationException
IOException
ParserConfigurationException
SAXException
public byte[] canonicalizeSubtree(Node node) throws CanonicalizationException
node
.node
- The node to canonicalizeCanonicalizationException
public byte[] canonicalizeSubtree(Node node, String inclusiveNamespaces) throws CanonicalizationException
node
.node
- inclusiveNamespaces
- CanonicalizationException
public byte[] canonicalizeSubtree(Node node, String inclusiveNamespaces, boolean propagateDefaultNamespace) throws CanonicalizationException
node
.node
- inclusiveNamespaces
- CanonicalizationException
public byte[] canonicalizeXPathNodeSet(NodeList xpathNodeSet) throws CanonicalizationException
xpathNodeSet
is treated
as a list of XPath nodes, not as a list of subtrees.xpathNodeSet
- CanonicalizationException
public byte[] canonicalizeXPathNodeSet(NodeList xpathNodeSet, String inclusiveNamespaces) throws CanonicalizationException
xpathNodeSet
is treated
as a list of XPath nodes, not as a list of subtrees.xpathNodeSet
- inclusiveNamespaces
- CanonicalizationException
public byte[] canonicalizeXPathNodeSet(Set<Node> xpathNodeSet) throws CanonicalizationException
xpathNodeSet
- CanonicalizationException
public byte[] canonicalizeXPathNodeSet(Set<Node> xpathNodeSet, String inclusiveNamespaces) throws CanonicalizationException
xpathNodeSet
- inclusiveNamespaces
- CanonicalizationException
public void setWriter(OutputStream os)
os
- public String getImplementingCanonicalizerClass()
CanonicalizerSpi
classCanonicalizerSpi
classpublic void notReset()
public boolean isSecureValidation()
public void setSecureValidation(boolean secureValidation)
Copyright © 2007-2018. All Rights Reserved.