VinceJS
VinceJS

Reputation: 1274

How do I read the digital signature information from a signed .Net assembly?

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.

Windows 7 Explorer can do by right-clicking file properties

Digital signature details

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.

Upvotes: 12

Views: 9526

Answers (2)

Orace
Orace

Reputation: 8359

From this response :

SignCode (for .Net 1.0 and 1.1) uses Authenticode signing, which as far as I'm aware, lacks a .Net Framework managed interface.

Hopefully, it's looks like that some Nuget package implement it:

Upvotes: 2

poupou
poupou

Reputation: 43543

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.

Upvotes: 6

Related Questions