Cannot find any provider supporting RSA/NONE/OAEPPADDING

Got below error during web service request:- Cannot find any provider supporting RSA/NONE/OAEPPADDING
at javax.crypto.Cipher.getInstance(DashoA12275)

This appears to BouncyCastle is missing from class path.  Or Bouncycastle jar may still in the classpath – but it’s not picked as a crypto provider.

Try below solution:

Download the Bouncycastle jar corresponding to your JDK from here and copy it to [JAVA_HOME]\jre\lib\ext\

Set following in [JAVA_HOME]\jre\lib\security\ under;

# List of providers and their preference orders (see above):

In code add Bouncycastle as a provider.

import org.bouncycastle.jce.provider.BouncyCastleProvider;  
Security.addProvider(new BouncyCastleProvider());

Leave a Reply

Your email address will not be published. Required fields are marked *