| 1234567891011121314151617181920212223242526272829303132333435363738 |
- sequenceDiagram
- participant App as 客户端应用
- participant LicenseFile as license.json
- participant Validator as 验证模块
- participant Hardware as 硬件模块
- App->>+LicenseFile: 读取license文件
- LicenseFile-->>-App: 返回license数据
- App->>+Validator: Base64解码(license.licenseData)
- Validator-->>-App: 获取原始数据
- App->>+Validator: Base64解码(license.signature)
- Validator-->>-App: 获取签名值
- App->>+Validator: 计算SM3(原始数据)
- Validator-->>-App: 生成待验签摘要
- App->>Validator: 用内置公钥验证签名
- alt 签名有效
- Validator->>Validator: 标记为可信数据
- else 签名无效
- Validator->>App: 立即终止启动
- end
- Validator->>+Validator: 验证有效期:
- Note over Validator: now >= validFrom &&<br/>now <= validTo
- Validator->>+Hardware: 获取设备指纹
- Hardware-->>-Validator: 返回MAC/CPUID等
- Validator->>Validator: 校验硬件信息(可选)
- alt 所有验证通过
- Validator->>App: 允许应用启动
- else 任一失败
- Validator->>App: 终止启动并报错
- end
|