C# Class WebApplications.Utilities.Cryptography.AESCryptographer

Inheritance: ICryptoProvider
Afficher le fichier Open project: webappsuk/CoreLibraries

Méthodes publiques

Méthode 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

Méthode 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 méthode

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

Decrypt() public méthode

public Decrypt ( string input, bool &isLatestKey ) : string
input string
isLatestKey bool
Résultat string

Encrypt() public méthode

public Encrypt ( string input ) : string
input string
Résultat string

TryDecrypt() public méthode

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 . ///
Résultat bool