开发者

C# how to remove a signature from an xml file?

开发者 https://www.devze.com 2022-12-16 07:19 出处:网络
I have an XML file that is digitally signed. Is there an开发者_开发百科 easy way to remove this signature in C#?I am assuming it has a <Signature> Element

I have an XML file that is digitally signed. Is there an开发者_开发百科 easy way to remove this signature in C#?


I am assuming it has a <Signature> Element

You can just remove it using Linq and Resave.

// Find the <Signature> Element
XElement signElement = doc.Descendants("Signature").FirstOrDefault<XElement>();

signElement.Remove();

doc.Save("NonSignedFile.xml");
0

精彩评论

暂无评论...
验证码 换一张
取 消