简体   繁体   中英

RSA/NONE/PKCS1Padding giving error as java.security.NoSuchAlgorithmException

I am using "RSA/None/PKCS1Padding" as :

Cipher RSACipher = Cipher.getInstance("RSA/None/PKCS1Padding");

This gives me exception as :

java.security.NoSuchAlgorithmException: Cannot find any provider supporting RSA/None/PKCS1Padding

Thanks for help.

Try "RSA/ECB/PKCS1Padding" instead if you are running in an Oracle or Open JDK. It does not make too much sense to use a block cipher mode of encryption with RSA, but not all algorithm names are logical within the Java SE providers.

The Bouncy Castle Libraries support "RSA/None/PKCS1Padding" though. So maybe the code was written for Bouncy or Android.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM