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
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#include <stdexcept>
12
13namespace Keyzy
14{
26 enum class HostIdScheme
27 {
28 V1 = 1,
29 V2 = 2
30 };
31
37 {
39 Online = 2
40 };
41
55
60 class CannotReadHostIdError : public std::runtime_error
61 {
62 public:
63 CannotReadHostIdError() : std::runtime_error("Cannot read host id") {}
64 };
65
93 {
104
122 ProductData(std::string appId, std::string apiKey, std::string productCode,
123 std::string cryptionKey, bool useHostIdInOfflineActivation = true,
124 HostIdScheme hostIdScheme = HostIdScheme::V2)
125 : _appId(appId)
126 , _apiKey(apiKey)
127 , _productCode(productCode)
128 , _cryptionKey(cryptionKey)
129 , _useHostIdInOffilneActivation(useHostIdInOfflineActivation)
130 , _hostIdScheme(hostIdScheme) {}
131
132 std::string _appId;
133 std::string _apiKey;
134 std::string _productCode;
135 std::string _cryptionKey;
138 };
139
182 {
183 std::string _skuNumber;
184 std::string _productCode;
185 std::string _licenseeName;
186 std::string _licenseeEmail;
187 std::string _versionCode;
188 std::string _licenseType;
189 std::int64_t _startTime = 315522000;
190 std::int64_t _endTime = 315522000;
191 std::string _info;
192 std::string _serialNumber;
193 };
194
251
260
264 enum class LicenseType
265 {
266 NOTYPE,
267 PERPETUAL,
268 TRIAL,
269 SUBSCRIPTION
270 };
271
272}; // Keyzy
273
274#endif // KEYZY_TYPES_H
LicenseType
Definition KeyzyTypes.h:265
HostIdScheme
Definition KeyzyTypes.h:27
@ V1
The host_id scheme used by SDK versions before 1.10.0. Keeps existing activations valid for products ...
Definition KeyzyTypes.h:28
@ V2
Default. Host_id from a stable firmware hardware identifier.
Definition KeyzyTypes.h:29
HostIdMigrationState
Definition KeyzyTypes.h:46
@ Interrupted
The move started but did not finish, so there is no license on the device for now; the reason is in t...
Definition KeyzyTypes.h:50
@ AlreadyV2
No V1 license to move and the V2 license is valid.
Definition KeyzyTypes.h:47
@ Moved
The license moved from V1 to V2 on this call.
Definition KeyzyTypes.h:48
@ NotNeededOnPlatform
No V1-to-V2 move is needed on this platform (its V2 host id equals V1); the normal start-up validatio...
Definition KeyzyTypes.h:53
@ WrongHostIdScheme
The activator was constructed with HostIdScheme::V1; nothing was done and the status is LicenseStatus...
Definition KeyzyTypes.h:52
@ NothingToMove
No working V1 or V2 license to move. The result of the normal start-up activation,...
Definition KeyzyTypes.h:51
@ StayedOnV1
The license stays on V1 for this start; whether it can be used is in the status. For the rest of this...
Definition KeyzyTypes.h:49
LicenseStatus
Definition KeyzyTypes.h:200
@ REACHED_MAX_NUMBER_OF_HOST
The license has reached its maximum number of activated devices (hosts). (Server-side).
Definition KeyzyTypes.h:211
@ SUBSCRIPTION_LICENSE_NOT_STARTED
The subscription license has not started yet (it has a future start date). (Server-side).
Definition KeyzyTypes.h:215
@ ANOTHER_TRIAL_LICENSE_ALREADY_ACTIVATED
A trial has already been activated on this device; a second trial is blocked. (Server-side).
Definition KeyzyTypes.h:228
@ SKU_NUMBER_VALIDATION
The sku_number parameter failed validation (HTTP 422). (Server-side).
Definition KeyzyTypes.h:229
@ UPGRADE_LICENSE_DOES_NOT_EXIST
During an upgrade, the target (upgrade) license serial does not exist on the KEYZY servers....
Definition KeyzyTypes.h:226
@ 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:224
@ CANNOT_READ_HOST_ID
The SDK could not read the device identifier. Happens locally, before any server contact....
Definition KeyzyTypes.h:249
@ NETWORK_HOSTS_TAMPERED
The address of the KEYZY server on this device points somewhere else, a strong sign of hosts-file or ...
Definition KeyzyTypes.h:247
@ SERIAL_INVALID
The serial number is invalid or not registered. (Server-side).
Definition KeyzyTypes.h:205
@ EXPIRED
A locally-stored (client-only) trial has expired. Returned by validateTrialLicense() in KeyzyLicenseV...
Definition KeyzyTypes.h:202
@ PRODUCT_NOT_EXIST_FOR_SKU
The product exists but is not part of the SKU linked to this license. (Server-side).
Definition KeyzyTypes.h:212
@ SERIAL_VALIDATION
The serial parameter failed validation (HTTP 422 on register). (Server-side).
Definition KeyzyTypes.h:236
@ TOO_MANY_REQUESTS
The client sent too many requests in a short time and was rate-limited (HTTP 429)....
Definition KeyzyTypes.h:223
@ NETWORK_REFUSED
TCP connection refused, typically a firewall blocking outbound HTTPS. Ask the user to check their fir...
Definition KeyzyTypes.h:243
@ CANNOT_KEEP_LICENSE_FILE
The SDK could not save the license file to the device (write failed, often a wrong or unwritable targ...
Definition KeyzyTypes.h:219
@ CODE_VALIDATION
Definition KeyzyTypes.h:237
@ TRIAL_LICENSE_NOT_STARTED
The server-side trial license has not started yet (future start date). (Server-side).
Definition KeyzyTypes.h:217
@ NETWORK_TIMEOUT
Connection timed out. With no HTTP 407, this is usually a firewall blocking outbound HTTPS or a proxy...
Definition KeyzyTypes.h:244
@ NO_FREE_LICENSES
No unassigned (free) licenses remain in this SKU's pool to register. Returned by registration flows (...
Definition KeyzyTypes.h:233
@ ACTIVATION_DEACTIVATED
This device's activation was deactivated (revoked) on the server. (Server-side).
Definition KeyzyTypes.h:213
@ ACTIVATION_DELETED
The activation was successfully removed from the KEYZY servers. A success status, returned by the dea...
Definition KeyzyTypes.h:220
@ PRODUCT_NOT_ACTIVE
The product exists but is not active. (Server-side).
Definition KeyzyTypes.h:208
@ NAME_VALIDATION
The name parameter failed validation (HTTP 422). (Server-side).
Definition KeyzyTypes.h:231
@ SKU_NOT_ACTIVE
The SKU exists but is not active. (Server-side).
Definition KeyzyTypes.h:210
@ CANNOT_KEEP_SERIAL
The SDK could not save the serial number to the device (write failed). Happens locally,...
Definition KeyzyTypes.h:218
@ PRODUCT_NOT_EXIST
The product code does not exist. (Server-side).
Definition KeyzyTypes.h:206
@ NETWORK_PROXY_REQUIRED
HTTP 407: the network requires an authenticated proxy. Ask the user to contact their IT department to...
Definition KeyzyTypes.h:246
@ SKU_NOT_EXIST
The SKU does not exist. (Server-side).
Definition KeyzyTypes.h:209
@ NAME_OR_EMAIL_VALIDATION
Definition KeyzyTypes.h:234
@ NETWORK_DNS_FAILED
The address of the KEYZY server could not be resolved. Likely no internet connection,...
Definition KeyzyTypes.h:242
@ EMAIL_VALIDATION
The email parameter failed validation. Rejected server-side (HTTP 422) or client-side (empty email in...
Definition KeyzyTypes.h:232
@ UPGRADE_LICENSE_DOES_NOT_MATCH
The target license is not a valid upgrade path for the current license. (Server-side).
Definition KeyzyTypes.h:227
@ PRODUCT_CODE_VALIDATION
The product_code parameter failed validation (HTTP 422). (Server-side).
Definition KeyzyTypes.h:230
@ CURRENT_LICENSE_DOES_NOT_EXIST
During an upgrade, the source (current) license serial does not exist on the KEYZY servers....
Definition KeyzyTypes.h:225
@ CLIENT_SERIAL_DOES_NOT_EXIST
No serial number is stored on the device. (Client-side).
Definition KeyzyTypes.h:221
@ TRIAL_LICENSE_EXPIRED
The server-side trial license has expired. (Distinct from EXPIRED, which is a local trial check....
Definition KeyzyTypes.h:216
@ CONNECTION_ERROR
Network or firewall error (umbrella). Returned when the connection fails at the network layer and no ...
Definition KeyzyTypes.h:222
@ VALID
The license is valid and active. The only success status for validation/activation calls (with ACTIVA...
Definition KeyzyTypes.h:201
@ INVALID
The license is invalid or could not be verified; generic failure when no more specific status applies...
Definition KeyzyTypes.h:203
@ 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:235
@ PRODUCT_NOT_EXIST_FOR_USER
The product code does not exist. (Server-side).
Definition KeyzyTypes.h:207
@ NOT_AUTHORIZED
The appId / apiKey pair is wrong or not authorized. (Server-side).
Definition KeyzyTypes.h:204
@ NETWORK_TLS_FAILED
TLS handshake failed: corporate SSL inspection, MITM or a wrong system clock. Ask the user to check t...
Definition KeyzyTypes.h:245
@ SUBSCRIPTION_LICENSE_EXPIRED
The subscription license has expired (its end date has passed). (Server-side).
Definition KeyzyTypes.h:214
HostIdMigrationMode
Definition KeyzyTypes.h:37
@ Online
The product uses activateOnline() and validateOnline().
Definition KeyzyTypes.h:39
@ SemiOnline
The product uses activateSemiOnline() or registerTrial().
Definition KeyzyTypes.h:38
Definition KeyzyTypes.h:256
LicenseStatus status
Whether the user can use the product now; handle it as in your start-up flow.
Definition KeyzyTypes.h:257
HostIdMigrationState state
What happened to the move.
Definition KeyzyTypes.h:258
License details filled in by the SDK: SKU, product code, licensee name/email, type,...
Definition KeyzyTypes.h:182
std::string _skuNumber
Definition KeyzyTypes.h:183
std::string _versionCode
Definition KeyzyTypes.h:187
std::string _licenseeEmail
Definition KeyzyTypes.h:186
std::string _info
Definition KeyzyTypes.h:191
std::string _licenseType
Definition KeyzyTypes.h:188
std::string _productCode
Definition KeyzyTypes.h:184
std::int64_t _endTime
Definition KeyzyTypes.h:190
std::string _serialNumber
Definition KeyzyTypes.h:192
std::string _licenseeName
Definition KeyzyTypes.h:185
std::int64_t _startTime
Definition KeyzyTypes.h:189
std::string _apiKey
Definition KeyzyTypes.h:133
ProductData(std::string appId, std::string apiKey, std::string productCode, std::string cryptionKey, bool useHostIdInOfflineActivation=true, HostIdScheme hostIdScheme=HostIdScheme::V2)
Creates the product identity used to authenticate with the KEYZY service.
Definition KeyzyTypes.h:122
std::string _appId
Definition KeyzyTypes.h:132
std::string _productCode
Definition KeyzyTypes.h:134
std::string _cryptionKey
Definition KeyzyTypes.h:135
ProductData()
Creates an empty ProductData. Fill in the members before use.
Definition KeyzyTypes.h:103
bool _useHostIdInOffilneActivation
Definition KeyzyTypes.h:136
HostIdScheme _hostIdScheme
Definition KeyzyTypes.h:137