public byte[] engineCanonicalize(XMLSignatureInput input) throws CanonicalizationException {
  try {
    if (input.isExcludeComments()) {
      includeComments=false;
    }
    if (input.isOctetStream()) {
      return engineCanonicalize(input.getBytes());
    }
    if (input.isElement()) {
      return engineCanonicalizeSubTree(input.getSubNode(),input.getExcludeNode());
    }
 else     if (input.isNodeSet()) {
      nodeFilter=input.getNodeFilters();
      circumventBugIfNeeded(input);
      if (input.getSubNode() != null) {
        return engineCanonicalizeXPathNodeSetInternal(input.getSubNode());
      }
 else {
        return engineCanonicalizeXPathNodeSet(input.getNodeSet());
      }
    }
    return null;
  }
 catch (  CanonicalizationException ex) {
    throw new CanonicalizationException("empty",ex);
  }
catch (  ParserConfigurationException ex) {
    throw new CanonicalizationException("empty",ex);
  }
catch (  IOException ex) {
    throw new CanonicalizationException("empty",ex);
  }
catch (  SAXException ex) {
    throw new CanonicalizationException("empty",ex);
  }
}

public byte [ ] engineCanonicalize ( XMLSignatureInput input ) throws CanonicalizationException { try { if ( input . isExcludeComments ( ) ) { includeComments = false ; } if ( input . isOctetStream ( ) ) { return engineCanonicalize ( input . getBytes ( ) ) ; } if ( input . isElement ( ) ) { return engineCanonicalizeSubTree ( input . getSubNode ( ) , input . getExcludeNode ( ) ) ; } else if ( input . isNodeSet ( ) ) { nodeFilter = input . getNodeFilters ( ) ; circumventBugIfNeeded ( input ) ; if ( input . getSubNode ( ) != null ) { return engineCanonicalizeXPathNodeSetInternal ( input . getSubNode ( ) ) ; } else { return engineCanonicalizeXPathNodeSet ( input . getNodeSet ( ) ) ; } } return null ; } catch ( CanonicalizationException ex ) { throw new CanonicalizationException ( "empty" , ex ) ; } catch ( ParserConfigurationException ex ) { throw new CanonicalizationException ( "empty" , ex ) ; } catch ( IOException ex ) { throw new CanonicalizationException ( "empty" , ex ) ; } catch ( SAXException ex ) { throw new CanonicalizationException ( "empty" , ex ) ; } }
canonicalizes a subtree node .
