Saturday, May 30, 2009

Access list of digital certificates through built-in UI

// Access list of digital certificates through built-in UI

X509Store store = new X509Store(StoreName.My, StoreLocation.CurrentUser);
store.Open(OpenFlags.ReadOnly | OpenFlags.OpenExistingOnly);
X509Certificate2Collection certs = X509Certificate2UI.SelectFromCollection(store.Certificates,"Certificates", "Please select certificate to use", X509SelectionFlag.SingleSelection);

1 comment:

  1. I just implemented the above code into my program and yes it worked. I am grateful to you for sharing this code that simply provides the list of digital certificates.
    digital certificate

    ReplyDelete