title: Can we use smart card authentication in Client Server Architecture?
body: <p>I am trying to develop ASP.Net web application to accept smart card authentication. I have created web app, deployed it in IIS. Root certificate is installed on IIS machine Trusted Root directory that is authorized by CA. For that web app, I added Server certificate, set Require SSL and set to Accept the certificates.
  When, client access this web app, it prompts for client certificate, chrome gives prompt for the client certificate, smart card is inserted to client's machine, and when PIN is asked, user enters valid PIN and I am able to get home page of the web app. Till, this everything works as expected but at this point I want to read the client certificate and want to validate that client with certificate chain. Also, based on on the client certificate, I want to get the roles for that user. Everytime I try to read client certificate, I am unable to get the certificate. Below is code to read smart card certificates:</p>
  
  <p>`</p>
  
  <pre><code>X509Store store = null;
  store = new X509Store(StoreName.Root);
  store.Open(OpenFlags.ReadOnly);
  var certsAuthEnc = store.Certificates.Find(X509FindType.FindByKeyUsage, (int)CertificateType.DigitalSignature, false);
  </code></pre>
  
  <p>`</p>
  
  <p>Here, <code>store.Certificates.Count</code> is coming as 0.</p>
  
  <p>Please help, how I can read certificates at client side?</p>