This question already has an answer here:
I want to extract public key, not public key token, in C# from a autenticode signed .Net DLL?
This question already has an answer here:
I want to extract public key, not public key token, in C# from a autenticode signed .Net DLL?
To get a public key from an Autenticode signed .Net library use the following code:
But this will work only if the certificate was installed into Trusted Root Certification Authorities. Otherwise,
GetSignerCertificate()
returns null.The second way allows to get a certificate even if it isn't in Trusted Root Certification Authorities.