#region Disclaimer / License // Copyright (C) 2009, Kenneth Skovhede // http://www.hexad.dk, opensource@hexad.dk // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // #endregion using System; using System.Collections.Generic; using System.Text; using System.IO; namespace Duplicati.Library.Encryption { /// /// Public interface for an encryption method /// public interface IEncryption { /// /// Encrypts the contents of the inputfile, and saves the result as the outputfile. /// /// The file to encrypt /// The encrypted file void Encrypt(string inputfile, string outputfile); /// /// Encrypts the contents of the input stream, and writes the result to the output stream. /// /// The stream to encrypt /// The encrypted stream void Encrypt(Stream input, Stream output); /// /// Decrypts the contents of the input file and saves the result as the outputfile /// /// The file to decrypt /// The decrypted output file void Decrypt(string inputfile, string outputfile); /// /// Dencrypts the contents of the input stream, and writes the result to the output stream. /// /// The stream to decrypt /// The decrypted stream void Decrypt(Stream input, Stream output); /// /// Decrypts the stream to the output stream /// /// The encrypted stream /// The unencrypted stream Stream Decrypt(Stream input); /// /// Encrypts the stream /// /// The target stream /// An encrypted stream that can be written to Stream Encrypt(Stream input); /// /// Returns the extension that the encryption implementation adds to the filename /// string FilenameExtension { get; } } }