FileDocCategorySizeDatePackage
TransformC14NExclusive.javaAPI DocJava SE 6 API3693Tue Jun 10 00:23:04 BST 2008com.sun.org.apache.xml.internal.security.transforms.implementations

TransformC14NExclusive

public class TransformC14NExclusive extends TransformSpi
Class TransformC14NExclusive
author
$Author: raul $
version
$Revision: 1.11 $

Fields Summary
public static final String
implementedTransformURI
Field implementedTransformURI
Constructors Summary
Methods Summary
protected java.lang.StringengineGetURI()
Method engineGetURI

inheritDoc



           
      
      return implementedTransformURI;
   
protected com.sun.org.apache.xml.internal.security.signature.XMLSignatureInputenginePerformTransform(com.sun.org.apache.xml.internal.security.signature.XMLSignatureInput input)
Method enginePerformTransform

param
input
return
the transformed of the input
throws
CanonicalizationException

   	    return enginePerformTransform(input,null);
   
protected com.sun.org.apache.xml.internal.security.signature.XMLSignatureInputenginePerformTransform(com.sun.org.apache.xml.internal.security.signature.XMLSignatureInput input, java.io.OutputStream os)

      try {
         String inclusiveNamespaces = null;

         if (this._transformObject
                 .length(InclusiveNamespaces
                    .ExclusiveCanonicalizationNamespace, InclusiveNamespaces
                    ._TAG_EC_INCLUSIVENAMESPACES) == 1) {
            Element inclusiveElement =
                XMLUtils.selectNode(
               this._transformObject.getElement().getFirstChild(),
                  InclusiveNamespaces.ExclusiveCanonicalizationNamespace,
                  InclusiveNamespaces._TAG_EC_INCLUSIVENAMESPACES,0);

            inclusiveNamespaces = new InclusiveNamespaces(inclusiveElement,
                    this._transformObject.getBaseURI()).getInclusiveNamespaces();
         }

         Canonicalizer20010315ExclOmitComments c14n =
            new Canonicalizer20010315ExclOmitComments();
         if (os!=null) {
            c14n.setWriter(os);
         }
         byte []result;
         input.setNeedsToBeExpanded(true);
         result =c14n.engineCanonicalize(input, inclusiveNamespaces);
              
         XMLSignatureInput output=new XMLSignatureInput(result);
         if (os!=null) {
            output.setOutputStream(os);
         }
         return output;      
      } catch (XMLSecurityException ex) {
         throw new CanonicalizationException("empty", ex);
      }