KEYZY C++ Client Library 1.10.2
To develop software that is compiled with a C++ compiler and utilizes the KEYZY service (www.keyzy.io)
Loading...
Searching...
No Matches
KeyzyTypes.h File Reference

Public types for the Keyzy client SDK: LicenseStatus, LicenseType, ProductData, License. More...

#include <string>
#include <ctime>
#include <stdexcept>

Go to the source code of this file.

Classes

class  Keyzy::CannotReadHostIdError
struct  Keyzy::ProductData
 Your product's identity and credentials; construct one and pass it to KeyzyLicenseActivator to authenticate with the KEYZY service. More...
struct  Keyzy::LicenseInfo
 License details filled in by the SDK: SKU, product code, licensee name/email, type, dates, info text, and serial number. More...
struct  Keyzy::HostIdMigrationResult

Enumerations

enum class  Keyzy::HostIdScheme { V1 = 1 , V2 = 2 }
enum class  Keyzy::HostIdMigrationMode { SemiOnline = 1 , Online = 2 }
enum class  Keyzy::HostIdMigrationState {
  AlreadyV2 = 1 , Moved = 2 , StayedOnV1 = 3 , Interrupted = 4 ,
  NothingToMove = 5 , WrongHostIdScheme = 6 , NotNeededOnPlatform = 7
}
enum class  Keyzy::LicenseStatus {
  VALID , EXPIRED , INVALID , NOT_AUTHORIZED ,
  SERIAL_INVALID , PRODUCT_NOT_EXIST , PRODUCT_NOT_EXIST_FOR_USER , PRODUCT_NOT_ACTIVE ,
  SKU_NOT_EXIST , SKU_NOT_ACTIVE , REACHED_MAX_NUMBER_OF_HOST , PRODUCT_NOT_EXIST_FOR_SKU ,
  ACTIVATION_DEACTIVATED , SUBSCRIPTION_LICENSE_EXPIRED , SUBSCRIPTION_LICENSE_NOT_STARTED , TRIAL_LICENSE_EXPIRED ,
  TRIAL_LICENSE_NOT_STARTED , CANNOT_KEEP_SERIAL , CANNOT_KEEP_LICENSE_FILE , ACTIVATION_DELETED ,
  CLIENT_SERIAL_DOES_NOT_EXIST , CONNECTION_ERROR , TOO_MANY_REQUESTS , NO_ACTIVE_SUBSCRIPTION ,
  CURRENT_LICENSE_DOES_NOT_EXIST , UPGRADE_LICENSE_DOES_NOT_EXIST , UPGRADE_LICENSE_DOES_NOT_MATCH , ANOTHER_TRIAL_LICENSE_ALREADY_ACTIVATED ,
  SKU_NUMBER_VALIDATION , PRODUCT_CODE_VALIDATION , NAME_VALIDATION , EMAIL_VALIDATION ,
  NO_FREE_LICENSES , NAME_OR_EMAIL_VALIDATION , LICENSE_NOT_EXIST_NOT_ASSIGNED_DEALER_ALREADY_DEPOSITED , SERIAL_VALIDATION ,
  CODE_VALIDATION , NETWORK_DNS_FAILED , NETWORK_REFUSED , NETWORK_TIMEOUT ,
  NETWORK_TLS_FAILED , NETWORK_PROXY_REQUIRED , NETWORK_HOSTS_TAMPERED , CANNOT_READ_HOST_ID
}
enum class  Keyzy::LicenseType { NOTYPE , PERPETUAL , TRIAL , SUBSCRIPTION }

Detailed Description

Public types for the Keyzy client SDK: LicenseStatus, LicenseType, ProductData, License.

Enumeration Type Documentation

◆ HostIdScheme

enum class Keyzy::HostIdScheme
strong

Host id generation scheme. Selects how the SDK computes the device host_id. V2 is the default as of SDK 1.10.0: it computes the host_id from a stable firmware hardware identifier, so it survives network changes. V1 matches SDK versions before 1.10.0.

Warning
Changing the scheme on an already-released product changes device host_ids. To move a product released with V1 to V2, keep V2 and call KeyzyLicenseActivator::migrateHostIdV1toV2() on every start; without it, existing activations must re-activate. A product sold with offline licenses stays on V1.
Enumerator
V1 

The host_id scheme used by SDK versions before 1.10.0. Keeps existing activations valid for products released on those versions; the recommended path for them is V2 with KeyzyLicenseActivator::migrateHostIdV1toV2(), except a product sold with offline licenses, which stays on V1.

V2 

Default. Host_id from a stable firmware hardware identifier.

◆ HostIdMigrationMode

enum class Keyzy::HostIdMigrationMode
strong

Migration mode for KeyzyLicenseActivator::migrateHostIdV1toV2(). Choose the one that matches how the product activates its licenses.

Enumerator
SemiOnline 

The product uses activateSemiOnline() or registerTrial().

Online 

The product uses activateOnline() and validateOnline().

◆ HostIdMigrationState

enum class Keyzy::HostIdMigrationState
strong

What happened to the move in KeyzyLicenseActivator::migrateHostIdV1toV2().

Enumerator
AlreadyV2 

No V1 license to move and the V2 license is valid.

Moved 

The license moved from V1 to V2 on this call.

StayedOnV1 

The license stays on V1 for this start; whether it can be used is in the status. For the rest of this run, use an activator constructed with HostIdScheme::V1. The next start tries the move again.

Interrupted 

The move started but did not finish, so there is no license on the device for now; the reason is in the status. Once the cause is gone, the next call finishes the move with the stored serial.

NothingToMove 

No working V1 or V2 license to move. The result of the normal start-up activation, or the reason it could not run, is in the status.

WrongHostIdScheme 

The activator was constructed with HostIdScheme::V1; nothing was done and the status is LicenseStatus::INVALID. Construct it with HostIdScheme::V2.

NotNeededOnPlatform 

No V1-to-V2 move is needed on this platform (its V2 host id equals V1); the normal start-up validation or activation ran, its result is in the status.

◆ LicenseStatus

enum class Keyzy::LicenseStatus
strong

List of available status for licenses VALID and ACTIVATION_DELETED are Successful. Others are Error.

Enumerator
VALID 

The license is valid and active. The only success status for validation/activation calls (with ACTIVATION_DELETED for the deactivation flow).

EXPIRED 

A locally-stored (client-only) trial has expired. Returned by validateTrialLicense() in KeyzyLicenseValidator, deprecated since 1.10.0 with client-only trials. Use server-side trials (registerTrial()) instead; their expiry is reported as TRIAL_LICENSE_EXPIRED. (Client-side).

INVALID 

The license is invalid or could not be verified; generic failure when no more specific status applies.

NOT_AUTHORIZED 

The appId / apiKey pair is wrong or not authorized. (Server-side).

SERIAL_INVALID 

The serial number is invalid or not registered. (Server-side).

PRODUCT_NOT_EXIST 

The product code does not exist. (Server-side).

PRODUCT_NOT_EXIST_FOR_USER 

The product code does not exist. (Server-side).

PRODUCT_NOT_ACTIVE 

The product exists but is not active. (Server-side).

SKU_NOT_EXIST 

The SKU does not exist. (Server-side).

SKU_NOT_ACTIVE 

The SKU exists but is not active. (Server-side).

REACHED_MAX_NUMBER_OF_HOST 

The license has reached its maximum number of activated devices (hosts). (Server-side).

PRODUCT_NOT_EXIST_FOR_SKU 

The product exists but is not part of the SKU linked to this license. (Server-side).

ACTIVATION_DEACTIVATED 

This device's activation was deactivated (revoked) on the server. (Server-side).

SUBSCRIPTION_LICENSE_EXPIRED 

The subscription license has expired (its end date has passed). (Server-side).

SUBSCRIPTION_LICENSE_NOT_STARTED 

The subscription license has not started yet (it has a future start date). (Server-side).

TRIAL_LICENSE_EXPIRED 

The server-side trial license has expired. (Distinct from EXPIRED, which is a local trial check.) (Server-side).

TRIAL_LICENSE_NOT_STARTED 

The server-side trial license has not started yet (future start date). (Server-side).

CANNOT_KEEP_SERIAL 

The SDK could not save the serial number to the device (write failed). Happens locally, before any server contact. (Client-side).

CANNOT_KEEP_LICENSE_FILE 

The SDK could not save the license file to the device (write failed, often a wrong or unwritable target path). Happens locally. (Client-side).

ACTIVATION_DELETED 

The activation was successfully removed from the KEYZY servers. A success status, returned by the deactivation flow. (Server-side).

CLIENT_SERIAL_DOES_NOT_EXIST 

No serial number is stored on the device. (Client-side).

CONNECTION_ERROR 

Network or firewall error (umbrella). Returned when the connection fails at the network layer and no more specific NETWORK_* status applies. (Client-side).

TOO_MANY_REQUESTS 

The client sent too many requests in a short time and was rate-limited (HTTP 429). (Server-side).

NO_ACTIVE_SUBSCRIPTION 

The account holder has a subscription problem on the KEYZY side (i.e. your own KEYZY plan is inactive, not the end user's license). (Server-side).

CURRENT_LICENSE_DOES_NOT_EXIST 

During an upgrade, the source (current) license serial does not exist on the KEYZY servers. (Server-side).

UPGRADE_LICENSE_DOES_NOT_EXIST 

During an upgrade, the target (upgrade) license serial does not exist on the KEYZY servers. (Server-side).

UPGRADE_LICENSE_DOES_NOT_MATCH 

The target license is not a valid upgrade path for the current license. (Server-side).

ANOTHER_TRIAL_LICENSE_ALREADY_ACTIVATED 

A trial has already been activated on this device; a second trial is blocked. (Server-side).

SKU_NUMBER_VALIDATION 

The sku_number parameter failed validation (HTTP 422). (Server-side).

PRODUCT_CODE_VALIDATION 

The product_code parameter failed validation (HTTP 422). (Server-side).

NAME_VALIDATION 

The name parameter failed validation (HTTP 422). (Server-side).

EMAIL_VALIDATION 

The email parameter failed validation. Rejected server-side (HTTP 422) or client-side (empty email in register* calls). (Server-side & Client-side).

NO_FREE_LICENSES 

No unassigned (free) licenses remain in this SKU's pool to register. Returned by registration flows (including trial registration) when the pool is exhausted; generate more licenses for the SKU. (Server-side).

NAME_OR_EMAIL_VALIDATION 
Deprecated
Replaced by EMAIL_VALIDATION. Kept for ABI compatibility.
LICENSE_NOT_EXIST_NOT_ASSIGNED_DEALER_ALREADY_DEPOSITED 

Register-offline-distributed-license flow: the license does not exist, is not assigned to a dealer, or has already been deposited. (Server-side).

SERIAL_VALIDATION 

The serial parameter failed validation (HTTP 422 on register). (Server-side).

CODE_VALIDATION 
Deprecated
Kept for ABI compatibility.
NETWORK_DNS_FAILED 

The address of the KEYZY server could not be resolved. Likely no internet connection, or DNS is blocked on that network. Ask the user to check their internet connection.

NETWORK_REFUSED 

TCP connection refused, typically a firewall blocking outbound HTTPS. Ask the user to check their firewall settings.

NETWORK_TIMEOUT 

Connection timed out. With no HTTP 407, this is usually a firewall blocking outbound HTTPS or a proxy silently dropping the connection. Ask the user to check firewall/proxy settings.

NETWORK_TLS_FAILED 

TLS handshake failed: corporate SSL inspection, MITM or a wrong system clock. Ask the user to check the system date/time and any security software.

NETWORK_PROXY_REQUIRED 

HTTP 407: the network requires an authenticated proxy. Ask the user to contact their IT department to whitelist api.keyzy.io, or to configure proxy credentials at the OS level.

NETWORK_HOSTS_TAMPERED 

The address of the KEYZY server on this device points somewhere else, a strong sign of hosts-file or DNS manipulation. Advise the user to check their hosts file.

CANNOT_READ_HOST_ID 

The SDK could not read the device identifier. Happens locally, before any server contact. (Client-side).

◆ LicenseType

enum class Keyzy::LicenseType
strong

List of available types for licenses