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

Expected IAPE not thrown in KDF.getInstance (TCK)

XMLWordPrintable

      For the method -
      getInstance(String, KDFParameters, String)
      The expected InvalidAlgorithmParameterException not thrown when
      the specified provider supports the specified KDF algorithm but does not support the specified parameters
      Instead NoSuchAlgorithmException is thrown with the cause InvalidAlgorithmParameterException

      === sample code ===
      private void test01() {
          try {
              KDF.getInstance("HKDF-SHA512", new TestKDFParams(), "SunJCE");
          } catch (InvalidAlgorithmParameterException exception) {
              System.out.println("EXPECTED when the specified provider supports the specified KDF algorithm but does " +
                      "not support the specified parameters");
          } catch (Exception exception) {
              System.out.println("UNEXPECTED - " + exception);
              System.out.println("Cause - "+exception.getCause());
          }

      }

      static class TestKDFParams implements KDFParameters {
      }

            kdriver Kevin Driver
            kdriver Kevin Driver
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: