Keytool is a tool to manage Java
keystores. Here are some useful commands to:
- generate a new key and place it in a keystore:
keytool -genkey -keystore myKeystore.jks -storepass myPass -alias myKey -keyalg RSA -sigalg SHA256withRSA -keysize 2048 -validity 3650 -ext ku=digitalSignature
- verify the content of a keystore:
keytool -list -keystore myKeystore.jks -storepass myPass -v
keytool -exportcert -keystore myKeystore.jks -storepass myPass -alias myAlias -rfc -file myPubKey.cer
keytool -delete -alias myAlias -keystore myKeystore.jks -storepass myPass
keytool -importkeystore -srckeystore myKeystore.jks -srcstorepass myPass -srcalias myAlias -destkeystore myNewKeystore.jks -deststorepass myNewPass -deststoretype JKS -destalias myNewAlias
keytool -import -noprompt -alias myAlias -keystore myKeystore.jks -file myPubKey.cer -storepass myPass
No comments:
Post a Comment
With great power comes great responsibility