Hi Marco,
When you are not using the JCAPI SSL plugin, and instead uses the default key- and trust managers, then the following rules apply:
1. If JCAPI is required to export a private key, then JCAPI must be configured to export it i.e use the following code (see example program C:\JCAPI\examples\ssl\httpsclient\noclientauth\HTTPSClient.java):
JCAPIProperties.getInstance().setPrivateKeyExportable(true);
2. Only private keys that are exportable can be used i.e you cannot export private keys that are stored on a hardware token, nor can you export a key from MS CAPI that is marked as non-exportable.
If you want to use a hardware token with SSL than you can either use the JCAPI SSL plugin (which require Java 5 or higher since it uses SUN's PKCS#11 provider) or you can use SUN's PKCS#11 provider directly and use it together with the default key- and trust managers.
If you prefer the JCAPI SSL plugin, then please remember that you have to manually add your PKCS#11 supported CSP to JCAPI if the CSP is not supported by default, for example:
String cspName = "FooBar Cryptographic Service Provider";
String pkcs11FileName = "foobar.dll";
JCAPIUtil().addPKCS11CSP(cspName, pkcs11FileName);
Regards,
Tommy