0 Replies Latest reply on Jul 31, 2019 4:15 AM by 4009746

    PKCS12 Certificate created with Keytool in Java 11 doesn't work as trustStore


      Created Certificate and private key using keytool command line utility ( Using Java 11 ). And then imported certificate's in PKCS#12 type trustStore.


      When we try to load created PKCS#12 certificate in keystore inside program ( which run's on java 11.0.3 ), it is giving following Error:


      java.io.IOException: keystore password was incorrect

          at java.base/sun.security.pkcs12.PKCS12KeyStore.engineLoad(PKCS12KeyStore.java:2108)

          at java.base/sun.security.util.KeyStoreDelegator.engineLoad(KeyStoreDelegator.java:222)

          at java.base/java.security.KeyStore.load(KeyStore.java:1479)


      But when we ran same program on Java 12.0.1, and try to load same PKCS#12 certificate, it is not giving any error's and it works fine as expected.


      My Code Snippet:


      KeyStore trustStore = KeyStore.getInstance(KeyStore.getDefaultType());

      trustStore.load(trustStoreInputStream, "trustStorePassword".toCharArray());


      Similar Reported Bug's:



      Does PKCS#12 certificate's created with Java 11 does not supported in keystore ?


      This bug is fixed in Java 12 but still not back ported in Java 11 (11.0.4) till now ?