I want to leverage the Windows Certificate Store in my Java application. I am able to load a keystore from Windows-MY that has all the aliases/certs I need, but when loading it I am faced with a dialog box asking to "Please insert a smart card". If I click cancel on this a few times, they keystore still loads with the right content.
Is there a way to suppress this dialog box? Also is there a way to use the Windows certificate selection box from Java? The only answer I have seen on the net is this: https://social.msdn.microsoft.com/Forums/en-US/52dca221-1e05-44c1-8c45-9e0d4a807853/java-keystoreload-for-windowsmy-pops-up-insert-smart-card-window?forum=windowssecurity, but I don't want to have to remove anything because I don't expect the users to do that.
Here is how I am loading the keystore:
KeyStore ks = KeyStore.getInstance("Windows-MY");
ks.load(null, null);
I never tried to load the certificase through the keystore, but supplied them by means of System properties.
System.setProperty("javax.net.ssl.keyStoreType", "Windows-MY");
System.setProperty("javax.net.ssl.keyStore", "NONE");
System.setProperty("javax.net.ssl.trustStoreType", "Windows-ROOT");
System.setProperty("javax.net.ssl.trustStore", "NONE");
See also java SSL and cert keystore and How to use the Windows Keystore (MCS) with JDBC?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With