Cryptolens Client API for C++
Public Member Functions | Public Attributes | List of all members
cryptolens_io::v20180502::basic_SKM< RequestHandler, SignatureVerifier > Class Template Reference

#include <basic_SKM.hpp>

Public Member Functions

optional< LicenseKeyactivate (basic_Error &e, std::string token, std::string product_id, std::string key, std::string machine_code, int fields_to_return=0)
 
optional< RawLicenseKeyactivate_raw (basic_Error &e, std::string token, std::string product_id, std::string key, std::string machine_code, int fields_to_return=0)
 
optional< LicenseKeyactivate_floating (basic_Error &e, std::string token, std::string product_id, std::string key, std::string machine_code, long floating_time_interval, int fields_to_return=0)
 
RawLicenseKey activate_raw_exn (api::experimental_v1 experimental, std::string token, std::string product_id, std::string key, std::string machine_code, int fields_to_return=0)
 
optional< LicenseKeymake_license_key (basic_Error &e, std::string const &s)
 

Public Attributes

SignatureVerifier signature_verifier
 
RequestHandler request_handler
 

Detailed Description

template<typename RequestHandler, typename SignatureVerifier>
class cryptolens_io::v20180502::basic_SKM< RequestHandler, SignatureVerifier >

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.

Member Function Documentation

◆ activate()

template<typename RequestHandler , typename SignatureVerifier >
optional< LicenseKey > cryptolens_io::v20180502::basic_SKM< RequestHandler, SignatureVerifier >::activate ( basic_Error e,
std::string  token,
std::string  product_id,
std::string  key,
std::string  machine_code,
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: An optional with a RawLicenseKey representing if the request was successful or not.

◆ activate_floating()

template<typename RequestHandler , typename SignatureVerifier >
optional< LicenseKey > cryptolens_io::v20180502::basic_SKM< RequestHandler, SignatureVerifier >::activate_floating ( basic_Error e,
std::string  token,
std::string  product_id,
std::string  key,
std::string  machine_code,
long  floating_time_interval,
int  fields_to_return = 0 
)

Make a floating Activate request to the SKM 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 machine_code - the machine code, i.e. a string that identifies a device for activation. 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.

◆ activate_raw()

template<typename RequestHandler , typename SignatureVerifier >
optional< RawLicenseKey > cryptolens_io::v20180502::basic_SKM< RequestHandler, SignatureVerifier >::activate_raw ( basic_Error e,
std::string  token,
std::string  product_id,
std::string  key,
std::string  machine_code,
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: An optional with a RawLicenseKey representing if the request was successful or not.

◆ activate_raw_exn()

template<typename RequestHandler , typename SignatureVerifier >
RawLicenseKey cryptolens_io::v20180502::basic_SKM< RequestHandler, SignatureVerifier >::activate_raw_exn ( api::experimental_v1  experimental,
std::string  token,
std::string  product_id,
std::string  key,
std::string  machine_code,
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.


The documentation for this class was generated from the following file: