ApacheCanonicalizer.java revision 661
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
*/
/*
* Copyright 2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
*/
/*
* $Id: ApacheCanonicalizer.java,v 1.2 2008/07/24 15:20:32 mullan Exp $
*/
public abstract class ApacheCanonicalizer extends TransformService {
static {
}
protected Canonicalizer apacheCanonicalizer;
private Transform apacheTransform;
protected String inclusiveNamespaces;
protected C14NMethodParameterSpec params;
protected Element transformElem;
public final AlgorithmParameterSpec getParameterSpec() {
return params;
}
throws InvalidAlgorithmParameterException {
throw new ClassCastException
("context must be of type DOMCryptoContext");
}
transformElem = (Element)
}
throws MarshalException {
throw new ClassCastException
("context must be of type DOMCryptoContext");
}
transformElem = (Element)
}
throws TransformException {
}
throws TransformException {
if (apacheCanonicalizer == null) {
try {
+ getAlgorithm());
}
} catch (InvalidCanonicalizerException ice) {
throw new TransformException
("Couldn't find Canonicalizer for: " + getAlgorithm() +
}
}
} else {
}
try {
if (data instanceof ApacheData) {
if (inclusiveNamespaces != null) {
return new OctetStreamData(new ByteArrayInputStream
} else {
return new OctetStreamData(new ByteArrayInputStream
(in.getSubNode())));
}
} else {
return new OctetStreamData(new ByteArrayInputStream(
}
} else if (data instanceof DOMSubTreeData) {
if (inclusiveNamespaces != null) {
return new OctetStreamData(new ByteArrayInputStream
} else {
return new OctetStreamData(new ByteArrayInputStream
}
} else if (data instanceof NodeSetData) {
// convert Iterator to Set
+ " nodes");
}
} else {
return new OctetStreamData(new ByteArrayInputStream(
}
if (inclusiveNamespaces != null) {
return new OctetStreamData(new ByteArrayInputStream(
(nodeSet, inclusiveNamespaces)));
} else {
return new OctetStreamData(new ByteArrayInputStream(
}
} catch (Exception e) {
throw new TransformException(e);
}
}
throws TransformException {
throw new NullPointerException("data must not be null");
}
throw new NullPointerException("output stream must not be null");
}
throw new TransformException("transform must be marshalled");
}
if (apacheTransform == null) {
try {
+ getAlgorithm());
}
throw new TransformException
}
}
if (data instanceof ApacheData) {
}
} else if (data instanceof NodeSetData) {
}
if (data instanceof DOMSubTreeData) {
} else {
}
} else {
}
try {
in = new XMLSignatureInput
throw new TransformException(ex);
}
}
try {
return null;
}
if (in.isOctetStream()) {
return new ApacheOctetStreamData(in);
} else {
return new ApacheNodeSetData(in);
}
throw new TransformException(ex);
}
}
throw new NullPointerException();
} else {
return false;
}
}
}