JCEはプロバイダーBCを認証できません



Jce Cannot Authenticate Provider Bc



エラーの理由:

オラクルのJDKを使用する場合、JARパッケージは、使用する前に特別な証明書で署名する必要があります。 (具体的な合意が何であるかを知らないのは恥ずかしいです。)



オプション1:

証明書の制限を回避できるように、openJDKまたは非OracleJDKを使用してください。プログラムは実際には運用されていません。別のプログラムがあります。



オプション2:

1.jvmインストール場所/ path_to_your_jvm / jre / lib / securityでjava.securityを見つけます

2. security.provider.9 = org.bouncycastle.jce.provider.BouncyCastleProviderを追加します



例えば:

security.provider.1=sun.security.provider.Sun security.provider.2=sun.security.rsa.SunRsaSign security.provider.3=com.sun.net.ssl.internal.ssl.Provider security.provider.4=com.sun.crypto.provider.SunJCE security.provider.5=sun.security.jgss.SunProvider security.provider.6=com.sun.security.sasl.Provider security.provider.7=org.jcp.xml.dsig.internal.dom.XMLDSigRI security.provider.8=sun.security.smartcardio.SunPCSC security.provider.9=org.bouncycastle.jce.provider.BouncyCastleProvider

この9は必ずしも9である必要はありませんが、以前のsecurity.providerシリアル番号に従って1ずつ増加します。

3. bcprov-jdk16-146.jar、bcmail-jdk16.143を/ path_to_your_jvm / jre / lib / extに追加します(提供します) Maven のアドレス)

4.他のBCライブラリを削除し、追加されていない場合はパスします

依存関係がMavenを介して追加される場合は、スコープを次のように設定します。提供

compile, the default value, applies to all stages and will be released with the project. provided, similar to compile, expect JDK, container or user to provide this dependency. Such as servlet.jar. When maven is packaged, the dependency will not be packaged into war or jar runtime, only used at runtime, such as JDBC driver, applicable to the runtime and test phases. test, used only during testing, is used to compile and run the test code. Will not be released with the project. system, similar to provided, needs to explicitly provide the jar that contains the dependencies, and Maven will not find it in the Repository.