Hello,
I am working on a software that uses an API that is secured with a smart card. The manufacturer of the smart card is Athen (and the description is Athena IDProtect).
The problem is that when I use the certificate read from the user store, Windows requires me to enter the authentication PIN of the card (using the Smart Card dialog). Once I enter the PIN, I don’t need to enter the PIN again while the process is alive. But I would like to bypass this step and authenticate the card automatically, so if for some user the service gets restarted it doesn’t require human interaction.
So I looked into your library and managed to login on it using the user PIN and even obtain the X509Certificate2 from the smart card. However, if I use that certificate to authenticate my requests to the API I get back an error. The certificate object seems to be exactly the same as the one I read using the `new X509Store(StoreLocation.CurrentUser)` except for the fact that is does not have a PrivateKey set (the one read from the current’s user store location has the PrivateKey set).
I’ve been struggling to find an answer to this issue today and I was hoping maybe you could help me with a hint on how to bypass that Smart Card PIN dialog. Thanks in advance!
Regards,
Stefan Filip