KEYZY C++ Client Library 1.9.0
To develop software that is compiled with a C++ compiler and utilizes the KEYZY service (www.keyzy.io)
Loading...
Searching...
No Matches
Keyzy::KeyzyLicenseManager Class Reference

Low-level license management — download/store license files, serial numbers, trials, and upgrades. More...

#include <KeyzyLicenseManager.h>

Public Member Functions

 KeyzyLicenseManager (std::shared_ptr< KeyzyLicenseProvider > licenseProvider)
bool setSerialNumber (const std::string &serial_number)
bool setLicenseFile (const std::string &license_file_path)
LicenseStatus downloadLicenseFile () noexcept
LicenseStatus downloadLicenseFile (const std::string &serial_number) noexcept
LicenseStatus upgradeLicense (const std::string &source_serial, const std::string &target_serial) noexcept
bool setTrialLicense (std::tm dueDate)
 Set trial license.
bool deleteSerialNumber ()
bool deleteLicenseFile ()
bool deleteTrialLicense ()

Detailed Description

Low-level license management — download/store license files, serial numbers, trials, and upgrades.

Constructor & Destructor Documentation

◆ 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
productDataStructure that describes a product for which going to set/delete licenses
licenseProvideris for not to create multiple object to prevent when update the license, update the provider

Member Function Documentation

◆ 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_numberSerial 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_pathAbsolute 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_numberSerial 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_serialSource serial number
target_serialTarget 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
dueDataDue 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