Low-level license management — download/store license files, serial numbers, trials, and upgrades.
More...
#include <KeyzyLicenseManager.h>
Low-level license management — download/store license files, serial numbers, trials, and upgrades.
◆ KeyzyLicenseManager()
| Keyzy::KeyzyLicenseManager::KeyzyLicenseManager |
( |
std::shared_ptr< KeyzyLicenseProvider > | licenseProvider | ) |
|
Create an instance of KeyzyLicenseManager that will manipulate licenses for a product defined in ProductData structure
- Parameters
-
| productData | Structure that describes a product for which going to set/delete licenses |
| licenseProvider | is for not to create multiple object to prevent when update the license, update the provider |
◆ setSerialNumber()
| bool Keyzy::KeyzyLicenseManager::setSerialNumber |
( |
const std::string & | serial_number | ) |
|
Write serial number to a client machine. This serial should be used by KeyzyLicenseValidator to validate if serial number is valid.
- Parameters
-
| serial_number | Serial number |
- Returns
- true if serial has been set successfully, otherwise false
◆ setLicenseFile()
| bool Keyzy::KeyzyLicenseManager::setLicenseFile |
( |
const std::string & | license_file_path | ) |
|
Write license file to a client machine. This license file should be used by KeyzyLicenseValidator to validate if license file is valid.
- Parameters
-
| license_file_path | Absolute path to license file |
- Returns
- true if license file has been set successfully, otherwise false
◆ downloadLicenseFile() [1/2]
| LicenseStatus Keyzy::KeyzyLicenseManager::downloadLicenseFile |
( |
| ) |
|
|
noexcept |
Download license file from Keyzy server and write license file to a client machine. This license file should be used by KeyzyLicenseValidator to validate if license file is valid.
- Returns
- License status.
◆ downloadLicenseFile() [2/2]
| LicenseStatus Keyzy::KeyzyLicenseManager::downloadLicenseFile |
( |
const std::string & | serial_number | ) |
|
|
noexcept |
Download license file from Keyzy server and write license file to a client machine. This license file should be used by KeyzyLicenseValidator to validate if license file is valid.
- Parameters
-
| serial_number | Serial number |
- Returns
- License status
◆ upgradeLicense()
| LicenseStatus Keyzy::KeyzyLicenseManager::upgradeLicense |
( |
const std::string & | source_serial, |
|
|
const std::string & | target_serial ) |
|
noexcept |
Upgrade a license
- Parameters
-
| source_serial | Source serial number |
| target_serial | Target serial number to upgrade to |
- Returns
- License status
◆ setTrialLicense()
| bool Keyzy::KeyzyLicenseManager::setTrialLicense |
( |
std::tm | dueDate | ) |
|
Set trial license.
Write trial license to a client machine. This trial license should be used by KeyzyLicenseValidator to validate if license file is valid.
- Parameters
-
| dueData | Due date of trial license |
- Returns
- true if trial license has been set successfully, otherwise false
◆ deleteSerialNumber()
| bool Keyzy::KeyzyLicenseManager::deleteSerialNumber |
( |
| ) |
|
Delete serial number from a client machine
- Returns
- true if serial number has been deleted successfully, otherwise false
◆ deleteLicenseFile()
| bool Keyzy::KeyzyLicenseManager::deleteLicenseFile |
( |
| ) |
|
Delete license file from a client machine
- Returns
- true if license file has been deleted successfully, otherwise false
◆ deleteTrialLicense()
| bool Keyzy::KeyzyLicenseManager::deleteTrialLicense |
( |
| ) |
|
Delete trial license from a client machine
- Returns
- true if trial license has been deleted successfully, otherwise false