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.
source
share