Created
September 21, 2020 06:56
-
-
Save ssukhpinder/ffab653a4e75a80301840fe2d59145bb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void Decrypt(XmlDocument Doc, SymmetricAlgorithm Alg) | |
{ | |
if (Doc == null) | |
throw new ArgumentNullException("Doc"); | |
if (Alg == null) | |
throw new ArgumentNullException("Alg"); | |
XmlElement encryptedElement = Doc.GetElementsByTagName("EncryptedData")[0] as XmlElement; | |
if (encryptedElement == null) | |
{ | |
throw new XmlException("The XML element was not found."); | |
} | |
EncryptedData edElement = new EncryptedData(); | |
edElement.LoadXml(encryptedElement); | |
EncryptedXml exml = new EncryptedXml(); | |
byte[] rgbOutput = exml.DecryptData(edElement, Alg); | |
exml.ReplaceData(encryptedElement, rgbOutput); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment