如何检索在C#.NET动态库的证书信息
问题描述:
我要检索证书信息例如,颁发给,给定NET的DLL编程值发稿。
i want to retrieve certificate information e.g, "Issued to", "Issued by" values of a given .net dll programmatically.
在此先感谢!
答
您应该能够像这样做:
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);