How do smart cards work for client certificate authentication

client-certificatessmartcardssl

I am trying to understand how client certificate authentication works with smart cards.

I've read about configuring Apache to authenticate users with a certificate. There are a lot of tutorials online, like APACHE web server and SSL authentication from LinuxConfig.

As far as I understand, once a certificate has been imported, anyone who can access the computer can launch the browser and use it. Thus, in the scenario of several users sharing the same account (or of an attacker having physical access to the computer and being able to log in), the user cannot be authenticated unequivocally. To avoid such a problem, when an account is shared, I could try not to store certificates in the browser.

Nowadays there are several USB tokens that can have certificates inside, which can be used to perform client certificate authentication to websites. Here are my questions about such devices:

  • By importing the certificate as a physical device, will the browser let me use the certificate as I imported it?
  • What happens if the certificate has a PIN? Does the browser ask for the PIN every time it is launched?
  • Can I be sure that the certificate cannot be extracted from the token/smart card reader? Therefore, unless the token is stolen, can I be sure that the certificate cannot be cloned?

Best Answer

by importing the certificate as a physical device, will the browser let me use the certificate as I imported it?

Yes. However you may recognize a higher delay when using a hardware token compared to a software token (e.g. for a smartcard 2-3 seconds).

what happens if the certificate has a pin? Does the browser ask for the pin every time it is launched?

by default e.g. Firefox only tries to access the client certificates if you connect to a web-page that has HTTPS client auth enabled. Then the PIN will be requested. Usually the PIN is then no longer needed as long as the token is not removed but that behavior may differ depending on the used PKCS#11 module (the software that connects Firefox with the token).

can I be sure that the certificate cannot be extracted frmo the token/smart card reader? Therefore, unless the token is stolen, can I be sure that the certificate cannot be cloned?

Then depends on the token. Some may have an API for extracting the private key but usually you can only use or delete private key + certificate from the token.