0

I created a client.p12 keystore using openssl . Now I'm trying to import the private key using java Keytool into a new JKS keystore. I tried the command:

keytool -importkeystore -srckeystore "/certs/client.p12" -srcstoretype pkcs12 -srcstorepass "pass" -destkeystore /certs/keystore.jks -deststoretype pkcs12 -deststorepass "pass"

Java version used - 11.0.11

But I get the following error message:

keytool error: java.io.IOException: keystore password was incorrect

How can I resolve this error so I can import this key into a new JKS keystore?

  • 1
    Did you create the pkcs12 with OpenSSL 3.0.0 or higher? If so dupe https://stackoverflow.com/questions/72412346/java-keytool-importing-pkcs12-to-jks-getting-error-keystore-password-was-inc -- which is my first hit if I put "keytool pkcs12 'keystore password was incorrect'" in the search box -- didn't you try that? (I also get my answer as last hit, but that might be influenced because it was my search). – dave_thompson_085 Jun 16 '23 at 09:29
  • Thanks @dave_thompson_085 for your response .yes i am using higher version openssl – Swati Satrusalya Jun 19 '23 at 18:19

0 Answers0