asp.net mvc - Can we use smart card authentication in Client Server Architecture? -


i trying develop asp.net web application accept smart card authentication. have created web app, deployed in iis. root certificate installed on iis machine trusted root directory authorized ca. web app, added server certificate, set require ssl , set accept certificates. when, client access web app, prompts client certificate, chrome gives prompt client certificate, smart card inserted client's machine, , when pin asked, user enters valid pin , able home page of web app. till, works expected @ point want read client certificate , want validate client certificate chain. also, based on on client certificate, want roles user. everytime try read client certificate, unable certificate. below code read smart card certificates:

`

x509store store = null; store = new x509store(storename.root); store.open(openflags.readonly); var certsauthenc = store.certificates.find(x509findtype.findbykeyusage, (int)certificatetype.digitalsignature, false); 

`

here, store.certificates.count coming 0.

please help, how can read certificates @ client side?

in sample, opening current user "root" store, it's not clear me why given description. store contains list of trusted roots have been configured admin , current user.

the current user's certificates in "my" store if looking for.

if want validate current users certificate in context of asp.net application reason want use x509chain (https://www.google.com/search?q=x509chain&oq=x509chain&aqs=chrome..69i57.318j0j7&sourceid=chrome&ie=utf-8) , not x509store.

this post helpful also: https://msdn.microsoft.com/en-us/library/ms148581(v=vs.110).aspx

ryan


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -