| 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
KeyzyTypes.h
Go to the documentation of this file.
1#ifndef KEYZY_TYPES_H
2#define KEYZY_TYPES_H
3
8
9#include <string>
10#include <ctime>
11
12 namespace Keyzy
13{
31 struct ProductData
32 {
33 ProductData() : _useHostIdInOffilneActivation(true) {}
34
35 ProductData(std::string appId, std::string apiKey, std::string productCode,
36 std::string cryptionKey, bool useHostIdInOfflineActivation = true)
37 : _appId(appId)
38 , _apiKey(apiKey)
39 , _productCode(productCode)
40 , _cryptionKey(cryptionKey)
41 , _useHostIdInOffilneActivation(useHostIdInOfflineActivation) {}
42
43 std::string _appId;
44 std::string _apiKey;
45 std::string _productCode;
46 std::string _cryptionKey;
47 bool _useHostIdInOffilneActivation;
48 };
49
91 struct LicenseInfo
92 {
93 std::string _skuNumber;
94 std::string _productCode;
95 std::string _licenseeName;
96 std::string _licenseeEmail;
97 std::string _versionCode;
98 std::string _licenseType;
99 std::int64_t _startTime = 315522000;
100 std::int64_t _endTime = 315522000;
101 std::string _info;
102 std::string _serialNumber;
103 };
104
109 enum class LicenseStatus
110 {
111 VALID,
112 EXPIRED,
113 INVALID,
114 NOT_AUTHORIZED,
115 SERIAL_INVALID,
116 PRODUCT_NOT_EXIST,
117 PRODUCT_NOT_EXIST_FOR_USER,
118 PRODUCT_NOT_ACTIVE,
119 SKU_NOT_EXIST,
120 SKU_NOT_ACTIVE,
121 REACHED_MAX_NUMBER_OF_HOST,
122 PRODUCT_NOT_EXIST_FOR_SKU,
123 ACTIVATION_DEACTIVATED,
124 SUBSCRIPTION_LICENSE_EXPIRED,
125 SUBSCRIPTION_LICENSE_NOT_STARTED,
126 TRIAL_LICENSE_EXPIRED,
127 TRIAL_LICENSE_NOT_STARTED,
128 CANNOT_KEEP_SERIAL,
129 CANNOT_KEEP_LICENSE_FILE,
130 ACTIVATION_DELETED,
131 CLIENT_SERIAL_DOES_NOT_EXIST,
132 CONNECTION_ERROR,
133 TOO_MANY_REQUESTS,
134 NO_ACTIVE_SUBSCRIPTION,
135 CURRENT_LICENSE_DOES_NOT_EXIST,
136 UPGRADE_LICENSE_DOES_NOT_EXIST,
137 UPGRADE_LICENSE_DOES_NOT_MATCH,
138 ANOTHER_TRIAL_LICENSE_ALREADY_ACTIVATED,
139 SKU_NUMBER_VALIDATION,
140 PRODUCT_CODE_VALIDATION,
141 NAME_VALIDATION,
142 EMAIL_VALIDATION,
143 NO_FREE_LICENSES,
144 NAME_OR_EMAIL_VALIDATION,
145 LICENSE_NOT_EXIST_NOT_ASSIGNED_DEALER_ALREADY_DEPOSITED,
146 SERIAL_VALIDATION,
147 CODE_VALIDATION,
148
149 // Network diagnostic statuses (SDK 1.9.0+). All are client-detected and
150 // returned by any method that makes a network request, when the call fails
151 // at the network layer (see the README error table for the full method list).
152 NETWORK_DNS_FAILED,
153 NETWORK_REFUSED,
154 NETWORK_TIMEOUT,
155 NETWORK_TLS_FAILED,
156 NETWORK_PROXY_REQUIRED,
157 NETWORK_HOSTS_TAMPERED
158 };
159
163 enum class LicenseType
164 {
165 NOTYPE,
166 PERPETUAL,
167 TRIAL,
168 SUBSCRIPTION
169 };
170
171}; // Keyzy
172
173#endif // KEYZY_TYPES_H
Keyzy::LicenseType
LicenseType
Definition KeyzyTypes.h:164
Keyzy::LicenseStatus
LicenseStatus
Definition KeyzyTypes.h:110
Keyzy::LicenseStatus::REACHED_MAX_NUMBER_OF_HOST
@ REACHED_MAX_NUMBER_OF_HOST
The license has reached its maximum number of activated devices (hosts). (Server-side).
Definition KeyzyTypes.h:121
Keyzy::LicenseStatus::SUBSCRIPTION_LICENSE_NOT_STARTED
@ SUBSCRIPTION_LICENSE_NOT_STARTED
The subscription license has not started yet (it has a future start date). (Server-side).
Definition KeyzyTypes.h:125
Keyzy::LicenseStatus::ANOTHER_TRIAL_LICENSE_ALREADY_ACTIVATED
@ ANOTHER_TRIAL_LICENSE_ALREADY_ACTIVATED
A trial has already been activated on this device; a second trial is blocked. (Server-side).
Definition KeyzyTypes.h:138
Keyzy::LicenseStatus::SKU_NUMBER_VALIDATION
@ SKU_NUMBER_VALIDATION
The sku_number parameter failed validation (HTTP 422). (Server-side).
Definition KeyzyTypes.h:139
Keyzy::LicenseStatus::UPGRADE_LICENSE_DOES_NOT_EXIST
@ UPGRADE_LICENSE_DOES_NOT_EXIST
During an upgrade, the target (upgrade) license serial does not exist on the KEYZY servers....
Definition KeyzyTypes.h:136
Keyzy::LicenseStatus::NO_ACTIVE_SUBSCRIPTION
@ NO_ACTIVE_SUBSCRIPTION
The account holder has a subscription problem on the KEYZY side (i.e. your own KEYZY plan is inactive...
Definition KeyzyTypes.h:134
Keyzy::LicenseStatus::NETWORK_HOSTS_TAMPERED
@ NETWORK_HOSTS_TAMPERED
The OS resolver returned a private/loopback IP for api.keyzy.io — a strong sign of hosts-file / DNS m...
Definition KeyzyTypes.h:157
Keyzy::LicenseStatus::SERIAL_INVALID
@ SERIAL_INVALID
The serial number is invalid or not registered. (Server-side).
Definition KeyzyTypes.h:115
Keyzy::LicenseStatus::EXPIRED
@ EXPIRED
A locally-stored trial has expired. Returned by validateTrialLicense() in KeyzyLicenseValidator....
Definition KeyzyTypes.h:112
Keyzy::LicenseStatus::PRODUCT_NOT_EXIST_FOR_SKU
@ PRODUCT_NOT_EXIST_FOR_SKU
The product exists but is not part of the SKU linked to this license. (Server-side).
Definition KeyzyTypes.h:122
Keyzy::LicenseStatus::SERIAL_VALIDATION
@ SERIAL_VALIDATION
The serial parameter failed validation (HTTP 422 on register). (Server-side).
Definition KeyzyTypes.h:146
Keyzy::LicenseStatus::TOO_MANY_REQUESTS
@ TOO_MANY_REQUESTS
The client sent too many requests in a short time and was rate-limited (HTTP 429)....
Definition KeyzyTypes.h:133
Keyzy::LicenseStatus::NETWORK_REFUSED
@ NETWORK_REFUSED
TCP connection refused — typically a firewall blocking outbound HTTPS. Ask the user to check their fi...
Definition KeyzyTypes.h:153
Keyzy::LicenseStatus::CANNOT_KEEP_LICENSE_FILE
@ CANNOT_KEEP_LICENSE_FILE
The SDK could not save the license file to the device (write failed — often a wrong or unwritable tar...
Definition KeyzyTypes.h:129
Keyzy::LicenseStatus::CODE_VALIDATION
@ CODE_VALIDATION
The code parameter failed validation (HTTP 422 on register-trial). (Server-side).
Definition KeyzyTypes.h:147
Keyzy::LicenseStatus::TRIAL_LICENSE_NOT_STARTED
@ TRIAL_LICENSE_NOT_STARTED
The server-side trial license has not started yet (future start date). (Server-side).
Definition KeyzyTypes.h:127
Keyzy::LicenseStatus::NETWORK_TIMEOUT
@ NETWORK_TIMEOUT
Connection timed out. With no HTTP 407, this is usually a firewall blocking outbound HTTPS or a proxy...
Definition KeyzyTypes.h:154
Keyzy::LicenseStatus::NO_FREE_LICENSES
@ NO_FREE_LICENSES
No unassigned (free) licenses remain in this SKU's pool to register. Returned by registration flows (...
Definition KeyzyTypes.h:143
Keyzy::LicenseStatus::ACTIVATION_DEACTIVATED
@ ACTIVATION_DEACTIVATED
This device's activation was deactivated (revoked) on the server. (Server-side).
Definition KeyzyTypes.h:123
Keyzy::LicenseStatus::ACTIVATION_DELETED
@ ACTIVATION_DELETED
The activation was successfully removed from the KEYZY servers. A success status, returned by the dea...
Definition KeyzyTypes.h:130
Keyzy::LicenseStatus::PRODUCT_NOT_ACTIVE
@ PRODUCT_NOT_ACTIVE
The product exists but is not active. (Server-side).
Definition KeyzyTypes.h:118
Keyzy::LicenseStatus::NAME_VALIDATION
@ NAME_VALIDATION
The name parameter failed validation (HTTP 422). (Server-side).
Definition KeyzyTypes.h:141
Keyzy::LicenseStatus::SKU_NOT_ACTIVE
@ SKU_NOT_ACTIVE
The SKU exists but is not active. (Server-side).
Definition KeyzyTypes.h:120
Keyzy::LicenseStatus::CANNOT_KEEP_SERIAL
@ CANNOT_KEEP_SERIAL
The SDK could not save the serial number to the device (write failed). Happens locally,...
Definition KeyzyTypes.h:128
Keyzy::LicenseStatus::PRODUCT_NOT_EXIST
@ PRODUCT_NOT_EXIST
The product code does not exist. (Server-side).
Definition KeyzyTypes.h:116
Keyzy::LicenseStatus::NETWORK_PROXY_REQUIRED
@ NETWORK_PROXY_REQUIRED
HTTP 407: the network requires an authenticated proxy. Ask the user to contact their IT department to...
Definition KeyzyTypes.h:156
Keyzy::LicenseStatus::SKU_NOT_EXIST
@ SKU_NOT_EXIST
The SKU does not exist. (Server-side).
Definition KeyzyTypes.h:119
Keyzy::LicenseStatus::NAME_OR_EMAIL_VALIDATION
@ NAME_OR_EMAIL_VALIDATION
Definition KeyzyTypes.h:144
Keyzy::LicenseStatus::NETWORK_DNS_FAILED
@ NETWORK_DNS_FAILED
DNS resolution failed (DoH and OS resolver both failed). Likely no internet, or DNS blocked....
Definition KeyzyTypes.h:152
Keyzy::LicenseStatus::EMAIL_VALIDATION
@ EMAIL_VALIDATION
The email parameter failed validation. Rejected server-side (HTTP 422) or client-side (empty email in...
Definition KeyzyTypes.h:142
Keyzy::LicenseStatus::UPGRADE_LICENSE_DOES_NOT_MATCH
@ UPGRADE_LICENSE_DOES_NOT_MATCH
The target license is not a valid upgrade path for the current license. (Server-side).
Definition KeyzyTypes.h:137
Keyzy::LicenseStatus::PRODUCT_CODE_VALIDATION
@ PRODUCT_CODE_VALIDATION
The product_code parameter failed validation (HTTP 422). (Server-side).
Definition KeyzyTypes.h:140
Keyzy::LicenseStatus::CURRENT_LICENSE_DOES_NOT_EXIST
@ CURRENT_LICENSE_DOES_NOT_EXIST
During an upgrade, the source (current) license serial does not exist on the KEYZY servers....
Definition KeyzyTypes.h:135
Keyzy::LicenseStatus::CLIENT_SERIAL_DOES_NOT_EXIST
@ CLIENT_SERIAL_DOES_NOT_EXIST
No serial number is stored on the device. (Client-side).
Definition KeyzyTypes.h:131
Keyzy::LicenseStatus::TRIAL_LICENSE_EXPIRED
@ TRIAL_LICENSE_EXPIRED
The server-side trial license has expired. (Distinct from EXPIRED, which is a local trial check....
Definition KeyzyTypes.h:126
Keyzy::LicenseStatus::CONNECTION_ERROR
@ CONNECTION_ERROR
Network or firewall error (umbrella). Returned when the connection fails at the network layer and no ...
Definition KeyzyTypes.h:132
Keyzy::LicenseStatus::VALID
@ VALID
The license is valid and active. The only success status for validation/activation calls (with ACTIVA...
Definition KeyzyTypes.h:111
Keyzy::LicenseStatus::INVALID
@ INVALID
The license is invalid or could not be verified — generic failure when no more specific status applie...
Definition KeyzyTypes.h:113
Keyzy::LicenseStatus::LICENSE_NOT_EXIST_NOT_ASSIGNED_DEALER_ALREADY_DEPOSITED
@ LICENSE_NOT_EXIST_NOT_ASSIGNED_DEALER_ALREADY_DEPOSITED
Register-offline-distributed-license flow: the license does not exist, is not assigned to a dealer,...
Definition KeyzyTypes.h:145
Keyzy::LicenseStatus::PRODUCT_NOT_EXIST_FOR_USER
@ PRODUCT_NOT_EXIST_FOR_USER
The product code does not exist. (Server-side) (Intentionally identical to PRODUCT_NOT_EXIST — see no...
Definition KeyzyTypes.h:117
Keyzy::LicenseStatus::NOT_AUTHORIZED
@ NOT_AUTHORIZED
The appId / apiKey pair is wrong or not authorized. (Server-side).
Definition KeyzyTypes.h:114
Keyzy::LicenseStatus::NETWORK_TLS_FAILED
@ NETWORK_TLS_FAILED
TLS handshake failed — corporate SSL inspection, MITM, or a wrong system clock. Ask the user to check...
Definition KeyzyTypes.h:155
Keyzy::LicenseStatus::SUBSCRIPTION_LICENSE_EXPIRED
@ SUBSCRIPTION_LICENSE_EXPIRED
The subscription license has expired (its end date has passed). (Server-side).
Definition KeyzyTypes.h:124
Keyzy::LicenseInfo
License details filled in by the SDK: SKU, product code, licensee name/email, type,...
Definition KeyzyTypes.h:92
Keyzy::LicenseInfo::_skuNumber
std::string _skuNumber
Definition KeyzyTypes.h:93
Keyzy::LicenseInfo::_versionCode
std::string _versionCode
Definition KeyzyTypes.h:97
Keyzy::LicenseInfo::_licenseeEmail
std::string _licenseeEmail
Definition KeyzyTypes.h:96
Keyzy::LicenseInfo::_info
std::string _info
Definition KeyzyTypes.h:101
Keyzy::LicenseInfo::_licenseType
std::string _licenseType
Definition KeyzyTypes.h:98
Keyzy::LicenseInfo::_productCode
std::string _productCode
Definition KeyzyTypes.h:94
Keyzy::LicenseInfo::_endTime
std::int64_t _endTime
Definition KeyzyTypes.h:100
Keyzy::LicenseInfo::_serialNumber
std::string _serialNumber
Definition KeyzyTypes.h:102
Keyzy::LicenseInfo::_licenseeName
std::string _licenseeName
Definition KeyzyTypes.h:95
Keyzy::LicenseInfo::_startTime
std::int64_t _startTime
Definition KeyzyTypes.h:99
Keyzy::ProductData::_apiKey
std::string _apiKey
Definition KeyzyTypes.h:44
Keyzy::ProductData::_appId
std::string _appId
Definition KeyzyTypes.h:43
Keyzy::ProductData::_productCode
std::string _productCode
Definition KeyzyTypes.h:45
Keyzy::ProductData::_cryptionKey
std::string _cryptionKey
Definition KeyzyTypes.h:46
Keyzy::ProductData::_useHostIdInOffilneActivation
bool _useHostIdInOffilneActivation
Definition KeyzyTypes.h:47