当前位置: 代码迷 >> 综合 >> JCE问题 :error constructing MAC: java.lang.SecurityException: JCE cannot authenticate the provider BC
  详细解决方案

JCE问题 :error constructing MAC: java.lang.SecurityException: JCE cannot authenticate the provider BC

热度:39   发布时间:2023-11-26 22:25:31.0

1.报错:

    <dependency><groupId>com.cybersource</groupId><artifactId>cybersource-sdk-java</artifactId><version>6.2.11</version></dependency>

在引入 cybersource的 依赖后,调用其api访问cybersource时报错:
error constructing MAC: java.lang.SecurityException: JCE cannot authenticate the provider BC

2.其他参考:

尝试了:
a.无政策限制权限文件Unlimited Strength Jurisdiction Policy Files
b.添加security.provider.x=org.bouncycastle.jce.provider.BouncyCastleProvider;加jar包依赖,bcprov-jdk15-135.jar 和bcprov-jdk16-143.jar 。
均未解决问题;

链接: https://stackoverflow.com/questions/13721579/jce-cannot-authenticate-the-provider-bc-in-java-swing-application.

3.最终解决方法:

根据官方说明:
链接: https://www.oracle.com/java/technologies/javase/17-relnote-issues.html.
在这里插入图片描述
最终通过将jdk更换成open jdk 解决此问题;

  相关解决方案