Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8275174

Add -version option to keytool and jarsigner

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P3 P3
    • 18
    • security-libs
    • None
    • behavioral
    • minimal
    • add/remove/modify command line option
    • JDK

      Summary

      Add -version option to keytool and jarsigner tools.

      Problem

      It would be useful to display the JDK version by a -version option for keytool and jarsigner tools. Many other JDK tools already provide a -version option.

      Solution

      Provide -version option in keytool and jarsigner that is used to print the program version of these tools.

      Specification

      Make the following changes to keytool manpage:

      @@ -53,6 +53,8 @@ keytool - a key and certificate management utility
      
           -   `-showinfo`: Displays security-related information
      
      +    -   `-version`: Prints the program version
      +
           See [Commands and Options] for a description of these commands with their
           options.
      
      @@ -184,6 +186,10 @@ perform.
      
       -   `-showinfo`
      
      +[Commands for Displaying Program Version]\:
      +
      +-   `-version`
      +
       ## Commands for Creating or Adding Data to the Keystore
      
       `-gencert`
      @@ -1117,6 +1123,10 @@ perform.
           information. The `-tls` option displays TLS configurations, such as
           the list of enabled protocols and cipher suites.
      
      +## Commands for Displaying Program Version
      +
      +You can use `-version` to print the program version of `keytool`.
      +
       ## Commands for Displaying Help Information
      
       You can use `--help` to display a list of `keytool` commands or to display help

      Make the following changes to jarsigner manpage:

      @@ -17,6 +17,8 @@ jarsigner - sign and verify Java Archive (JAR) files
      
       `jarsigner` `-verify` \[*options*\] *jar-file* \[*alias* ...\]
      
      +`jarsigner` `-version`
      +
       *options*
       :   The command-line options. See [Options for jarsigner].
      
      @@ -42,6 +44,9 @@ jarsigner - sign and verify Java Archive (JAR) files
       :   The aliases are defined in the keystore specified by `-keystore` or the
           default keystore.
      
      +`-version`
      +:   The `-version` option prints the program version of `jarsigner`.
      +
       ## Description
      
       The `jarsigner` tool has two purposes:
      @@ -779,6 +784,9 @@ the following standards:
           `jarsigner` arguments including the JAR file name and alias name(s) cannot
           be set in this file.
      
      +`-version`
      +:   Prints the program version.
      +
       ## Deprecated Options
      
       The following `jarsigner` options are deprecated as of JDK 9 and might be

            hchao Haimay Chao
            mullan Sean Mullan
            Weijun Wang
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: