I am trying to automate keystore generation using the Java keystore tool. The command I am using is :
keytool -keystore keystore -alias jetty -genkey -keyalg
See the full documentation about command line or by typing keytool without any arguments.
keytool
Specifically you may want to look options -storepass password -keypass password
-storepass password -keypass password