1

我想以编程方式检索给定.net dll 的证书信息,例如“颁发给”、“颁发者”值。

提前致谢!!

4

1 回答 1

3

你应该能够做到这一点:

Assembly asm = Assembly.LoadFrom("your_assembly.dll");
string exe = asm.Location;
System.Security.Cryptography.X509Certificates.X509Certificate executingCert =
   System.Security.Cryptography.X509Certificates.X509Certificate.CreateFromSignedFile(exe); 
Console.WriteLine (executingCert.Issuer);
于 2012-06-28T18:17:48.550 回答