判断java版本,开启

This commit is contained in:
egzosn
2024-06-24 16:38:51 +08:00
parent 49ff9e4109
commit 92d19b0d4b

View File

@@ -142,7 +142,6 @@ public enum SignUtils implements SignType {
};
@Override
public String getName() {
return this.name();
@@ -198,10 +197,14 @@ public enum SignUtils implements SignType {
* 初始化BC
*/
public static void initBc() {
if (null == Security.getProvider("BC")) {
Security.removeProvider("SunEC");
Security.addProvider(new BouncyCastleProvider());
String javaVersion = System.getProperty("java.version");
if (javaVersion.contains("1.8") || javaVersion.startsWith("8")) {
if (null == Security.getProvider("BC")) {
Security.removeProvider("SunEC");
Security.addProvider(new BouncyCastleProvider());
}
}
}