If the .keystore
does not exist i will be created
keytool -genkey -keystore .keystore -validity 300 \
-storepass myKeypass -keypass myKeypass -dname "CN=MyKey-Name" -alias MY-CERTKEY -storetype pkcs12
NOTE: For java version 11+, store password and key password must be equals.
keytool -keystore .keystore -certreq -file client-cert-sign-request \
-alias MY-CERTKEY -storepass myKeypass -keypass myKeypass