AES/RSA Ciphers not offered by UCrypto provider in JDK 8

XMLWordPrintable

      cat CipherInstanceTest1.java
      import javax.crypto.Cipher;

      public class CipherInstanceTest1 {
          public static void main(String[] args) {
              try {
                  Cipher cipher = Cipher.getInstance("AES", "OracleUcrypto");
                  System.out.println("AES cipher acquired: " + cipher.getProvider());
              } catch (Exception e) {
                  System.out.println("Failed to get AES cipher:");
                  e.printStackTrace();
              }

              try {
                  Cipher cipher2 = Cipher.getInstance("RSA", "OracleUcrypto");
                  System.out.println("RSA cipher acquired: " + cipher2.getProvider());
              } catch (Exception e) {
                  System.out.println("Failed to get RSA cipher:");
                  e.printStackTrace();
              }
          }
      }


      *****

       ./jdk8/bin/java CipherInstanceTest1
      warning: JDK development build detected. No jar verification of crypto jars enforced.
      Failed to get AES cipher:
      java.security.NoSuchAlgorithmException: No such algorithm: AES
              at javax.crypto.Cipher.getInstance(Cipher.java:707)
              at javax.crypto.Cipher.getInstance(Cipher.java:604)
              at CipherInstanceTest1.main(CipherInstanceTest1.java:6)
      Failed to get RSA cipher:
      java.security.NoSuchAlgorithmException: No such algorithm: RSA
              at javax.crypto.Cipher.getInstance(Cipher.java:707)
              at javax.crypto.Cipher.getInstance(Cipher.java:604)
              at CipherInstanceTest1.main(CipherInstanceTest1.java:14)

      JDK 8 docs say they should be offered:
      https://docs.oracle.com/javase/8/docs/technotes/guides/security/SunProviders.html#OracleUcrypto

            Assignee:
            Unassigned
            Reporter:
            Sean Coffey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: