Back to Demos
50/52
Java & KeytoolIntermediate
Java Keytool Commands
Essential keytool commands for managing Java keystores. Import, export, list, and delete certificates and keys.
Interactive Demo

Interactive keytool Builder
Select an operation, customize the parameters, and copy the generated command. All commands use PKCS12 format (recommended).
Read Full GuideGenerate Key Pair
$ keytool -genkeypair \
-alias mykey \
-keyalg RSA -keysize 2048 \
-keystore keystore.p12 -storetype PKCS12 \
-validity 365 \
-dname "CN=localhost,O=MyOrg,C=US" \
-storepass changeit -keypass changeitQuick Reference: Common Options
-storetype PKCS12Use PKCS12 format (recommended)
-storepass <password>Keystore password
-keypass <password>Private key password (if different)
-nopromptDon't prompt for confirmation