APIdia Launch Partner
Top Fields Constructors Methods
com.sun.org.apache.xml.internal.security.c14n

public final Class Canonicalizer

extends Object
Class Inheritance
Imports
java.io.OutputStream, java.nio.charset.StandardCharsets, java.util.Map, .Set, java.util.concurrent.ConcurrentHashMap, com.sun.org.apache.xml.internal.security.c14n.implementations.Canonicalizer11_OmitComments, .Canonicalizer11_WithComments, .Canonicalizer20010315ExclOmitComments, .Canonicalizer20010315ExclWithComments, .Canonicalizer20010315OmitComments, .Canonicalizer20010315WithComments, .CanonicalizerPhysical, com.sun.org.apache.xml.internal.security.exceptions.AlgorithmAlreadyRegisteredException, com.sun.org.apache.xml.internal.security.parser.XMLParserException, com.sun.org.apache.xml.internal.security.utils.JavaUtils, org.w3c.dom.Node

Field Summary

Modifier and TypeField and Description
public static final String
ALGO_ID_C14N11_OMIT_COMMENTS

The URI for inclusive c14n 1.1 without comments.

public static final String
ALGO_ID_C14N11_WITH_COMMENTS

The URI for inclusive c14n 1.1 with comments.

public static final String
ALGO_ID_C14N_EXCL_OMIT_COMMENTS

The URL defined in XML-SEC Rec for exclusive c14n without comments.

public static final String
ALGO_ID_C14N_EXCL_WITH_COMMENTS

The URL defined in XML-SEC Rec for exclusive c14n with comments.

public static final String
ALGO_ID_C14N_OMIT_COMMENTS

The URL defined in XML-SEC Rec for inclusive c14n without comments.

public static final String
ALGO_ID_C14N_PHYSICAL

Non-standard algorithm to serialize the physical representation for XML Encryption

public static final String
ALGO_ID_C14N_WITH_COMMENTS

The URL defined in XML-SEC Rec for inclusive c14n with comments.

private static Map<String, Class<? extends CanonicalizerSpi>>
private final CanonicalizerSpi
public static final String
ENCODING

The output encoding of canonicalized data

public static final String
XPATH_C14N_WITH_COMMENTS_SINGLE_NODE

XPath Expression for selecting every node and continuous comments joined in only one node

Constructor Summary

AccessConstructor and Description
private
Canonicalizer(String algorithmURI)

Constructor Canonicalizer

Method Summary

Modifier and TypeMethod and Description
public void
canonicalize(byte[] inputBytes, OutputStream
OutputStream to write the canonicalization result
writer
,
boolean
Whether secure validation is enabled
secureValidation
)

This method tries to canonicalize the given bytes.

public void
canonicalizeSubtree(Node
The node to canonicalize
node
,
OutputStream
OutputStream to write the canonicalization result
writer
)

Canonicalizes the subtree rooted by node.

public void
canonicalizeSubtree(Node node, String inclusiveNamespaces, OutputStream
OutputStream to write the canonicalization result
writer
)

Canonicalizes the subtree rooted by node.

public void
canonicalizeSubtree(Node node, String inclusiveNamespaces, boolean propagateDefaultNamespace, OutputStream
OutputStream to write the canonicalization result
writer
)

Canonicalizes the subtree rooted by node.

public void
canonicalizeXPathNodeSet(Set<Node> xpathNodeSet, OutputStream
OutputStream to write the canonicalization result
writer
)

Canonicalizes an XPath node set.

public void
canonicalizeXPathNodeSet(Set<Node> xpathNodeSet, String inclusiveNamespaces, OutputStream
OutputStream to write the canonicalization result
writer
)

Canonicalizes an XPath node set.

public static Canonicalizer

Returns:

a Canonicalizer instance ready for the job
getInstance
(String algorithmURI)

Method getInstance

public static void
register(String algorithmURI, String implementingClass)

Method register

public static void
register(String algorithmURI, Class<? extends CanonicalizerSpi> implementingClass)

Method register

public static void
registerDefaultAlgorithms()

This method registers the default algorithms.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ALGO_ID_C14N11_OMIT_COMMENTSback to summary
public static final String ALGO_ID_C14N11_OMIT_COMMENTS

The URI for inclusive c14n 1.1 without comments.

ALGO_ID_C14N11_WITH_COMMENTSback to summary
public static final String ALGO_ID_C14N11_WITH_COMMENTS

The URI for inclusive c14n 1.1 with comments.

ALGO_ID_C14N_EXCL_OMIT_COMMENTSback to summary
public static final String ALGO_ID_C14N_EXCL_OMIT_COMMENTS

