How to hide and use dialog boxes when using the Microsoft Crypto API (Windows Certificate Store)

I want to use the Windows certificate store in my Java application. I can download the keystore from Windows-MY, which has all the aliases / certificates that I need, but when I boot, I came across a dialog box asking β€œInsert smart card”. If I click the Cancel button several times, they will be loaded with the desired content.

Is there any way to suppress this dialog box? Also, is there a way to use the Windows Certificate Selection Window from Java? The only answer I saw on the net was: 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 do not want to delete anything because I do not expect users to do this.

This is how I load the keystore:

KeyStore ks = KeyStore.getInstance("Windows-MY"); ks.load(null, null); 
+8
java windows certificate cryptography keystore
source share
1 answer

I never tried to download certificates through the keystore, but supplied them using the 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 Keystore (MCS) Windows with JDBC?

+1
source share

All Articles