Smart-cards¶
Since XCA 0.8.0 the use of Smart-cards (Security tokens) is supported. It is based on the PKCS#11 standard. The Options dialog contains a list to add one or more PKCS#11 providers (libraries). This is not restricted to Smart-cards but includes all type of security tokens like USB tokens.
Up to version 1.0.0 only RSA keys on security tokens were supported. Since version 1.1.0 XCA also supports EC and DSA private keys on security tokens.
Once again: This software comes with no warranty at all! If XCA transforms your security token into a fridge, don’t blame me. For me everything worked fine and I tested it thoroughly.
On Linux the package opensc should be installed. Please read the opensc documentation for more details. Generally: if the opensc command-line-tool pkcs11-tool -L shows reasonable output, XCA will work. Otherwise fix the opensc setup.
I had a functional setup with a “Reiner SCT” and a DELL keyboard with integrated card reader and TCOS Netkey E4 cards.
I also used Aladdin Etoken very successfully (Thanks for support!). The Aladdin PKCS#11 library supports all needed features very well.
The ECC token support was tested with the https://www.cardcontact.de ECC tokens. The OpenDNSSEC SoftHSMv2 was used as PKCS#11 reference implementation to test all the token algorithms and certificate and key download functionality to the token.
Before the keys of a token can be used, they must be imported into XCA. This means that XCA reads the token and shows the keys and certificates on the token. They can then be imported partially or completely via the Multi-import dialog to be used by XCA. It is not unusual that a token contains more than one key or certificate. It is of course possible to create your own keys on the token. When selecting a token-key for signing, XCA verifies that the corresponding token is available.
If the Card reader supports a secure PIN input by a built-in keyboard, it will be used by XCA and it will not ask for the PIN but waits for the Pin-pad input.
The following actions with smart-cards are supported:
Import keys and certificates from the token. (Token->Manage Security token)
Everything you can do with other keys can be done with tokens, too.
On export, only the Public key is exported.
Change the PIN and SO PIN of a token.
Create a key on the token. (Button New Key)
Store an existing key or certificate on the token. (Context menu of the item)
Delete certificates and keys from the token. (Context menu of the item)
Initialize cards and the user PIN via SO PIN
Existing, non-deletable, built-in certificates of Smart-cards may be ignored. A new CA certificate can be created and self-signed by the Smart-card key. It can then be used to issue end-entity certificates, containing other RSA, DSA or EC keys, sign imported certificate requests or generate CRLs.
Key Management on the Token¶
XCA assumes for every private key on the card a corresponding public key. When managing cards, XCA only searches for public keys. There is thus no need to enter a PIN. When using the key for signing the corresponding private key on the card is selected and a PIN must be entered.
Accordingly, every time a key is generated on the card, a public/private key-pair is generated. Every time a key is stored on the card, XCA creates a public and a private key object.
Firefox always only looks for private keys on the card. If XCA does not show a key, which is however recognized by Firefox a missing public-key object is the cause.