java.base/sun.security.tools.keytool.Main - "keytool" Command

Q

How to run "keytool" command from JDK lib\modules JImage file?

✍: FYIcenter

A

"keytool" command allows you to generate encryption keys and manage key certificates in key store files.

"keytool" command is supported by the jmods\jdk.base.jmod module file, which is also linked into the lib\modules JImage file in JDK 9, 10, and 11.

You can run the "keytool" command using the lib\modules JImage file as described below using JDK 11 as an example:

C:\fyicenter>set JDK_HOME=\fyicenter\jdk-11.0.1

C:\fyicenter>%JDK_HOME%\bin\java --module java.base/sun.security.tools.keytool.Main

Key and Certificate Management Tool

Commands:

 -certreq            Generates a certificate request
 -changealias        Changes an entry's alias
 -delete             Deletes an entry
 -exportcert         Exports certificate
 -genkeypair         Generates a key pair
 -genseckey          Generates a secret key
 -gencert            Generates certificate from a certificate request
 -importcert         Imports a certificate or a certificate chain
 -importpass         Imports a password
 -importkeystore     Imports one or all entries from another keystore
 -keypasswd          Changes the key password of an entry
 -list               Lists entries in a keystore
 -printcert          Prints the content of a certificate
 -printcertreq       Prints the content of a certificate request
 -printcrl           Prints the content of a CRL file
 -storepasswd        Changes the store password of a keystore

Use "keytool -?, -h, or --help" for this help message
Use "keytool -command_name --help" for usage of command_name.
Use the -conf <url> option to specify a pre-configured options file.

 

java.scripting/com.sun.tools.script.shell.Main - JavaScript Shell

java.base/java.util.regex.PrintPattern - Regex Pattern Parser

Tools Supported from JDK 9+ lib\modules JImage

⇑⇑ FAQ for JDK (Java Development Kit)

2019-10-18, 270👍, 0💬