密码学 - Java 1.4 中的 RSA 算法
我正在使用 Java 1.4.2_10,并且尝试使用 RSA 加密:
我收到以下代码的 NoSuchAlgorithmException:
cipher = Cipher.getInstance("RSA");
这是错误:
java.security.NoSuchAlgorithmException: Cannot find any provider supporting RSA
at javax.crypto.Cipher.getInstance(DashoA6275)
这在 1.5 及更高版本中工作正常,但我需要使用 1.4。是否有任何解决方法或第三方产品可以用来解决此问题?
提前致谢。
I am using Java 1.4.2_10 and I am trying to use RSA encryption:
I am getting the NoSuchAlgorithmException for the following code:
cipher = Cipher.getInstance("RSA");
This is the error:
java.security.NoSuchAlgorithmException: Cannot find any provider supporting RSA
at javax.crypto.Cipher.getInstance(DashoA6275)
This works fine in 1.5 and above, however I need to use 1.4. Is there any workaround or thirdparty product that I can use to fix this?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以安装 Bouncy Castle 加密提供程序。只需抓住他们的罐子,然后调用 Cipher.getInstance("RSA", "BC")
You can install the Bouncy Castle cryptography provider. Just grab their jars and then call
Cipher.getInstance("RSA", "BC")
Java 1.4 绝对支持 RSA,所以这不起作用的事实表明更深层次的问题是错误的。这是否适用于任何其他密码(例如“AES”或“DES”)?您应该检查以确保您的提供商配置正确。以下代码在您的系统上的输出是什么:
Java 1.4 definitely supports RSA, so the fact that this isn't working suggests that something deeper is wrong. Does this work with any other ciphers (such as "AES" or "DES")? You should check to make sure your providers are properly configured. What is the output of the following code on your system: