I am on Java 1.7.0_60.
I have a pfx keystore which I converted to JKS keystore using below:
keytool -importkeystore -srckeystore mypfx.pfx -srcstoretype pkcs12 -destkeystore myjks.jks -deststoretype jks
Now when I use this JKS keystore in my code to load the KeyStore object I get IOException: Invalid Keystore format
at line#3 in below snippet:
InputStream is = HttpTester.class.getClassLoader().getResourceAsStream("myjks.jks");
KeyStore identityKeyStore = KeyStore.getInstance("jks");
identityKeyStore.load(inputStream, CERT_PASSWORD.toCharArray());
I also verified that the newly created myjks.jks
keystore is not corrupted by doing this and was able to open up just fine
keytool -v -list -keystore myjks.jks
I am trying to do a mutual two-way SSL authentication which is why I am on this version of Java and also be able to deploy it onto a Websphere 8.5 server which only supports 1.7.
Any ideas?