The Java Keytool is a command-line utility used for managing keystores containing cryptographic keys, X.509 certificates, and other artifacts needed for secure communication and authentication. With the Keytool, users can generate certificate requests and certificate chains, view keys and certificat...
The Java Keytool is a command-line utility used for managing keystores containing cryptographic keys, X.509 certificates, and other artifacts needed for secure communication and authentication. With the Keytool, users can generate certificate requests and certificate chains, view keys and certificates stored in a keystore, create or delete entries from a keystore, change the password for an entry in a keystore, or make changes to existing entries in a keystore. This powerful tool can also be used to convert between different keystore formats.
Size: 362.04 KB
Language: en
Added: Feb 22, 2023
Slides: 8 pages
Slide Content
A Simple Guide on Java Keytool Keystore Commands - By SSLWiki.org
Generate Root & Intermediate by Java Keytool Commands Generate a keystore and self-signed certificate: Generate a certificate signing request (CSR) for an existing Java keystore How to Generate a Java key pair and keystore keytool - genkey -alias mydomain - keyalg RSA -keystore keystore.jks - keysize 2048 keytool - certreq -alias mydomain -keystore keystore.jks -file mydomain.csr keytool - genkey - keyalg RSA -alias selfsigned -keystore keystore.jks - storepass password -validity 360 - keysize 2048 https://sslwiki.org/
Import Root & Intermediate by Java Keytool Commands Import a signed primary certificate to an existing Java keystore Import a root CA certificate to an existing Java keystore Import an intermediate CA certificate to an existing Java keystore: keytool -import - trustcacerts -alias intermediate -file intermediate.crt -keystore keystore.jks keytool -import - trustcacerts -alias root -file Thawte.crt -keystore keystore.jks keytool -import - trustcacerts -alias mydomain -file mydomain.crt -keystore keystore.jks https://sslwiki.org/
Java Keytool Commands for Checking Check a particular keystore entry using an alias: Check which certificates are in a Java keystore: Check a stand-alone certificate: keytool - printcert -v -file mydomain.crt keytool -list -v -keystore keystore.jks keytool -list -v -keystore keystore.jks -alias mydomain https://sslwiki.org/
Other Useful Java Keytool Commands Export Certificate From a Keystore Java Keystore Password Change Certificate Delete from Java Keytool Keystore keytool –delete –alias mydomain – keystorekeystore.jks keytool – storepasswd –new new_storepass – keystorekeystore.jks keytool –export –alias mydomain –file mydomain.crt – keystorekeystore.jks https://sslwiki.org/ Trusted CA Certs List keytool –list –v –keystore $JAVA_HOME/ jre /lib/security/ cacerts New CA Import into Trusted Certs keytool –import – trustcacerts –file /path/to/ca/ ca.pem –alias CA_ALIAS –keystore $JAVA_HOME/ jre /lib/security/ cacerts
Summary Java Keytool is an essential tool for secure handling of private keys and certificates. It is the primary method to store, protect, and manage the digital keys needed to authenticate a user, server process, or application. With Java Keytool , users can create and maintain their own public-private key pairs and certificates in a local keystore file. Reference URL: https://sslwiki.org/java-keytool-keystore-commands/