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

后端 未结 1 864
一向
一向 2021-02-10 10:58

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

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

This gives me exception as :

<

相关标签:
1条回答
  • 2021-02-10 11:42

    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.

    0 讨论(0)
提交回复
热议问题