标签:jdk security smart trace enc artifact 下载 rac print
第一种方式
1、修改以下两个文件
%JDK_Home%\jre\lib\security\java.security
%JRE_Home%\jre\lib\security\java.security
追加 最后一行
security.provider.1=sun.security.provider.Sun
security.provider.2=sun.security.rsa.SunRsaSign
security.provider.3=sun.security.ec.SunEC
security.provider.4=com.sun.net.ssl.internal.ssl.Provider
security.provider.5=com.sun.crypto.provider.SunJCE
security.provider.6=sun.security.jgss.SunProvider
security.provider.7=com.sun.security.sasl.Provider
security.provider.8=org.jcp.xml.dsig.internal.dom.XMLDSigRI
security.provider.9=sun.security.smartcardio.SunPCSC
security.provider.10=sun.security.mscapi.SunMSCAPI
security.provider.11=org.bouncycastle.jce.provider.BouncyCastleProvider
2、将bcprov-ext-jdk16-143.jar 放到
%JDK_Home%\jre\lib\ext
%JRE_Home%\jre\lib\ext
第二种方式
1、在工程内引入bcprov-ext-jdk16-1.46.jar包
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-ext-jdk16</artifactId>
<version>1.46</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
2、在加密类中加入静态块。
static{
try{
Security.addProvider(new BouncyCastleProvider());
}catch(Exception e){
e.printStackTrace();
}
}
bcprov-ext-jdk16-143.jar下载路径:
链接:https://pan.baidu.com/s/1Sy0o5Uu56QhfzudFyv1gAw
提取码:vl7v
java.security.NoSuchProviderException: no such provider: BC 的问题解决
标签:jdk security smart trace enc artifact 下载 rac print
原文地址:https://www.cnblogs.com/jinloooong/p/10875144.html