修复部分环境下使用 Bouncy Castle可能的JCE cannot authenticate the provider BC问题

This commit is contained in:
Looly
2022-09-26 12:15:53 +08:00
parent eb370bf32e
commit 8a30943d44
2 changed files with 6 additions and 2 deletions

View File

@@ -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;
}
}