0N/A/*
0N/A * reserved comment block
0N/A * DO NOT REMOVE OR ALTER!
0N/A */
0N/A/*
0N/A * Copyright 1999-2004 The Apache Software Foundation.
0N/A *
0N/A * Licensed under the Apache License, Version 2.0 (the "License");
0N/A * you may not use this file except in compliance with the License.
0N/A * You may obtain a copy of the License at
0N/A *
0N/A * http://www.apache.org/licenses/LICENSE-2.0
0N/A *
0N/A * Unless required by applicable law or agreed to in writing, software
0N/A * distributed under the License is distributed on an "AS IS" BASIS,
0N/A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0N/A * See the License for the specific language governing permissions and
0N/A * limitations under the License.
0N/A *
0N/A */
0N/Apackage com.sun.org.apache.xml.internal.security.transforms.implementations;
0N/A
0N/Aimport java.io.OutputStream;
0N/A
0N/Aimport com.sun.org.apache.xml.internal.security.c14n.CanonicalizationException;
0N/Aimport com.sun.org.apache.xml.internal.security.c14n.implementations.Canonicalizer20010315OmitComments;
0N/Aimport com.sun.org.apache.xml.internal.security.signature.XMLSignatureInput;
661N/Aimport com.sun.org.apache.xml.internal.security.transforms.Transform;
0N/Aimport com.sun.org.apache.xml.internal.security.transforms.TransformSpi;
0N/Aimport com.sun.org.apache.xml.internal.security.transforms.Transforms;
0N/A
0N/A/**
0N/A * Implements the <CODE>http://www.w3.org/TR/2001/REC-xml-c14n-20010315</CODE>
0N/A * transform.
0N/A *
0N/A * @author Christian Geuer-Pollmann
0N/A */
0N/Apublic class TransformC14N extends TransformSpi {
0N/A
0N/A /** Field implementedTransformURI */
0N/A public static final String implementedTransformURI =
0N/A Transforms.TRANSFORM_C14N_OMIT_COMMENTS;
0N/A
0N/A
0N/A /**
0N/A * @inheritDoc
0N/A */
0N/A protected String engineGetURI() {
0N/A return TransformC14N.implementedTransformURI;
0N/A }
0N/A
0N/A /**
0N/A * @inheritDoc
0N/A */
661N/A protected XMLSignatureInput enginePerformTransform
661N/A (XMLSignatureInput input, Transform _transformObject)
0N/A throws CanonicalizationException {
661N/A return enginePerformTransform(input, null, _transformObject);
0N/A }
661N/A
661N/A protected XMLSignatureInput enginePerformTransform(XMLSignatureInput input,OutputStream os, Transform _transformObject)
0N/A throws CanonicalizationException {
0N/A Canonicalizer20010315OmitComments c14n = new Canonicalizer20010315OmitComments();
0N/A if (os!=null) {
0N/A c14n.setWriter(os);
0N/A }
0N/A byte[] result = null;
0N/A result=c14n.engineCanonicalize(input);
0N/A XMLSignatureInput output=new XMLSignatureInput(result);
0N/A if (os!=null) {
0N/A output.setOutputStream(os);
0N/A }
0N/A return output;
0N/A }
0N/A}