Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle Security Developer Tools XML Security Java API Reference 10g Release 3 (10.1.3) B25383-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.security.xmlsec.c14n
Class Canonicalizer

`java.lang.Object
oracle.security.xmlsec.c14n.Canonicalizer`

Direct Known Subclasses:
  ExclusiveC14N, XMLC14N

public abstract class Canonicalizer
extends java.lang.Object

Abstract base class for canonicalization implementations.

Field Summary
`protected XSAlgorithmIdentifier` | `c14nMethod` The `XSAlgorithmIdentifier` instance used to instantiate this `Canonicalizer`.

Constructor Summary
`protected` | `Canonicalizer()` Creates a new `Canonicalizer` instance.
`protected` | `Canonicalizer(XSAlgorithmIdentifier c14nMethod)` Creates a new `Canonicalizer` instance, and checks that the given `XSAlgorithmIdentifier` is a XML-DSIG CanonicalizationMethod element.

Method Summary
`abstract byte[]` | `canonicalize(java.util.Collection source)` Canonicalizes the given `Collection`, returning the resulting XML octets in UTF-8 encoding.
`abstract byte[]` | `canonicalize(org.xml.sax.InputSource source)` Canonicalizes the XML in the given `InputSource`, returning the resulting XML octets in UTF-8 encoding.
`abstract byte[]` | `canonicalize(java.io.InputStream source)` Canonicalizes the XML in the given input stream, returning the resulting XML octets in UTF-8 encoding.
`abstract byte[]` | `canonicalize(java.io.InputStream source, java.lang.String systemId)` Canonicalizes the XML in the given input stream, returning the resulting XML octets in UTF-8 encoding.
`abstract byte[]` | `canonicalize(org.w3c.dom.Node source)` Canonicalizes a DOM subtree rooted in the given `Node`, returning the resulting XML octets in UTF-8 encoding.
`abstract byte[]` | `canonicalize(org.w3c.dom.NodeList source)` Canonicalizes the given `NodeList`, returning the resulting XML octets in UTF-8 encoding.
`XSAlgorithmIdentifier` | `getC14NMethod()` Returns the `XSAlgorithmIdentifier` containing the CanonicalizationMethod element used to instantiate this `Canonicalizer`.
`static Canonicalizer` | `getInstance(java.lang.String uri)` Creates a new `Canonicalizer` implementation class identified by the given algorithm URI.
`static Canonicalizer` | `getInstance(XSAlgorithmIdentifier c14nMethod)` Returns an instance of the `Canonicalizer` subclass identified by the given `XSAlgorithmIdentifier`'s Algorithm attribute.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### c14nMethod

    protected XSAlgorithmIdentifier c14nMethod

  The `XSAlgorithmIdentifier` instance used to instantiate this `Canonicalizer`.

Constructor Detail

### Canonicalizer

    protected Canonicalizer()

  Creates a new `Canonicalizer` instance.

### Canonicalizer

    protected Canonicalizer(XSAlgorithmIdentifier c14nMethod)

  Creates a new `Canonicalizer` instance, and checks that the given `XSAlgorithmIdentifier` is a XML-DSIG CanonicalizationMethod element. Subclasses should invoke this constructor as needed.
Parameters:
  `c14nMethod` - A `XSAlgorithmIdentifier` with local tag name "CanonicalizationMethod".
Throws:
  `java.lang.IllegalArgumentException` - If the given `XSAlgorithmIdentifier` is not a XML-DSIG CanonicalizationMethod.

Method Detail

### getC14NMethod

    public XSAlgorithmIdentifier getC14NMethod()

  Returns the `XSAlgorithmIdentifier` containing the CanonicalizationMethod element used to instantiate this `Canonicalizer`.
  Returns:
    A `XSAlgorithmIdentifier`, or `null` if none has been set.

