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

Cipher.getInstance() are underspecified

XMLWordPrintable

    • b46
    • generic, sparc
    • generic, solaris_2.6
    • Verified



      Name: vmR10215 Date: 03/15/2004


      The description of the method
      public static final Cipher getInstance(String transformation)
              throws NoSuchAlgorithmException,
              NoSuchPaddingException
      says:
      "Generates a Cipher object that implements the specified transformation.
      ...
           Parameters:
               transformation - the name of the transformation, e.g., DES/CBC/PKCS5Padding.
               See Appendix A in the Java Cryptography Extension Reference Guide for information about
               standard transformation names.
      ...
           Throws:
               NoSuchAlgorithmException - if the specified transformation is not available in the
               default provider package or any of the other provider packages that were searched.
               NoSuchPaddingException - if transformation contains a padding scheme that is not available."

      It is not clear from the spec. how the metod must behave if transformation
       - is null or
       - empty or
       - of wrong format (e.g. "aaa/bbb/ccc/ddd/fff", "///", ...)

      The same issue is applied to all Cipher.getInstance methods.

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

            valeriep Valerie Peng
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: