title: C# verify file certificate
body: <p>I want to verify file certificate. The signature was generating using sha1 and RSA.
  When right clicking the file, selecting properties, Digital Signatures, Details I see the following:</p>
  
  <p><img src="https://i.stack.imgur.com/1X9hU.png" alt="enter image description here"></p>
  
  <p>I have C++ code that verifies such a signature, using <code>WinVerifyTrust</code>.</p>
  
  <p>However I googled - I just couldn't find C# way of doing it.
  I tried to export the certificate to file, and then took from the file properties the Message Digest:
  <img src="https://i.stack.imgur.com/Kf70s.png" alt="enter image description here">
  Create <code>X509 Certificate</code>, and verify hash - nothing worked.</p>
  
  <p>Any help will be appreciated.</p>
  
  <p><strong>CLARIFICATION</strong></p>
  
  <p>In short: Given a file, how can I verify it is signed by a trusted certificate?</p>