### getInstance

    public static Canonicalizer getInstance(XSAlgorithmIdentifier c14nMethod)
                                     throws oracle.security.crypto.core.AlgorithmIdentifierException

  Returns an instance of the `Canonicalizer` subclass identified by the given `XSAlgorithmIdentifier`'s Algorithm attribute.
  Parameters:
    `c14nMethod` - A `XSAlgorithmIdentifier` object containing the algorithm identifying the desired canonicalization, and any parameters required by the algorithm. If any parameters are specified in the `XSAlgorithmIdentifier` structure, the algorithm's target implementation class must have an accessible constructor taking a `XSAlgorithmIdentifier` as its only argument.
  Throws:
    `oracle.security.crypto.core.AlgorithmIdentifierException` - If a `Canonicalizer` cannot be instantiated for the given algorithm.
    `java.lang.IllegalArgumentException` - If the given `XSAlgorithmIdentifier` is not a CanonicalizationMethod or it contains more than one parameter.

### getInstance

    public static Canonicalizer getInstance(java.lang.String uri)
                                     throws oracle.security.crypto.core.AlgorithmIdentifierException

  Creates a new `Canonicalizer` implementation class identified by the given algorithm URI.

  Standard algorithm URI constants can be found in `XMLURI`, including:

  - `XML-C14N`
  - `XML-C14N With Comments`
  - `Exclusive XML-C14N`
  - `Exclusive XML-C14N With Comments`
  Parameters:
    `uri` - A URI string identifying the algorithm of the canonicalization implementation class to be instantiated.
  Throws:
    `oracle.security.crypto.core.AlgorithmIdentifierException` - If a `Canonicalizer` cannot be instantiated for the given algorithm.

### canonicalize

    public abstract byte[] canonicalize(org.w3c.dom.Node source)
                                 throws CanonicalizationException

  Canonicalizes a DOM subtree rooted in the given `Node`, returning the resulting XML octets in UTF-8 encoding.
  Parameters:
    `source` - An `org.w3c.dom.Node` at the root of a XML tree to be canonicalized.
  Returns:
    A byte array containing the canonicalized octets of the input XML tree.
  Throws:
    `CanonicalizationException`

### canonicalize

    public abstract byte[] canonicalize(org.w3c.dom.NodeList source)
                                 throws CanonicalizationException

  Canonicalizes the given `NodeList`, returning the resulting XML octets in UTF-8 encoding.
  Parameters:
    `source` - An `org.w3c.dom.NodeList` to be canonicalized.
  Returns:
    A byte array containing the canonicalized octets of the input node list.
  Throws:
    `CanonicalizationException`

### canonicalize

    public abstract byte[] canonicalize(java.util.Collection source)
                                 throws CanonicalizationException

  Canonicalizes the given `Collection`, returning the resulting XML octets in UTF-8 encoding.
  Parameters:
    `source` - A `java.util.Collection` containing the nodes to be canonicalized.
  Returns:
    A byte array containing the canonicalized octets of the input nodes.
  Throws:
    `CanonicalizationException`
  Since:
    2.0

### canonicalize

    public abstract byte[] canonicalize(java.io.InputStream source)
                                 throws CanonicalizationException

  Canonicalizes the XML in the given input stream, returning the resulting XML octets in UTF-8 encoding.
  Parameters:
    `source` - A `java.io.InputStream` containing the XML to be canonicalized.
  Returns:
    A byte array containing the canonicalized octets of the input XML.
  Throws:
    `CanonicalizationException`

### canonicalize

    public abstract byte[] canonicalize(java.io.InputStream source,
                                        java.lang.String systemId)
                                 throws CanonicalizationException

  Canonicalizes the XML in the given input stream, returning the resulting XML octets in UTF-8 encoding.
  Parameters:
    `source` - A `java.io.InputStream` containing the XML to be canonicalized.
    `systemId` - A URI string identifying the input stream source.
  Returns:
    A byte array containing the canonicalized octets of the input XML.
  Throws:
    `CanonicalizationException`

### canonicalize

    public abstract byte[] canonicalize(org.xml.sax.InputSource source)
                                 throws CanonicalizationException

  Canonicalizes the XML in the given `InputSource`, returning the resulting XML octets in UTF-8 encoding.
  Parameters:
    `source` - An `org.xml.sax.InputSource` containing the XML to be canonicalized.
  Returns:
    A byte array containing the canonicalized octets of the input XML.
  Throws:
    `CanonicalizationException`

Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle Security Developer Tools XML Security Java API Reference 10g Release 3 (10.1.3) B25383-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2005, 2006 , Oracle. All rights reserved.