I am trying to generate keystore using keytool and getting below error -
D:\Java\bin>keytool -importkeystore -srckeystore cert1.p12 -srcstoretype pkcs12 -destkeystore cert1.keystore -deststoretype JKS
Enter destination keystore password:
Re-enter new password:
Enter source keystore password:
keytool error: java.io.IOException: parseAlgParameters failed: ObjectIdentifier() -- data isn't an object ID (tag = 48)
As @Klaws and @dave_thompson_085 suggested in the comments above, add the -legacy
parameter to the openssl pkcs12
command:
openssl pkcs12 -inkey cert1.private.key -in cert1.public.crt -export -out cert1.p12 -legacy
keytool -importkeystore -srckeystore cert1.p12 -srcstoretype pkcs12 -destkeystore cert1.keystore -deststoretype JKS
Updating the JDK will solve this issue. The old JDK used doesn't support an algorithm used by the imported keystore. This is fixed in more recent JDKs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With