Error java.security.NoSuchAlgorithmException: Algorithm %s Not Available When Executing Java Stored Procedure With Encryption (Doc ID 369369.1)

Last updated on JUNE 22, 2017

Applies to:

Oracle Database - Enterprise Edition - Version 10.2.0.2 and later
Information in this document applies to any platform.
***Checked for relevance on 22-Jun-2017***


Symptoms

When executing a java stored procedure using encryption provided by a third party provider the following error is returned:


java.security.NoSuchAlgorithmException: Cannot find any provider supporting RC4
at javax.crypto.Cipher.getInstance(DashoA6275)
at testEncrypt.testRSA(testEncrypt:46)


or , if you explicitly specify the provider in the call to KeyGenerator.getInstance (in this case BC for BouncyCastle):

java.security.NoSuchProviderException: JCE cannot authenticate the provider BC
at javax.crypto.SunJCE_b.a(DashoA6275)
at javax.crypto.SunJCE_b.a(DashoA6275)
at javax.crypto.KeyGenerator.getInstance(DashoA6275)
at TestEncryption.encrypt(TestEncryption:57)
Caused by: java.lang.NullPointerException
at javax.crypto.SunJCE_d.a(DashoA6275)
at javax.crypto.SunJCE_d.verify(DashoA6275)

Changes

You have loaded the provider's  .jar file using loadjava in order that the procedure compiles correctly and can execute the program from the command line with the provider's .jar file in the class path.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms