예제 #1
0
        private static void DecryptYamlValue(JsonPasswordCrypto cryptoHandler, YamlEncryptedNode encryptedNode)
        {
            var decryptedValue = cryptoHandler.Decrypt(encryptedNode.EncryptedValue);

            encryptedNode.Parent.Children.Remove(encryptedNode.Container);
            encryptedNode.Parent.Add(encryptedNode.Container.Key, decryptedValue);
        }
        private static void DecryptJsonValue(JsonPasswordCrypto cryptoHandler, dynamic originalValue)
        {
            var     valueToDecrypt = new EncryptedValue(originalValue.IV.Value, originalValue.Value.Value);
            var     decryptedValue = cryptoHandler.Decrypt(valueToDecrypt);
            JObject valueToReplace = originalValue;

            valueToReplace.Replace(decryptedValue);
        }