Activates and deactivates licenses — online, semi-online, offline, trial, and upgrade flows. The main entry point for most integrations.
More...
#include <KeyzyLicenseActivator.h>
Activates and deactivates licenses — online, semi-online, offline, trial, and upgrade flows. The main entry point for most integrations.
◆ KeyzyLicenseActivator()
| Keyzy::KeyzyLicenseActivator::KeyzyLicenseActivator |
( |
const ProductData & | productData | ) |
|
Create an instance of KeyzyLicenseActivator that will activate / deactivate licenses for a product defined in ProductData structure
- Parameters
-
| productData | Structure that describes a product for which going to set/delete licenses |
◆ activateOnline()
| LicenseStatus Keyzy::KeyzyLicenseActivator::activateOnline |
( |
const std::string & | serialNumber | ) |
|
Sets the serial number to the device and validate it with KEYZY service If the validation fails, it deletes the serial number from the device
◆ deactivateOnline()
Deactivate the license with KEYZY service and delete the serial number from the device
◆ activateSemiOnline() [1/2]
| LicenseStatus Keyzy::KeyzyLicenseActivator::activateSemiOnline |
( |
const std::string & | serialNumber | ) |
|
Downloads the license file from KEYZY service with given serial number, validate the license file and keep the license file and serial number in the device. If there is a license file or serial number in the device before, they will be overwriten. If the validation fails, it deletes the license file and the serial number from the device.
- Parameters
-
| std::string | serialNumber the license serial number |
◆ activateSemiOnline() [2/2]
| LicenseStatus Keyzy::KeyzyLicenseActivator::activateSemiOnline |
( |
| ) |
|
Downloads the license file from KEYZY service with the serial number which was kept before, validate the license file and keep it in the device If the validation fails, it deletes the license file and the serial number from the device.
- Parameters
-
| std::string | serialNumber the license serial number |
◆ deactivateSemiOnline()
| LicenseStatus Keyzy::KeyzyLicenseActivator::deactivateSemiOnline |
( |
| ) |
|
Checks if the device can reach KEYZY service. Delete the license file. Deactivate the license with KEYZY service.
◆ activateOffline()
| LicenseStatus Keyzy::KeyzyLicenseActivator::activateOffline |
( |
const std::string & | licenseFilePath | ) |
|
This is not a real activation, it doesn't connected to KEYZY service. Your user should download the license file on the internet first and that is the activation for KEYZY service. We strongly recommend to set Offline License Life for offline licenses in KEYZY app even they are perpetual licenses.
◆ deactivateOffline()
| bool Keyzy::KeyzyLicenseActivator::deactivateOffline |
( |
| ) |
|
This is not a real deactivation, it doesn't connected to KEYZY service. Deletes the license file form the device only.
◆ activateClientTrial()
| LicenseStatus Keyzy::KeyzyLicenseActivator::activateClientTrial |
( |
const std::tm & | endTime | ) |
|
◆ deactivateClientTrial()
| bool Keyzy::KeyzyLicenseActivator::deactivateClientTrial |
( |
| ) |
|
Deletes local (client-only) trial license from the device. Does not affect server-side trial licenses.
- Returns
- true if it's success, false if it's failed.
◆ upgradeLicense() [1/2]
| LicenseStatus Keyzy::KeyzyLicenseActivator::upgradeLicense |
( |
const std::string & | targetSerial | ) |
|
Upgrade a license using the stored serial as the source. Reads the currently stored serial number from the device.
- Note
- This method only performs the upgrade on the KEYZY server. It does not activate or validate the new license, and does not store the target serial on the device. To activate the target serial afterward, use one of the activation methods (e.g. activateOnline, activateSemiOnline).
- Parameters
-
| targetSerial | Target serial number to upgrade to |
- Returns
- LicenseStatus::VALID on success, LicenseStatus::CLIENT_SERIAL_DOES_NOT_EXIST if no source serial is stored
◆ upgradeLicense() [2/2]
| LicenseStatus Keyzy::KeyzyLicenseActivator::upgradeLicense |
( |
const std::string & | sourceSerial, |
|
|
const std::string & | targetSerial ) |
Upgrade a license by providing both source and target serials explicitly.
- Note
- This method only performs the upgrade on the KEYZY server. It does not activate or validate the new license, and does not store the target serial on the device. To activate the target serial afterward, use one of the activation methods (e.g. activateOnline, activateSemiOnline).
- Parameters
-
| sourceSerial | Source serial number (current license) |
| targetSerial | Target serial number to upgrade to |
- Returns
- LicenseStatus