Hi Mattias,
First, regarding your conclusion:
I can add that I've tried the corresponding demo class ListCerts of Assembla JCE Provider under the same conditions AND IT WORKS!
As far as I recall, the Assembla JCE is hardcoded to only search through the
Other People (ADDRESSBOOK) and the
Personal (MY) certificate stores, while JCAPI will search through all certificate stores that are defined/available for the current user. It shortly means that the problem cannot be trigged by the Assembla JCE provider since your
UserDS certificate store is never accessed by the Assembla JCE provider.
You can patch your problem by excluding the
UserDS certificate store in JCAPI i.e. you can use the following at the beginning of your program:
String[] certStores = JCAPIProperties.getInstance().getMSCertStoreNames();
ArrayList<String> al = new ArrayList<String>(Arrays.asList(certStores));
al.remove("UserDS");
certStores = al.toArray(new String[0]);
JCAPIProperties.getInstance().setMSCertStoreNames(certStores);
However, the code above will only solve your problem temporarily. So, in order to solve it correctly, we'll need some more information from you. Please supply answers to the following questions:
1. Do you have the same problem if you remove the smart card from your reader?
2. Do you have any certificates in your
UserDS certificate store? Hint: start the
mmc program and add the certificates snap-in (
File -> Add/Remove snap-in.. -> Add -> Certificates), then check if there are any certificates in the
Active Directory User Object folder.
3. Do you use the smart card to login on your system?
Regards,
Tommy