Reputation: 1288
I have a smartcard reader and a smartcard. I have installed drivers and it works as expected. I can use this card as windows logon or for remote desktop logon.
I'm building my app which should work only when the card is inserted and I need to call web services from my app which requires a certificate from the card.
Any suggestions on how do I do that? The web is full of examples for ASP.NET and I'm building Windows forms.
As a further note: Everything must work the same even if user logs on windows without the card. The card must me present for the app to work.
Thanks.
Upvotes: 2
Views: 4627
Reputation: 5422
If the Smartcard driver supports the standard Windows CryptoAPI, it will export the certificates from the card into the personal store of the user. You can access those certificates using the X509Store class. When you access the certificate, the user will be prompted to insert the card and enter his PIN.
Note: Some smartcard drivers do not automatically export the certificates. Instead, they have a tool which the user can use to do this.
Upvotes: 3