Cryptolens Client API for C++
|
#include <basic_Cryptolens.hpp>
Public Member Functions | |
basic_Cryptolens (basic_Error &e) | |
optional< LicenseKey > | activate (basic_Error &e, std::string token, int product_id, std::string key, int fields_to_return=0) |
optional< RawLicenseKey > | activate_raw (basic_Error &e, std::string token, int product_id, std::string key, int fields_to_return=0) |
optional< LicenseKey > | activate_floating (basic_Error &e, std::string token, int product_id, std::string key, long floating_time_interval, int fields_to_return=0) |
RawLicenseKey | activate_raw_exn (api::experimental_v1 experimental, std::string token, int product_id, std::string key, int fields_to_return=0) |
std::string | create_trial_key (basic_Error &e, std::string token, int product_id) |
std::string | last_message (basic_Error &e, std::string token, std::string channel, int since_unix_timestamp) |
optional< LicenseKey > | make_license_key (basic_Error &e, std::string const &s) |
Public Attributes | |
Configuration::ResponseParser | response_parser |
Configuration::RequestHandler | request_handler |
Configuration::SignatureVerifier | signature_verifier |
Configuration::MachineCodeComputer | machine_code_computer |
Configuration::template ActivateValidator< internal::ActivateEnvironment > | activate_validator |
This class makes it possible to interact with the Cryptolens Web API. Among the various methods available in the Web API the only ones currently supported in the C++ API are Activate and Deactivate.
This class uses two policy classes, SignatureVerifier and RequestHandler, which are responsible for handling verification of signatures and making requests to the Web API, respectivly. Consult the documentation for the chosen policy classes since in some cases special initialization may be neccessary.
optional< LicenseKey > cryptolens_io::v20190401::basic_Cryptolens< Configuration >::activate | ( | basic_Error & | e, |
std::string | token, | ||
int | product_id, | ||
std::string | key, | ||
int | fields_to_return = 0 |
||
) |
Make an Activate request to the Cryptolens Web API
Arguments: token - acces token to use product_id - the product id key - the serial key string, e.g. ABCDE-EFGHI-JKLMO-PQRST
Returns: An optional with a RawLicenseKey representing if the request was successful or not.
optional< LicenseKey > cryptolens_io::v20190401::basic_Cryptolens< Configuration >::activate_floating | ( | basic_Error & | e, |
std::string | token, | ||
int | product_id, | ||
std::string | key, | ||
long | floating_time_interval, | ||
int | fields_to_return = 0 |
||
) |
Make a floating Activate request to the Cryptolens Web API
A standard and a floating activate request differs in how the number of machine codes for the license is computed. The standard request computes the number of machine codes in the entire history. The floating request instead just computes the machine codes that have been activated recently, where the length of the interval is given by the floating_time_interval.
Arguments: token - acces token to use product_id - the product id key - the serial key string, e.g. ABCDE-EFGHI-JKLMO-PQRST floating_time_interval - we count machine codes that were created after current_time - floating_time_interval, where floating_time_interval is given in seconds.
Returns: An optional with a RawLicenseKey representing if the request was successful or not.
optional< RawLicenseKey > cryptolens_io::v20190401::basic_Cryptolens< Configuration >::activate_raw | ( | basic_Error & | e, |
std::string | token, | ||
int | product_id, | ||
std::string | key, | ||
int | fields_to_return = 0 |
||
) |
Make an Activate request to the Cryptolens Web API
Arguments: token - acces token to use product_id - the product id key - the serial key string, e.g. ABCDE-EFGHI-JKLMO-PQRST
Returns: An optional with a RawLicenseKey representing if the request was successful or not.
RawLicenseKey cryptolens_io::v20190401::basic_Cryptolens< Configuration >::activate_raw_exn | ( | api::experimental_v1 | experimental, |
std::string | token, | ||
int | product_id, | ||
std::string | key, | ||
int | fields_to_return = 0 |
||
) |
Make an Activate request to the Cryptolens Web API
Arguments: token - acces token to use product_id - the product id key - the serial key string, e.g. ABCDE-EFGHI-JKLMO-PQRST machine_code - the machine code, i.e. a string that identifies a device for activation.
Returns: A RawLicenseKey. If the request is unsuecessful an ActivateError is thrown.