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

SecretKeyFactory doesn't support algorithm "AES" on Windows and Linux

XMLWordPrintable

    • b134
    • generic
    • generic
    • Verified

      The CCC 5001004 integrated in JDK7 b130 defines the following security algorithm requirements for javax.crypto.SecretKeyFactory: AES DES DESede
      The algorithm "AES" is not supported on Windows and Linux.

      Please see the following code:
      -----------------------------------------------------------
      import java.security.NoSuchAlgorithmException;
      import javax.crypto.SecretKeyFactory;
      public class SKF {
          public static void main(String[] args) {
              String[] algorithms = {"AES", "DES", "DESede"};
              for (String alg : algorithms) {
                  try {
                      SecretKeyFactory.getInstance(alg);
                  } catch (NoSuchAlgorithmException e) {
                      e.printStackTrace();
                  }
              }
          }
      }
      -----------------------------------------------------------

      It's output on Windows and Linux is:
      -----------------------------------------------------------
      java.security.NoSuchAlgorithmException: AES SecretKeyFactory not available
      at javax.crypto.SecretKeyFactory.<init>(SecretKeyFactory.java:108)
      at javax.crypto.SecretKeyFactory.getInstance(SecretKeyFactory.java:146)
      at SKF.main(SKF.java:11)
      -----------------------------------------------------------

            mullan Sean Mullan
            dmiltsov Dmitry Miltsov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: