![]() |
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)
|
Validates licenses (online and offline) and exposes license fields (info, SKU, dealer, dates). More...
#include <KeyzyLicenseValidator.h>
Public Member Functions | |
| KeyzyLicenseValidator (std::shared_ptr< KeyzyLicenseProvider > licenseProvider) | |
| LicenseStatus | validateOnline () noexcept |
| LicenseStatus | validateOffline () noexcept |
| LicenseStatus | validateTrialLicense () noexcept |
| unsigned long long | getDaysToExpireTrial () |
| std::string | getHostIdHash () |
| std::string | getHostIdHashLegacy () |
| std::string | getLicenseeName () |
| std::string | getLicenseeEmail () |
| std::string | getVersion () |
| std::string | getSku () |
| std::string | getLicenseType () |
| LicenseType | getLicenseTypeEnum () |
| std::int64_t | getStartTime () |
| std::int64_t | getEndTime () |
| std::uint64_t | getDaysLeft () |
| std::uint64_t | getDaysTotal () |
| std::string | getInfo () |
| std::string | getDealerName () |
Validates licenses (online and offline) and exposes license fields (info, SKU, dealer, dates).
| Keyzy::KeyzyLicenseValidator::KeyzyLicenseValidator | ( | std::shared_ptr< KeyzyLicenseProvider > | licenseProvider | ) |
Create an instance of KeyzyLicenseValidator that will validate licenses for a product defined in ProductData structure
| productData | Structure that describes a product for which going to validate available licenses |
| licenseProvider | is for not to create multiple object to prevent when update the license, update the provider |
|
noexcept |
Validate license online for product specified in KeyzyLicenseValidator constructor. Sends the stored serial number to the KEYZY server for validation. Works for all license types: perpetual, subscription and server-side trial.
|
noexcept |
Validate license offline for product specified in KeyzyLicenseValidator constructor. Checks the locally stored encrypted license file without contacting the server. Works for all license types: perpetual, subscription and server-side trial.
|
noexcept |
Validate a local (client-only) trial license. This method checks the trial due date stored locally on the device. It does NOT contact the KEYZY server.
For server-side trial licenses (registered via LicenseDepositHandler::registerTrial or distributed through your own channel), use validateOnline(), validateOffline() or activateSemiOnline() instead, as they follow the same flow as perpetual and subscription licenses.
| unsigned long long Keyzy::KeyzyLicenseValidator::getDaysToExpireTrial | ( | ) |
Get days to expire a local (client-only) trial license. Not applicable for server-side trial licenses.
| std::string Keyzy::KeyzyLicenseValidator::getHostIdHash | ( | ) |
Get host id hash
| std::string Keyzy::KeyzyLicenseValidator::getHostIdHashLegacy | ( | ) |
Get host id hash legacy
| std::string Keyzy::KeyzyLicenseValidator::getLicenseeName | ( | ) |
Get Licensee Name string
| std::string Keyzy::KeyzyLicenseValidator::getLicenseeEmail | ( | ) |
Get Licensee Email string
| std::string Keyzy::KeyzyLicenseValidator::getVersion | ( | ) |
Get version string
| std::string Keyzy::KeyzyLicenseValidator::getSku | ( | ) |
Get sku string
| std::string Keyzy::KeyzyLicenseValidator::getLicenseType | ( | ) |
Get license type string
| LicenseType Keyzy::KeyzyLicenseValidator::getLicenseTypeEnum | ( | ) |
Get license type enum
| std::int64_t Keyzy::KeyzyLicenseValidator::getStartTime | ( | ) |
Get start time in Unix Timestamp Start time is eligble for only Subscription and Trial licenses it returns 315522000 default value if the license type is Perpetual
| std::int64_t Keyzy::KeyzyLicenseValidator::getEndTime | ( | ) |
Get end time in Unix Timestamp End time represents end time for Subscription and Trial licenses If the license type is Perpetual, it represents Offline License Life If Offline License Life is set to 0 on KEYZY dashboard, it returns 315522000 as default value If Offline License Life is set to different than 0, it returns end time of the license
| std::uint64_t Keyzy::KeyzyLicenseValidator::getDaysLeft | ( | ) |
Get how many days left in Unix Timestamp Days left represents how many days left to valid for Subscription and Trial licenses If the license type is Perpetual, it represents Offline License Life If Offline License Life is set to different than 0, it returns end time of the license
Don't use this function with Perpetual licenses
| std::uint64_t Keyzy::KeyzyLicenseValidator::getDaysTotal | ( | ) |
Get total days in Unix Timestamp Days total represents total days for Subscription and Trial licenses If the license type is Perpetual, the value is garbage
Don't use this function with Perpetual licenses
| std::string Keyzy::KeyzyLicenseValidator::getInfo | ( | ) |
Get info string info represents a string which is a custom text. The software provider can customize each license with this info text.
| std::string Keyzy::KeyzyLicenseValidator::getDealerName | ( | ) |
Get dealer name string. For dealer-distributed licenses, returns the dealer's display name as configured in the partner dashboard. Empty string for non-dealer licenses. Populated by both validateOnline() and validateOffline().