Quantcast
Channel: Internet Explorer Web Development forum
Viewing all articles
Browse latest Browse all 3527

X509 Certficate Reading

$
0
0

Hi,

I'm attempting to read a clients certificate using the following c# code:

            var store = new X509Store(StoreLocation.CurrentUser);

            store.Open(OpenFlags.ReadOnly);

            var certificates = store.Certificates;
            foreach (var certificate in certificates)
            {
                var friendlyName = certificate.FriendlyName;
                var xname = certificate.GetName(); //obsolete
                Console.WriteLine(friendlyName);
            }

            store.Close();

The problem is that it is giving details for the certificate on the server that the ASP code is running.

Any ideas? I've tried changing the constructor to

            var store = new X509Store(StoreName.My, StoreLocation.CurrentUser);
but I still can't access it.


Viewing all articles
Browse latest Browse all 3527

Trending Articles