public IEncryption EncryptionForIntent(EncryptionIntent intent)
        {
            var key = _encryptionKeyReadProvider.GetKeyForIntent(intent);
            var e   = new BasicEncryption(key.Algorithm)
            {
                Key = key
            };

            return(e);
        }
示例#2
0
        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);
        }
示例#3
0
 public void WriteKeyForIntent(EncryptionIntent intent, IEncryptionKey key)
 {
     throw new NotImplementedException();
 }