java.security.NoSuchProviderException:没有这样的提供者:BC [英] java.security.NoSuchProviderException: no such provider: BC

查看:139
本文介绍了java.security.NoSuchProviderException:没有这样的提供者:BC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用AdvancedInstaller 9.8将javacode(webapplication)构建到安装程序。通常我的应用程序运行正常。使用Advanced Installer 9.8创建安装程序后,安装程序大小约为55 MB。但是高级安装程序中有一个选项可以压缩为安装而生成的所有罐子。如果我压缩罐子,安装程序大小约为16 MB。但是当我使用Advanced Installer 9.8进行压缩时,我在执行 KeyPairGenerator kpg = KeyPairGenerator.getInstance(RSA,BC)行时会遇到异常(如标题中所述);在我的代码中。 KeyPairGenerator再次来自java.security包。*;

I am using AdvancedInstaller 9.8 to build my javacode (webapplication) to an installer. Normally my application is running fine. After creating my installer with Advanced Installer 9.8, the installer size is around 55 MB. But there is an option in advanced installer to compress all the jars made for the installation. If i compress the jars, the installer size is around 16 MB. But when I compress with Advanced Installer 9.8, I am getting the exception (as mentioned in the title) when executing the line KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", "BC"); in my code. Again the KeyPairGenerator is from the package java.security.*;

请问有谁请告诉我,问题的原因可能是什么。我知道在使用AdvancedInstaller进行压缩时,可能会出现Advanced Installer压缩的问题。但我的问题是java方面通常可能出现的问题,以解决这个问题。 (我的意思是可能的原因,就像任何文件可能被损坏(或)等任何其他原因),以便我可以从那里开始工作。

Could anybody please let me know, what could be the cause of this issue. I know when compressing with AdvancedInstaller, it could be some issue with the Advanced Installer compressing. But my question is what could be normally the issue on java side, to get that issue. ( i mean what could be the reason, like any file can be corrupted (or) etc any other reasons) so that I can start working from there.

推荐答案

在代码前加上这一行:

Security.addProvider(new BouncyCastleProvider());

这篇关于java.security.NoSuchProviderException:没有这样的提供者:BC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