2 次代碼提交 ead4ab57ff ... cefbcd33d5

作者 SHA1 備註 提交日期
  wangpenghui cefbcd33d5 Merge remote-tracking branch 'origin/On-Premises/v1.0.0' into On-Premises/v1.0.0 10 月之前
  wangpenghui c961747f3d 添加设备id校验 10 月之前
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      pdf-tech-core/src/main/java/cn/kdan/pdf/tech/core/utils/KeyFileParseUtils.java

+ 3 - 0
pdf-tech-core/src/main/java/cn/kdan/pdf/tech/core/utils/KeyFileParseUtils.java

@@ -44,6 +44,9 @@ public class KeyFileParseUtils {
         String expireDate = properties.getProperty("ExpireDate");
         String users = properties.getProperty("Users");
         Sign sign = JsonUtils.jsonStringToBean(signJsonStr, Sign.class);
+        if (!Objects.deepEquals(ServerUtils.getDeviceId(),serverID)) {
+            throw new BackendRuntimeException("The key file signature is invalid.");
+        }
         if (!(Objects.deepEquals(sign.getServerID(),serverID)
                 && Objects.deepEquals(sign.getLicenseDate(),licenseDate)
                 && Objects.deepEquals(sign.getExpireDate(),expireDate)