C# Class WebApplications.Utilities.Cryptography.AESCryptographer

Inheritance: ICryptoProvider
Mostrar archivo Open project: webappsuk/CoreLibraries

Public Methods

Method Description
AESCryptographer ( IEnumerable keys = null ) : System

Initializes a new instance of the AESCryptographer class.

Decrypt ( string input, bool &isLatestKey ) : string
Encrypt ( string input ) : string
TryDecrypt ( string inputString, string &decryptedString, bool &isLatestKey ) : bool

Tries the decrypt the provided input string.

Private Methods

Method Description
AESCryptographer ( [ provider, IEnumerable keys = null ) : System
ConvertHexStringToByteArray ( string hexString ) : byte[]
DecryptStringFromBytes ( [ cipherText, [ key, [ initializationVector ) : string

Decrypts the array of bytes into a string.

EncryptStringToBytes ( [ input, [ key, [ initializationVector ) : byte[]

Encrypts the provided input string to an array of bytes.

TryDecryptStringFromBytes ( [ cipherText, [ key, [ initializationVector, string &decryptedString ) : bool

Tries the decrypt the encrypted text with the key specified. This is used internally to find the correct key for decryption.

Method Details

AESCryptographer() public method

Initializes a new instance of the AESCryptographer class.
public AESCryptographer ( IEnumerable keys = null ) : System
keys IEnumerable The keys to add to this provider.
return System

Decrypt() public method

public Decrypt ( string input, bool &isLatestKey ) : string
input string
isLatestKey bool
return string

Encrypt() public method

public Encrypt ( string input ) : string
input string
return string

TryDecrypt() public method

Tries the decrypt the provided input string.
public TryDecrypt ( string inputString, string &decryptedString, bool &isLatestKey ) : bool
inputString string The string to decrypt.
decryptedString string /// The result of the decryption. /// If unsuccessful this will be . ///
isLatestKey bool /// if the string was encrypted with the latest key; otherwise . ///
return bool