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.