#region Copyright 2009-2014 by Roger Knapp, Licensed under the Apache License, Version 2.0 /* 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 * * 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. */ #endregion using System; using System.Collections.Generic; using System.IO; using CSharpTest.Net.Formatting; namespace CSharpTest.Net.Crypto { /// /// A simple interface for encrypting and decrypting strings, obtain an instance through the /// static Encryption inteface calss. /// public interface IEncryptDecrypt : IDisposable { /// Encrypts a stream of data Stream Encrypt(Stream stream); /// Decrypts a stream of data Stream Decrypt(Stream stream); /// Encrypts a raw data block as a set of bytes byte[] Encrypt(byte[] blob); /// Encrypts a string and encodes the result in base-64 encoded text string Encrypt(string text); /// Encrypts a string and encodes the result in specified encoding format string Encrypt(string text, ByteEncoding encoding); /// Decrypts a raw data block as a set of bytes byte[] Decrypt(byte[] blob); /// Decrypts a string from base-64 encoded text string Decrypt(string text); /// Decrypts a string from the specified encoding format string Decrypt(string text, ByteEncoding encoding); } }