title: Read and validate certificate from executable
body: <p>I want to validate certificates of signed executable images (by validation, I mean to tell if the signature comes from MS/Adobe/Oracle etc.). Does windows provides api for this task? How should I do that, no idea. Any help would be appreciated.
  I'm using Windows and C++. I want to validate native executable images, not .NET assemblies or Java jar files.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <hr>
  
  <p>Ok, I'll try to describe what I want shortly.</p>
  
  <p>1) Validate PE certificate. Is the signature valid or not. It should work when signature is embedded in PE and when the signature is in security catalog. (<strong>I found this on sysinternals forum and works fine, so I don't need this one anymore</strong>).</p>
  
  <p>2) Tell who's the signer/publisher of the file. I know it can be achieved through CryptQueryObject (I found a working example, though it doesn't work with security catalogs), but don't know how to use it with security catalog files. </p>