Sunday, October 25, 2015

JKS keystore password vs key password

Something for me confusing (I get confused quite easily) is the relation between a JKS keystore password and a key password.
Some facts:
  • a .key file SHOULD always be protected by password.
  • a .jks store SHOULD always be protected by password.
  • not necessarily these 2 passwords should match


Once you have added a .key into a JKS, you can change the key's PW like this:
keytool -keypasswd -keystore keystore.jks -alias 

You can change the JKS PW like this:
keytool -storepasswd -new new_storepass -keystore keystore.jks


See also the excellent JKS guide and this very good FAQ
This is the keytool doc



No comments: