Reworked encryption to not support streaming, but only pre/post process encrypted files. The Get/Put methods in the BackendWrapper now automatically writes/reads from the signature cache. Introduced a DoubleClickRadioButton for use on the main pages. Fixed a bug where zero byte files would throw an exception on restore. Fixed a bug where deleting a folder while building the filelist would interrupt the backup. Fixed issue #17. Fixed issue #22. Fixed issue #38. Added the commandline option to support issue #39, but still needs a UI entry. git-svn-id: https://duplicati.googlecode.com/svn/trunk@131 59da171f-624f-0410-aa54-27559c288bec
80 lines
3.1 KiB
C#
80 lines
3.1 KiB
C#
#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
|
|
{
|
|
/// <summary>
|
|
/// Public interface for an encryption method
|
|
/// </summary>
|
|
public interface IEncryption
|
|
{
|
|
/// <summary>
|
|
/// Encrypts the contents of the inputfile, and saves the result as the outputfile.
|
|
/// </summary>
|
|
/// <param name="inputfile">The file to encrypt</param>
|
|
/// <param name="outputfile">The encrypted file</param>
|
|
void Encrypt(string inputfile, string outputfile);
|
|
|
|
/// <summary>
|
|
/// Encrypts the contents of the input stream, and writes the result to the output stream.
|
|
/// </summary>
|
|
/// <param name="input">The stream to encrypt</param>
|
|
/// <param name="output">The encrypted stream </param>
|
|
void Encrypt(Stream input, Stream output);
|
|
|
|
/// <summary>
|
|
/// Decrypts the contents of the input file and saves the result as the outputfile
|
|
/// </summary>
|
|
/// <param name="inputfile">The file to decrypt</param>
|
|
/// <param name="outputfile">The decrypted output file</param>
|
|
void Decrypt(string inputfile, string outputfile);
|
|
|
|
/// <summary>
|
|
/// Dencrypts the contents of the input stream, and writes the result to the output stream.
|
|
/// </summary>
|
|
/// <param name="input">The stream to decrypt</param>
|
|
/// <param name="output">The decrypted stream</param>
|
|
void Decrypt(Stream input, Stream output);
|
|
|
|
/// <summary>
|
|
/// Decrypts the stream to the output stream
|
|
/// </summary>
|
|
/// <param name="input">The encrypted stream</param>
|
|
/// <returns>The unencrypted stream</returns>
|
|
Stream Decrypt(Stream input);
|
|
|
|
/// <summary>
|
|
/// Encrypts the stream
|
|
/// </summary>
|
|
/// <param name="input">The target stream</param>
|
|
/// <returns>An encrypted stream that can be written to</returns>
|
|
Stream Encrypt(Stream input);
|
|
|
|
/// <summary>
|
|
/// Returns the extension that the encryption implementation adds to the filename
|
|
/// </summary>
|
|
string FilenameExtension { get; }
|
|
}
|
|
}
|