当前位置: 动力学知识库 > 问答 > 编程问答 >

encryption - 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.

分享给朋友:
您可能感兴趣的文章:
随机阅读: