I'm trying to convert a private key in a Java Keystore into PEM Format. This answer explains that the first step is to convert the keystore into PKCS12 format using the keytool command.
However, I get the following error:
$ keytool -importkeystore -srckeystore client.keystore.jks -destkeystore client1.p12 -srcstoretype JKS -deststoretype PKCS12 -srcalias client1 -destalias client1
...
keytool error: java.io.IOException: DER input, Integer tag error
Searching for this error online tells me that this has to do with encryption. I know the source keystore is encrypted, but supplying the passwords in the command gives the exact same error. How can I export the private key?