add constructors

This commit is contained in:
2020-11-26 11:47:45 +01:00
parent 2631a6afba
commit faaab33afc

View File

@@ -53,6 +53,16 @@ namespace Pilz.Cryptography
set => defaultIV = Convert.FromBase64String(value); set => defaultIV = Convert.FromBase64String(value);
} }
public AESStringCrypter()
{
}
public AESStringCrypter(string key, string iv) : this()
{
Key = key;
IV = iv;
}
public string Decrypt(string encryptedValue) public string Decrypt(string encryptedValue)
{ {
return DecryptStringFromBytes_Aes(Convert.FromBase64String(encryptedValue), GetKey(), GetIV()); return DecryptStringFromBytes_Aes(Convert.FromBase64String(encryptedValue), GetKey(), GetIV());