Online license activation flow. More...
#include <license.hpp>
Static Public Member Functions | |
| static std::optional< std::string > | activate (std::string_view server_url, std::string_view serial_number, std::string_view product_id, const OnlineActivationOptions &options={}) |
| Activate online with a serial number. | |
| static bool | deactivate (std::string_view server_url, std::string_view license_key, const OnlineActivationOptions &options={}) |
| Deactivate a license (free up a machine slot). | |
| static LicenseStatus | check_status (std::string_view server_url, std::string_view license_key, const OnlineActivationOptions &options={}) |
| Check license status with the server. | |
| static bool | server_url_allowed (std::string_view server_url, const OnlineActivationOptions &options={}) |
| True when server_url is an https:// origin, or http:// and the options allow it. | |
| static LicenseStatus | parse_status_response (std::string_view body) |
| Exact parse of a /status response body: a JSON object whose status member is the string "valid" or "expired" maps to Valid / Expired; anything else (other values, other fields, non-objects, malformed JSON) is InvalidSignature. | |
Online license activation flow.
Every exchange is a JSON POST to an https license server; the serial, license key and machine id travel in the request body, never in the URL.
|
static |
Activate online with a serial number.
Returns the license key on success.
|
static |
Check license status with the server.
Returns NotFound when the server is refused or unreachable, and InvalidSignature when it answered but did not vouch for the key (see parse_status_response).
|
static |
Deactivate a license (free up a machine slot).
|
static |
Exact parse of a /status response body: a JSON object whose status member is the string "valid" or "expired" maps to Valid / Expired; anything else (other values, other fields, non-objects, malformed JSON) is InvalidSignature.
The word "valid" appearing elsewhere in the body is not a verdict.
|
static |