license.h 687 B

12345678910111213141516171819202122232425
  1. #pragma once
  2. #include <string>
  3. namespace reginfo {
  4. struct LicenseInfo {
  5. std::string name;
  6. std::string machineCode;
  7. std::string phone;
  8. std::string unit;
  9. std::string authDateTime; // 授权日期
  10. std::string overDateTime; // 过期时间
  11. std::string updateDateTime; // 升级到期时间
  12. };
  13. // Generate an encrypted license file.
  14. // Returns true on success, false on failure.
  15. bool generateLicenseFile(const LicenseInfo& info, const std::string& filePath);
  16. // Read and decrypt a license file.
  17. // Returns the license info on success, throws std::runtime_error on failure.
  18. LicenseInfo readLicenseFile(const std::string& filePath);
  19. } // namespace reginfo