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

Add forRemoval=true to already deprecated ContentSigner

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P3
    • Resolution: Approved
    • Fix Version/s: 15
    • Component/s: security-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      source, behavioral
    • Compatibility Risk:
      low
    • Compatibility Risk Description:
      These classes were deprecated in JDK 9. No evidence of actual usage of these APIs so the compatibility impact is likely very low
    • Interface Kind:
      Java API, add/remove/modify command line option
    • Scope:
      JDK

      Description

      Summary

      Terminally deprecate (add `forRemoval=true) the following JDK-specific APIs, these APIs have been deprecated since JDK 9.

      com.sun.jarsigner.ContentSigner
      ContentSignerParameters

      Problem

      The function was deprecated in JDK 9. Now it's time to mark them for removal.

      Solution

      Add the forRemoval argument to the related classes and update several jarsigner outputs.

      Specification

      diff --git a/src/jdk.jartool/share/classes/com/sun/jarsigner/ContentSigner.java b/src/jdk.jartool/share/classes/com/sun/jarsigner/ContentSigner.java
      --- a/src/jdk.jartool/share/classes/com/sun/jarsigner/ContentSigner.java
      +++ b/src/jdk.jartool/share/classes/com/sun/jarsigner/ContentSigner.java
      @@ -38,7 +38,7 @@
        * @deprecated This class has been deprecated.
        */
      
      -@Deprecated(since="9")
      +@Deprecated(since="9", forRemoval=true)
       public abstract class ContentSigner {
      
           /**
      diff --git a/src/jdk.jartool/share/classes/com/sun/jarsigner/ContentSignerParameters.java b/src/jdk.jartool/share/classes/com/sun/jarsigner/ContentSignerParameters.java
      --- a/src/jdk.jartool/share/classes/com/sun/jarsigner/ContentSignerParameters.java
      +++ b/src/jdk.jartool/share/classes/com/sun/jarsigner/ContentSignerParameters.java
      @@ -36,7 +36,7 @@
        * @author Vincent Ryan
        * @deprecated This class has been deprecated.
        */
      -@Deprecated(since="9")
      +@Deprecated(since="9", forRemoval=true)
       public interface ContentSignerParameters {
      
           /**
      
      diff --git a/src/jdk.jartool/share/classes/com/sun/jarsigner/package-info.java b/src/jdk.jartool/share/classes/com/sun/jarsigner/package-info.java
      --- a/src/jdk.jartool/share/classes/com/sun/jarsigner/package-info.java
      +++ b/src/jdk.jartool/share/classes/com/sun/jarsigner/package-info.java
      @@ -30,9 +30,9 @@
        * tool by supplying an alternative implementation of
        * {@link com.sun.jarsigner.ContentSigner}.
        *
      - * The classes in this package have been deprecated. New classes should not be
      - * added to this package. Use the {@link jdk.security.jarsigner.JarSigner} API
      - * to sign JAR files.
      + * The classes in this package have been deprecated and will be removed in
      + * a future release. New classes should not be added to this package.
      + * Use the {@link jdk.security.jarsigner.JarSigner} API to sign JAR files.
        */
      
       package com.sun.jarsigner;

      Also, update jarsigner to show the following messages on the help screen:

      $ jarsigner
      Usage: jarsigner [options] jar-file alias
             jarsigner -verify [options] jar-file [alias...]
      
      ....
      [-altsigner <class>]        class name of an alternative signing mechanism
                                  (This option is deprecated and will be removed in a future release.)
      
      [-altsignerpath <pathlist>] location of an alternative signing mechanism
                                  (This option is deprecated and will be removed in a future release.)
      ....

      An updated warning will also be shown when an deprecated option is used:

      $ jarsigner -altsigner X
      This option is deprecated and will be removed in a future release: -altsigner

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                weijun Weijun Wang
                Reporter:
                weijun Weijun Wang
                Reviewed By:
                Alan Bateman, Sean Mullan, Xue-Lei Fan
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: