11

I wanted to use https://stackoverflow.com/a/7094044/384674 for importing pem into p12, but keystore password is 5 characters and keytool is complaining it needs to be 6 :-/

keytool -import -alias alias -keystore ./trust.p12 -storetype PKCS12 -file new.pem
Enter keystore password:
Keystore password is too short - must be at least 6 characters

edit:

There was a comment, this is not working in some of later versions of keytool but comment was removed, please be aware or let us know as I do not know version I was testing with.

Betlista
  • 10,327
  • 13
  • 69
  • 110

1 Answers1

9

What I found is, that when you specify -storepass as a parameter, validation is not active.

Betlista
  • 10,327
  • 13
  • 69
  • 110
  • 5
    With recent versions of Java this is not true anymore. With OpenJDK 11.0.6 the error is now also present when specifying the password on the command line. – emmenlau Apr 17 '20 at 10:17
  • 1
    I use OpenJDK 11.0.12 and was able to use -storepass successfully – Cemre Mengü Oct 29 '21 at 08:51