I am writing an assembly information application to be used in our software build process and am trying to read the digital signature information from a signed .Net assembly.
I want to do in my C# code what Windows Explorer can do by right-clicking a signed assembly and selecting the "Digital Signatures" tab and then clicking the Details button. e.g.
Has anyone got an idea how to do this programmatically in C#? I am currently using the Mono Cecil library to get the rest of the information from the assembly. Your help will be most appreciated.
To detect whether the assembly file is signed or not, right click on the file and click the 'Properties' from the context menu. If you see a 'Digital Signatures' tab in the properties window, that means, the file is signed by a digital signature (as shown below).
Open the properties sheet for the . dll from Windows Explorer. If a tab "Digital Signatures" is shown, it's a signed assembly. If the tab is missing, it's unsigned.
When a signer electronically signs a document, the signature is created using the signer's private key, which is always securely kept by the signer. The mathematical algorithm acts as a cypher, creating data matching the signed document, called a hash, and encrypting that data.
The Mono project provides source code for both signcode
and chktrust
that you can re-use inside your own application (open source, MIT X11 licensed).
Both use Mono.Security.dll
assembly (which works under Windows, not just Linux and OSX) and include a quite complete Authenticode support.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With