1 Reply Latest reply: Sep 22, 2010 11:18 AM by 799574 RSS

    Problem Using RSA Encryption (JCE) in Oracle JVM

    788281

      I have written a Java Stored Procedure that attempts to instantiate JCE classes using the RSA Algorithm, for example:
      cipher = Cipher.getInstance( "RSA" );

      Of course, this works just fine from a desktop Java install, but not on the Oracle server. (I have found that the Oracle server supports several Algorithms, including DES; but not RSA, DSA or EC - the three I'd like to be able to use for Public Key Encryption.)

      I consistently get this error message:
      java.security.NoSuchAlgorithmException: Cannot find any provider supporting RSA
      at javax.crypto.Cipher.getInstance(xxxxx)
      at MyRSA.encryptExt(MyRSA:117)
      at MyRSA.getPubExp(MyRSA:81)

      I thought perhaps the default SunJCE Provider was not being loaded, so had this permission granted:
      dbms_java.grant_permission( 'MyAcct', 'SYS:java.security.SecurityPermission', 'insertProvider.SunJCE', '' );

      Then added this to my Java Stored Procedure code:
      Security.addProvider(new com.sun.crypto.provider.SunJCE());

      However, that had no effect -- stil getting the same error message.

      So can anyone validate that Oracle has removed this Algorithm from their Java implementation, or can anyone tell me how to access RSA on the Oracle server? We are using Oracle Databse 10g, 10.2.0.4.0.

        • 1. Re: Problem Using RSA Encryption (JCE) in Oracle JVM
          799574
          Hello,

          I have the same problem.
          Now I tried to use Bouncy Castle Provider.

          I installed the Bouncy Castle Provider

          1) downloaded the jar file and copied it to jre/lib/ext: bcprov-jdk14-145.jar
          2) configured the provider in: jre/lib/security: java.security;
          3) downloaded unrestricted local_policy.jar

          I always get:
          java.security.NoSuchAlgorithmException: Cannot find any provider supporting RSA

          Has anyone an idea???

          Kind Regards
          Ramona Mohr