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

Cipher.wrap/unwrap methods should define UnsupportedOperationException

    XMLWordPrintable

Details

    • b94
    • generic
    • generic
    • Verified

    Description

      The recomendation for the provider implementation at
      http://java.sun.com/javase/6/docs/technotes/guides/security/crypto/HowToImplAProvider.html#Step3a
      specifies that engineWrap and engineUnwrap methods are optional and
      a SPI implementation might not implement it.

      If these methods are not implemented then the java.lang.UnsupportedOperationException
      is thrown by the defult implementation of these methods and as result it is thrown by Cipher.wrap()/unwrap() methods.
      But UnsupportedOperationException is not specified in the list of the
      Cipher.wrap()/unwrap() exceptions.

      I think that this exception must be specified.

      Other unspecified behavior is initialization of the Cipher for WRAP_MODE/UNWRAP_MODE mode if the wrapping of the keys is not supported.

      What kind of exception it can throw? The specification does not define it.

      Probably the UnsupportedOperationException can be defined in the Cipher.init() methods too.

      Attachments

        Issue Links

          Activity

            People

              ascarpino Anthony Scarpino
              msokolni Maxim Sokolnikov (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: