[C#] [.NET] [SECURITY] How to extract application (EXE, DLL...) certificate

By vincent.duvernet ·

When looking in Windows Explorer for a specific file properties some of those have a new tab for digital certificate.
In this tab, we can see the detail of this certificate.

Is there a way to to the same thing using .NET 2.0 ?



This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

Wow I thought I'd broke google

by Tony Hopkinson In reply to [C#] [.NET] [SECURITY] Ho ...

Took a fair bit if f'ing about to ask the right question, but I did find this as starter

Interesting question, and I'm going to remember the answer.

PS eventually I googled WinverifyTrust C#. The first bit was far from obvious.....

Collapse -

That's a good way

by vincent.duvernet In reply to Wow I thought I'd broke ...

Hi and thanks for the answer.
I'm going to have a look to this code.

During my searches, I've learned that Digital signature is just a bit more complicated.
There's digital certificate which is attached to file (PE) and I've got some code working on it and the security catalog of Windows.

Have a look to notepad.exe, it's a signed file using the security catalog. IE the digital certificate is not embbeded into file to save space & footprints.

Edit 1:
C Sample give more informations :
but certificate details is not shown.

Many functions are not documented in Wintrust.dll :

Edit 2:
After trying this, same conclusion. It works only if certificate is attached to file.
(IE don't work with notepad.exe)


Related Discussions

Related Forums