/* * 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. */ 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 Strings into Nodes and visa versa. */ public interface Serializer { /** * Set the Canonicalizer object to use. */ void setCanonicalizer(Canonicalizer canon); /** * Returns a byte[] representation of the specified * Element. * * @param element the Element to serialize. * @return the byte[] representation of the serilaized * Element. * @throws Exception */ byte[] serializeToByteArray(Element element) throws Exception; /** * Returns a byte[] representation of the specified * NodeList. * * @param content the NodeList to serialize. * @return the byte[] representation of the serialized * NodeList. * @throws Exception */ byte[] serializeToByteArray(NodeList content) throws Exception; /** * Use the Canonicalizer to serialize the node * @param node * @return the (byte[]) canonicalization of the node * @throws Exception */ byte[] canonSerializeToByteArray(Node node) throws Exception; /** * @param source * @param ctx * @return the Node resulting from the parse of the source * @throws XMLEncryptionException */ Node deserialize(byte[] source, Node ctx) throws XMLEncryptionException; }