Get timestamp from Authenticode Signed files in .NET

Posted by SlavaGu on Stack Overflow See other posts from Stack Overflow or by SlavaGu
Published on 2010-07-19T12:37:25Z Indexed on 2011/02/07 23:25 UTC
Read the original article Hit count: 566

Filed under:
|
|
|
|

We need to verify that binary files are signed properly with digital signature (Authenticode). This can be achieved with signtool.exe pretty easily. However, we need an automatic way that also verifies signer name and timestamp. This is doable in native C++ with CryptQueryObject() API as shown in this wonderful sample: How To Get Information from Authenticode Signed Executables

However we live in a managed world :) hence looking for C# solution to the same problem. Straight approach would be to pInvoke Crypt32.dll and all is done. But there is similar managed API in System.Security.Cryptography.X509Certificates Namespace. X509Certificate2 Class seems to provide some information but no timestamp. Now we came to the original question how can we get that timestamp of a digital signature in C Sharp?

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET