From 82de5a307466894bbb0258f8a63a26a7bb96d80d Mon Sep 17 00:00:00 2001 From: zhang <zc857179121@qq.com> Date: 星期四, 16 十月 2025 09:55:35 +0800 Subject: [PATCH] 13 --- src/main/java/com/zy/system/entity/license/LicenseVerify.java | 36 +++++++++++++++++++----------------- 1 files changed, 19 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/zy/system/entity/license/LicenseVerify.java b/src/main/java/com/zy/system/entity/license/LicenseVerify.java index da239c0..709df99 100644 --- a/src/main/java/com/zy/system/entity/license/LicenseVerify.java +++ b/src/main/java/com/zy/system/entity/license/LicenseVerify.java @@ -46,16 +46,16 @@ /** * 鏍¢獙License璇佷功 */ - public boolean verify(){ + public boolean verify() { try { LicenseManager licenseManager = LicenseManagerHolder.getInstance(null); DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); LicenseContent licenseContent = licenseManager.verify(); - logger.info(MessageFormat.format("璁稿彲璇佹牎楠岄�氳繃锛岃鍙瘉鏈夋晥鏈燂細{0} - {1}",format.format(licenseContent.getNotBefore()),format.format(licenseContent.getNotAfter()))); + logger.info(MessageFormat.format("璁稿彲璇佹牎楠岄�氳繃锛岃鍙瘉鏈夋晥鏈燂細{0} - {1}", format.format(licenseContent.getNotBefore()), format.format(licenseContent.getNotAfter()))); return true; - }catch (Exception e){ - logger.error("璁稿彲璇佹牎楠屽け璐ワ紒",e); + } catch (Exception e) { + logger.error("璁稿彲璇佹牎楠屽け璐ワ紒", e); return false; } } @@ -63,46 +63,48 @@ /** * 鏍¢獙License璇佷功骞惰幏鍙栬瘉涔︿俊鎭� */ - public LicenseContent getVerifyInfo(){ + public LicenseContent getVerifyInfo() { LicenseManager licenseManager = LicenseManagerHolder.getInstance(null); //鏍¢獙璇佷功 try { LicenseContent licenseContent = licenseManager.verify(); return licenseContent; - }catch (Exception e){ - logger.error("璁稿彲璇佹牎楠屽け璐ワ紒",e); + } catch (Exception e) { + logger.error("璁稿彲璇佹牎楠屽け璐ワ紒", e); return null; } } /** * 鍒濆鍖栬瘉涔︾敓鎴愬弬鏁� + * * @param param License鏍¢獙绫婚渶瑕佺殑鍙傛暟 * @return de.schlichtherle.license.LicenseParam */ - private LicenseParam initLicenseParam(LicenseVerifyParam param){ + private LicenseParam initLicenseParam(LicenseVerifyParam param) { Preferences preferences = Preferences.userNodeForPackage(LicenseVerify.class); CipherParam cipherParam = new DefaultCipherParam(param.getStorePass()); KeyStoreParam publicStoreParam = new CustomKeyStoreParam(LicenseVerify.class - ,param.getPublicKeysStorePath() - ,param.getPublicAlias() - ,param.getStorePass() - ,null); + , param.getPublicKeysStorePath() + , param.getPublicAlias() + , param.getStorePass() + , null); return new DefaultLicenseParam(param.getSubject() - ,preferences - ,publicStoreParam - ,cipherParam); + , preferences + , publicStoreParam + , cipherParam); } /** * 灏咮ase64瀛楃涓茶浆鎹负涓存椂鏂囦欢 + * * @param base64String Base64缂栫爜鐨勫瓧绗︿覆 - * @param filePrefix 鏂囦欢鍚嶅墠缂�锛堜緥濡� "license_"锛� - * @param fileSuffix 鏂囦欢鍚庣紑锛堜緥濡� ".lic"锛� + * @param filePrefix 鏂囦欢鍚嶅墠缂�锛堜緥濡� "license_"锛� + * @param fileSuffix 鏂囦欢鍚庣紑锛堜緥濡� ".lic"锛� * @return 鐢熸垚鐨勪复鏃禙ile瀵硅薄锛堣嚜鍔ㄥ湪JVM閫�鍑烘椂鍒犻櫎锛� * @throws IOException */ -- Gitblit v1.9.1