0

What I'm looking to obtain is a list of signatures on a given file that's been digitally signed ( code signing certificate ) - When you use signtool to sign with a sha1 certificate, you can also sign with a sha256 certificate for instance- Both of these signatures can be found in the file properties under Digital Signatures, under a signature list - You can also see a timestamp if you used that as well.

Is there a standard way to grab that list/details or is this diving into p/invoke territory?

var cert = X509Certificate.CreateFromSignedFile(fileName);

This almost gets me what I need, it assures me a file has a signature and can even build a certificate out of it, it seems - I can then grab the common name and such and do some basic checks from there.

I don't, however, get both signatures, and can't seem to find a way to do so. Would prefer to do this using standard .NET if possible, but understand that may not be possible. Thanks in advance!

Got an answer for using in console, could likely adapt it for windows forms easily enough but something usable for windows forms out of the box would be great.

  • 1
    Possible duplicate of [Code signing an executable twice](https://stackoverflow.com/questions/21547311/code-signing-an-executable-twice) – Thomas Weller Jun 09 '19 at 21:58
  • Thank you - guessing nothing has changed in 4-5 years then and that might be the best answer still? Also, creating a windows forms application, so take some work to adapt but might be able to manage. – Steven Hansen Jun 10 '19 at 02:48

0 Answers0