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

(spec) confusing exception list for javax.crypto.Cipher.init(...) for null Key

XMLWordPrintable

    • Cause Known
    • sparc
    • solaris_2.6

      Name: iiR10263 Date: 11/17/2003



      The specification requires javax.crypto.Cipher implementation to throw
      InvalidKeyException if specified key is inappropriate for
      initialization. The above means that if null Key is inappropriate
      InvalidKeyException instead of NullPointerException should be thrown.

      Unfortunately implementations of some SunJCE Cipher objects throw
      NullPointerException. This problem was reported in bug 4953551 but was
      closed as "will not fix". It is reasonable to correct specification
      in order to make throwing NullPointerException valid.

      The problem may be addressed by adding NullPointerExceptin to "Throws"
      section of the javax.crypto.Cipher.init(...) methods.

      ======================================================================

            kdriver Kevin Driver
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: