我想以编程方式检索给定.net dll 的证书信息,例如“颁发给”、“颁发者”值。
提前致谢!!
你应该能够做到这一点:
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);