C#: How to detect tampering of authenticode signed file

后端 未结 2 1615
既然无缘
既然无缘 2021-01-14 18:22

I\'m trying to write a C# program that verifies the digital signature of exe\'s. The exe\'s are signed with an authenticode certificate, and I want to detect tampering.

相关标签:
2条回答
  • 2021-01-14 19:18

    I'm assuming you've scoured the .NET Framework docs and didn't find what you needed. The answer to this StackOverflow question has a link that describes how to use the native Windows CryptQueryObject function to verify a signature. So all that's left is to check out PInvoke.NET to see how to bring that function into .NET.

    0 讨论(0)
  • 2021-01-14 19:18

    Could you just shell to signtool.exe /verify, and check the result?

    I recently wrote a simple app which signs executables using the same method, and it works great.

    Signtool on MSDN

    0 讨论(0)
提交回复
热议问题