public IEncryption EncryptionForIntent(EncryptionIntent intent) { var key = _encryptionKeyReadProvider.GetKeyForIntent(intent); var e = new BasicEncryption(key.Algorithm) { Key = key }; return(e); }
public IEncryptionKey GetKeyForIntent(EncryptionIntent intent) { var key = new EncryptionKey { Key = Convert.FromBase64String(_configuration.GetValue <string>("Encryption:" + intent + ":Key")), IV = Convert.FromBase64String(_configuration.GetValue <string>("Encryption:" + intent + ":IV")), Algorithm = _configuration.GetValueOrDefault("Encryption:" + intent + ":Algorithm", EncryptionAlgorithm.Rijndael) }; return(key); }
public void WriteKeyForIntent(EncryptionIntent intent, IEncryptionKey key) { throw new NotImplementedException(); }