internal static XmlElement Decrypt(this XmlElement element, AsymmetricAlgorithm key)
        {
            var xmlDoc = XmlHelpers.XmlDocumentFromString(element.OuterXml);

            var exml = new RSAEncryptedXml(xmlDoc, (RSA)key);

            exml.DecryptDocument();

            return(xmlDoc.DocumentElement);
        }
        internal static XmlElement Decrypt(this XmlElement element, AsymmetricAlgorithm key)
        {
            var xmlDoc = new XmlDocument { PreserveWhitespace = true };
            xmlDoc.LoadXml(element.OuterXml);

            var exml = new RSAEncryptedXml(xmlDoc, (RSA)key);

            exml.DecryptDocument();

            return xmlDoc.DocumentElement;
        }
Пример #3
0
        internal static XmlElement Decrypt(this XmlElement element, AsymmetricAlgorithm key)
        {
            var xmlDoc = new XmlDocument {
                PreserveWhitespace = true
            };

            xmlDoc.LoadXml(element.OuterXml);

            var exml = new RSAEncryptedXml(xmlDoc, (RSA)key);

            exml.DecryptDocument();

            return(xmlDoc.DocumentElement);
        }
        internal static IEnumerable<XmlElement> Decrypt(this IEnumerable<XmlElement> elements, AsymmetricAlgorithm key)
        {
            foreach (var element in elements)
            {
                var xmlDoc = new XmlDocument { PreserveWhitespace = true };
                xmlDoc.LoadXml(element.OuterXml);

                var exml = new RSAEncryptedXml(xmlDoc, (RSA)key);

                exml.DecryptDocument();

                yield return xmlDoc.DocumentElement;
            }
        } 
Пример #5
0
        internal static IEnumerable <XmlElement> Decrypt(this IEnumerable <XmlElement> elements, AsymmetricAlgorithm key)
        {
            foreach (var element in elements)
            {
                var xmlDoc = new XmlDocument {
                    PreserveWhitespace = true
                };
                xmlDoc.LoadXml(element.OuterXml);

                var exml = new RSAEncryptedXml(xmlDoc, (RSA)key);

                exml.DecryptDocument();

                yield return(xmlDoc.DocumentElement);
            }
        }