2 License验证流程.mermaid 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. sequenceDiagram
  2. participant App as 客户端应用
  3. participant LicenseFile as license.json
  4. participant Validator as 验证模块
  5. participant Hardware as 硬件模块
  6. App->>+LicenseFile: 读取license文件
  7. LicenseFile-->>-App: 返回license数据
  8. App->>+Validator: Base64解码(license.licenseData)
  9. Validator-->>-App: 获取原始数据
  10. App->>+Validator: Base64解码(license.signature)
  11. Validator-->>-App: 获取签名值
  12. App->>+Validator: 计算SM3(原始数据)
  13. Validator-->>-App: 生成待验签摘要
  14. App->>Validator: 用内置公钥验证签名
  15. alt 签名有效
  16. Validator->>Validator: 标记为可信数据
  17. else 签名无效
  18. Validator->>App: 立即终止启动
  19. end
  20. Validator->>+Validator: 验证有效期:
  21. Note over Validator: now >= validFrom &&<br/>now <= validTo
  22. Validator->>+Hardware: 获取设备指纹
  23. Hardware-->>-Validator: 返回MAC/CPUID等
  24. Validator->>Validator: 校验硬件信息(可选)
  25. alt 所有验证通过
  26. Validator->>App: 允许应用启动
  27. else 任一失败
  28. Validator->>App: 终止启动并报错
  29. end