Converting Keystore - Windows-my to jks

We use SunMSCAPI to retrieve the current keystore, as shown below.

keystore = KeyStore.getInstance("Windows-MY", "SunMSCAPI");

We will need to create a JSSE repository of type JKS / PKCS12 and transfer it to the application.

Open the beginning to understand how it works. Any help would be appreciated.

+3
source share
1 answer

Did you try something like

keystore.load(inputStreamFromOriginalFile, password);
KeyStore keystore2 = KeyStore.getInstance("JKS");
for (String name : toIterable(keystore.aliases())) {
    Entry entry = keystore.getEntry(name, protParam);
    keystore2.setEntry(name, entry, protParam);
}
keystore2,store(outputStream, password);

I mean a dump copy of all the entries in the new keystore.

0
source

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


All Articles