Using System;
Using System.Collections.Generic;
Using System.Linq;
Using System.Web;
Using System.Web.UI;
Using System.Web.UI.WebControls;
Using System.Security.Cryptography.X509Certificates;
Namespace WebApplication3
{
public partial class WebForm4:System.Web.UI.Page
{
protected void Page_Load (object sender, EventArgs e)
{
System.Security.Cryptography.X509Certificates.X509Store
System.Security.Cryptography.X509Certificates.X509Store x = new System.Security.Cryptography.X509Certificates.X509Store ();
string ss = X.name;
X509store store = new X509store (storename.my);
Store. Open (Openflags.readwrite);
X509Certificate2 certificate = new X509Certificate2 ();
X509Certificate2Collection Storecollection3 = (x509certificate2collection) store. certificates;
string ss = "";
if (Storecollection3. Count = = 0)
{
Console.WriteLine ("Store contains no certificates.");
}
Else
{
foreach (X509Certificate2 x509 in Storecollection3)
{
Console.WriteLine ("certificate name: {0}", X509. Subject);
SS = ss + "| |" + x509. SerialNumber;
X509. Issuer issued by
}
}
Response.Write (ss);
}
}
}
C # traverse Digital certificates