Skip to content

Instantly share code, notes, and snippets.

@SumindaD
Created January 5, 2020 07:39
Show Gist options
  • Save SumindaD/91d624cac41ad608c475785946a51553 to your computer and use it in GitHub Desktop.
Save SumindaD/91d624cac41ad608c475785946a51553 to your computer and use it in GitHub Desktop.
/// <summary>
/// Remove the Signature from signed XML document
/// </summary>
/// <param name="xmlFilePath">Path to the signed xml document</param>
/// <returns>The unsigned xml document</returns>
private static XmlDocument UnsignXMLDocument(string xmlFilePath)
{
var xmlDocument = ReadXMLDocumentFromPath(xmlFilePath);
var nodeList = xmlDocument.GetElementsByTagName("Signature");
xmlDocument.DocumentElement.RemoveChild(nodeList[0]);
return xmlDocument;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment