/ Published in: C#
http://www.codequake.com/post/2010/08/12/How-to-access-certificates-using-C.aspx
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
private static void AccessPersonalStore() { // Access the personal store // Open the store as ReadOnly store.Open(OpenFlags.ReadOnly); if (store.Certificates.Count > 0) { foreach (X509Certificate2 cert in store.Certificates) { Console.WriteLine("Certificate algorithm: " + cert.SignatureAlgorithm.FriendlyName); Console.WriteLine("Certificate issuer: " + cert.IssuerName); Console.WriteLine("Certificate serial: " + cert.SerialNumber); Console.WriteLine("Certificate valid after: " + cert.NotBefore.ToShortDateString()); Console.WriteLine("Certificate valid until: " + cert.NotAfter.ToShortDateString()); // etc... Many properties and methods are available. Console.WriteLine(); Console.WriteLine("----------------------"); Console.WriteLine(); } Console.ReadLine(); } }
URL: http://www.codequake.com/post/2010/08/12/How-to-access-certificates-using-C.aspx