/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
*/
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you 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
http://www.apache.org/licenses/LICENSE-2.0
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.
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.
*/
package com.sun.org.apache.xml.internal.security.encryption;
import com.sun.org.apache.xml.internal.security.c14n.Canonicalizer;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
Converts String
s into Node
s and visa versa.
/**
* Converts <code>String</code>s into <code>Node</code>s and visa versa.
*/
public interface Serializer {
Set the Canonicalizer object to use.
/**
* Set the Canonicalizer object to use.
*/
void setCanonicalizer(Canonicalizer canon);
Returns a byte[]
representation of the specified
Element
.
Params: - element – the
Element
to serialize.
Throws: Returns: the byte[]
representation of the serilaized
Element
.
/**
* Returns a <code>byte[]</code> representation of the specified
* <code>Element</code>.
*
* @param element the <code>Element</code> to serialize.
* @return the <code>byte[]</code> representation of the serilaized
* <code>Element</code>.
* @throws Exception
*/
byte[] serializeToByteArray(Element element) throws Exception;
Returns a byte[]
representation of the specified
NodeList
.
Params: - content – the
NodeList
to serialize.
Throws: Returns: the byte[]
representation of the serialized
NodeList
.
/**
* Returns a <code>byte[]</code> representation of the specified
* <code>NodeList</code>.
*
* @param content the <code>NodeList</code> to serialize.
* @return the <code>byte[]</code> representation of the serialized
* <code>NodeList</code>.
* @throws Exception
*/
byte[] serializeToByteArray(NodeList content) throws Exception;
Use the Canonicalizer to serialize the node
Params: - node –
Throws: Returns: the (byte[]) canonicalization of the node
/**
* Use the Canonicalizer to serialize the node
* @param node
* @return the (byte[]) canonicalization of the node
* @throws Exception
*/
byte[] canonSerializeToByteArray(Node node) throws Exception;
Params: - source –
- ctx –
Throws: Returns: the Node resulting from the parse of the source
/**
* @param source
* @param ctx
* @return the Node resulting from the parse of the source
* @throws XMLEncryptionException
*/
Node deserialize(byte[] source, Node ctx) throws XMLEncryptionException;
}