Checking digital signature on EXE

Posted by LTR on Stack Overflow See other posts from Stack Overflow or by LTR
Published on 2014-06-05T12:16:39Z Indexed on 2014/06/05 15:25 UTC
Read the original article Hit count: 219

Filed under:
|
|
|

My .NET exe is signed using signtool. Using this code, I can verify the validity of the certificate itself:

var cert = X509Certificate.CreateFromSignedFile("application.exe");
var cert2 = new X509Certificate2(cert.Handle);
bool valid = cert2.Verify();

However, this only checks the certificate itself, and not the signature of the EXE. Therefore, if the EXE is tampered with, this method doesn't detect it.

How can I check the signature?

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET