title: Get timestamp from Authenticode Signed files in .NET
body: <p>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 <code>CryptQueryObject()</code> API as shown in this wonderful sample: <a href="http://support.microsoft.com/kb/323809" rel="noreferrer">How To Get Information from Authenticode Signed Executables</a></p>
  
  <p>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 <code>System.Security.Cryptography.X509Certificates</code> Namespace. <code>X509Certificate2</code> Class seems to provide some information but no timestamp. Now we came to the original question how can we <strong>get that timestamp of a digital signature in C Sharp?</strong></p>