The URL defined in XML-SEC Rec for exclusive c14n without comments.

ALGO_ID_C14N_EXCL_WITH_COMMENTSback to summary
public static final String ALGO_ID_C14N_EXCL_WITH_COMMENTS

The URL defined in XML-SEC Rec for exclusive c14n with comments.

ALGO_ID_C14N_OMIT_COMMENTSback to summary
public static final String ALGO_ID_C14N_OMIT_COMMENTS

The URL defined in XML-SEC Rec for inclusive c14n without comments.

ALGO_ID_C14N_PHYSICALback to summary
public static final String ALGO_ID_C14N_PHYSICAL

Non-standard algorithm to serialize the physical representation for XML Encryption

ALGO_ID_C14N_WITH_COMMENTSback to summary
public static final String ALGO_ID_C14N_WITH_COMMENTS

The URL defined in XML-SEC Rec for inclusive c14n with comments.

canonicalizerHashback to summary
private static Map<String, Class<? extends CanonicalizerSpi>> canonicalizerHash
canonicalizerSpiback to summary
private final CanonicalizerSpi canonicalizerSpi
ENCODINGback to summary
public static final String ENCODING

The output encoding of canonicalized data

XPATH_C14N_WITH_COMMENTS_SINGLE_NODEback to summary
public static final String XPATH_C14N_WITH_COMMENTS_SINGLE_NODE

XPath Expression for selecting every node and continuous comments joined in only one node

Constructor Detail

Canonicalizerback to summary
private Canonicalizer(String algorithmURI) throws InvalidCanonicalizerException

Constructor Canonicalizer

Method Detail

canonicalizeback to summary
public void canonicalize(byte[] inputBytes, OutputStream writer, boolean secureValidation) throws XMLParserException, IOException, CanonicalizationException

This method tries to canonicalize the given bytes. It's possible to even canonicalize non-wellformed sequences if they are well-formed after being wrapped with a >a<...>/a<.

Parameters
writer:OutputStream

OutputStream to write the canonicalization result

secureValidation:boolean

Whether secure validation is enabled

canonicalizeSubtreeback to summary
public void canonicalizeSubtree(Node node, OutputStream writer) throws CanonicalizationException

Canonicalizes the subtree rooted by node.

Parameters
node:Node

The node to canonicalize

writer:OutputStream

OutputStream to write the canonicalization result

canonicalizeSubtreeback to summary
public void canonicalizeSubtree(Node node, String inclusiveNamespaces, OutputStream writer) throws CanonicalizationException

Canonicalizes the subtree rooted by node.

Parameters
writer:OutputStream

OutputStream to write the canonicalization result

canonicalizeSubtreeback to summary
public void canonicalizeSubtree(Node node, String inclusiveNamespaces, boolean propagateDefaultNamespace, OutputStream writer) throws CanonicalizationException

Canonicalizes the subtree rooted by node.

Parameters
writer:OutputStream

OutputStream to write the canonicalization result

canonicalizeXPathNodeSetback to summary
public void canonicalizeXPathNodeSet(Set<Node> xpathNodeSet, OutputStream writer) throws CanonicalizationException

Canonicalizes an XPath node set.

Parameters
writer:OutputStream

OutputStream to write the canonicalization result

canonicalizeXPathNodeSetback to summary
public void canonicalizeXPathNodeSet(Set<Node> xpathNodeSet, String inclusiveNamespaces, OutputStream writer) throws CanonicalizationException

Canonicalizes an XPath node set.

Parameters
writer:OutputStream

OutputStream to write the canonicalization result

getInstanceback to summary
public static Canonicalizer getInstance(String algorithmURI) throws InvalidCanonicalizerException

Method getInstance

Returns:Canonicalizer

a Canonicalizer instance ready for the job

registerback to summary
public static void register(String algorithmURI, String implementingClass) throws AlgorithmAlreadyRegisteredException, ClassNotFoundException

Method register

Annotations
@SuppressWarnings:unchecked
Exceptions
SecurityException:
if a security manager is installed and the caller does not have permission to register the canonicalizer
registerback to summary
public static void register(String algorithmURI, Class<? extends CanonicalizerSpi> implementingClass) throws AlgorithmAlreadyRegisteredException, ClassNotFoundException

Method register

Exceptions
SecurityException:
if a security manager is installed and the caller does not have permission to register the canonicalizer
registerDefaultAlgorithmsback to summary
public static void registerDefaultAlgorithms()

This method registers the default algorithms.