public string Decrypt(EncryptedValue encryptedValue)
        {
            if (encryptedValue.Base64Iv == hardcodedValue.Base64Iv && encryptedValue.EncryptedBase64Value == hardcodedValue.EncryptedBase64Value)
             return "A secret";

            throw new InvalidOperationException("Failed to decrypt");
        }
        public void BaseSetUp()
        {
            conventions = BuildConventions();

            var encryptedValue = new EncryptedValue
            {
                EncryptedBase64Value = EncryptedBase64Value,
                Base64Iv = "init_vector"
            };
            var fakeEncryptionService = new FakeEncryptionService(encryptedValue);
            mutator = new EncryptionMutator(fakeEncryptionService, conventions);
        }
示例#3
0
 string Decrypt(EncryptedValue value)
 {
     if (encryptionServiceWithContext != null)
         return encryptionServiceWithContext.Decrypt(value, incomingContext);
     else
         return encryptionService.Decrypt(value);
 }
 public FakeEncryptionService(EncryptedValue hardcodedValue)
 {
     this.hardcodedValue = hardcodedValue;
 }
示例#5
0
 public string Decrypt(EncryptedValue encryptedValue)
 {
     return encryptedValue.Base64Iv;
 }