如何解决java中的NoSuchAlgorithmException? [英] How to solve the NoSuchAlgorithmException in java?
问题描述
java.security.NoSuchAlgorithmException:找不到任何支持RSA的提供者/ ECB / PKCS5Padding
在javax.crypto.Cipher.getInstance(DashoA13 * ..)
如何解决这个异常?目前,我正在使用 java版本1.6.0_26
。
这是一个错字。使用PKCS#1 v1.5填充的RSA的正确名称为RSA / ECB / PKCS1Padding。
通常,与可用算法列表进行比较是个好主意。
例如此问题包含打印此类列表的一些方法。 / p>
(当然,使用OAEP而不是v1.5填充将是更可取的,特别是如果您的
主字段不是加密)。
I am trying to decrypt the data using RSA Algorithm. While doing the decryption, I am getting an exception.That is,
java.security.NoSuchAlgorithmException: Cannot find any provider supporting RSA/ECB/PKCS5Padding
at javax.crypto.Cipher.getInstance(DashoA13*..)
How to solve this exception? Currently, I am using java version "1.6.0_26"
.
It's a typo. The correct name for RSA with PKCS #1 v1.5 padding is "RSA/ECB/PKCS1Padding". Generally, it is a good idea to compare with a list of available algorithms. E.g. this question contains some ways to print such a list.
(And of course using OAEP instead of v1.5 padding would be preferable, especially if your main field is not cryptography).
这篇关于如何解决java中的NoSuchAlgorithmException?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!