Avoiding pop-up tips for smart cards when accessing windows - using Java

I want to access certificates in a Windows user certificate store ("Windows-MY") using a key store in java. Here is the code I'm using:

    KeyStore ks = KeyStore.getInstance("Windows-MY", "SunMSCAPI");
    ks.load(null, null);

Unfortunately, the execution of this code opens a pop-up window from the window, prompting the user to select a smart card.

After clicking cancel in this pop-up window (several times), the keystore is built correctly and access to certificates can be obtained.

Disabling the Smartcard service in Windows services helps, but then Smartcards can no longer be used (we use Smartcards in another use case). How can I access the Windows repository without this popup?

+4
source share
1 answer

In my case, it happened that the smart card software (or some middleware for smart cards that I installed, I'm not sure) wrote a registry entry: more details here

Registry path: HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Cryptography \ Defaults \ Provider (on Windows Xp and 7, both 32 64 bits are not tested on Win8)

offending entry

Removing this registry entry resolved my pop-up issue. Just to be careful, export the entry before deleting it; if something goes wrong, you can restore it. I had to delete and restore several records before finding an abusive one.

+3

Source: https://habr.com/ru/post/1569322/


All Articles