From 8a30943d44a2c40ea0321a2ddfc1123741504326 Mon Sep 17 00:00:00 2001 From: Looly Date: Mon, 26 Sep 2022 12:15:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E4=B8=8B=E4=BD=BF=E7=94=A8=20Bouncy=20Castle=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E7=9A=84JCE=20cannot=20authenticate=20the=20provider?= =?UTF-8?q?=20BC=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 ++- .../src/main/java/cn/hutool/crypto/ProviderFactory.java | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa1f7fd3f..a01250329 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ------------------------------------------------------------------------------------------------------------- -# 5.8.8.M1 (2022-09-24) +# 5.8.8.M1 (2022-09-26) ### 🐣新特性 * 【core 】 StreamUtil.of方法新增对 Iterator 支持;StreamUtil.of(Iterable) 方法优化(pr#807@Gitee) @@ -21,6 +21,7 @@ * 【poi 】 修复ExcelWriter导出List引起的个数混乱问题(issue#2627@Github) * 【poi 】 修复ExcelReader读取时间变成12小时形式问题(issue#I5Q1TW@Gitee) * 【db 】 修复DB工具分页查询的时候oracle数据库会把ROWNUM_也带出来问题(issue#2618@Github) +* 【crypto 】 修复部分环境下使用 Bouncy Castle可能的JCE cannot authenticate the provider BC问题(issue#2631@Github) ------------------------------------------------------------------------------------------------------------- diff --git a/hutool-crypto/src/main/java/cn/hutool/crypto/ProviderFactory.java b/hutool-crypto/src/main/java/cn/hutool/crypto/ProviderFactory.java index 9c52cba09..ff1ab1a0d 100644 --- a/hutool-crypto/src/main/java/cn/hutool/crypto/ProviderFactory.java +++ b/hutool-crypto/src/main/java/cn/hutool/crypto/ProviderFactory.java @@ -21,6 +21,9 @@ public class ProviderFactory { * @return {@link Provider} */ public static Provider createBouncyCastleProvider() { - return new org.bouncycastle.jce.provider.BouncyCastleProvider(); + final org.bouncycastle.jce.provider.BouncyCastleProvider provider = new org.bouncycastle.jce.provider.BouncyCastleProvider(); + // issue#2631@Github + SecureUtil.addProvider(provider); + return provider; } }