|
Cryptolens Client API for C++
|
#include <LicenseKeyInformation.hpp>
Public Member Functions | |
| LicenseKeyInformation (api::internal::main, int product_id, std::uint64_t created, std::uint64_t expires, int period, bool block, bool trial_activation, std::uint64_t sign_date, bool f1, bool f2, bool f3, bool f4, bool f5, bool f6, bool f7, bool f8, optional< int > id, optional< std::string > key, optional< std::string > notes, optional< int > global_id, optional< Customer > customer, optional< std::vector< ActivationData >> activated_machines, optional< int > maxnoofmachines, optional< std::string > allowed_machines, optional< std::vector< DataObject >> data_objects) | |
| LicenseKeyChecker | check () const |
| int | get_product_id () const |
| std::uint64_t | get_created () const |
| std::uint64_t | get_expires () const |
| int | get_period () const |
| bool | get_block () const |
| bool | get_trial_activation () const |
| std::uint64_t | get_sign_date () const |
| bool | get_f1 () const |
| bool | get_f2 () const |
| bool | get_f3 () const |
| bool | get_f4 () const |
| bool | get_f5 () const |
| bool | get_f6 () const |
| bool | get_f7 () const |
| bool | get_f8 () const |
| optional< int > const & | get_id () const |
| optional< std::string > const & | get_key () const |
| optional< std::string > const & | get_notes () const |
| optional< int > const & | get_global_id () const |
| optional< Customer > const & | get_customer () const |
| optional< std::vector< ActivationData > > const & | get_activated_machines () const |
| optional< int > const & | get_maxnoofmachines () const |
| optional< std::string > const & | get_allowed_machines () const |
| optional< std::vector< DataObject > > const & | get_data_objects () const |
Static Public Member Functions | |
| static optional< LicenseKeyInformation > | make (basic_Error &e, RawLicenseKey const &raw_license_key) |
| static optional< LicenseKeyInformation > | make (basic_Error &e, optional< RawLicenseKey > const &raw_license_key) |
| static optional< LicenseKeyInformation > | make_unsafe (basic_Error &e, std::string const &license_key) |
This immutable class represents a license key.
The class is constructed using the static factory make().
The check() method can be used to create a LicenseKeyChecker, which can be used to check properties of a license key in a convenient fashion. I.e.
if (key.check().has_feature(1).has_not_feature(2)) {
DO_SOMETHING();
} | LicenseKeyChecker cryptolens_io::v20190401::LicenseKeyInformation::check | ( | ) | const |
Return a LicenseKeyChecker working on this LicenseKeyInformation object
| optional< std::vector< ActivationData > > const & cryptolens_io::v20190401::LicenseKeyInformation::get_activated_machines | ( | ) | const |
Returns the list of activated machines
| optional< std::string > const & cryptolens_io::v20190401::LicenseKeyInformation::get_allowed_machines | ( | ) | const |
Returns the machine codes of those devices that will be prioritized during activation. Even if the limit is achieved, these will still be activated.
| bool cryptolens_io::v20190401::LicenseKeyInformation::get_block | ( | ) | const |
Returns if the license key is blocked
| std::uint64_t cryptolens_io::v20190401::LicenseKeyInformation::get_created | ( | ) | const |
Returns the date and time the license key was created
| optional< Customer > const & cryptolens_io::v20190401::LicenseKeyInformation::get_customer | ( | ) | const |
Returns the customer object assigned to the license key
| optional< std::vector< DataObject > > const & cryptolens_io::v20190401::LicenseKeyInformation::get_data_objects | ( | ) | const |
Returns the data objects associated with the license key.
| std::uint64_t cryptolens_io::v20190401::LicenseKeyInformation::get_expires | ( | ) | const |
Returns the date and time the license key expires
| bool cryptolens_io::v20190401::LicenseKeyInformation::get_f1 | ( | ) | const |
Returns if the license key has feature 1
| bool cryptolens_io::v20190401::LicenseKeyInformation::get_f2 | ( | ) | const |
Returns if the license key has feature 2
| bool cryptolens_io::v20190401::LicenseKeyInformation::get_f3 | ( | ) | const |
Returns if the license key has feature 3
| bool cryptolens_io::v20190401::LicenseKeyInformation::get_f4 | ( | ) | const |
Returns if the license key has feature 4
| bool cryptolens_io::v20190401::LicenseKeyInformation::get_f5 | ( | ) | const |
Returns if the license key has feature 5
| bool cryptolens_io::v20190401::LicenseKeyInformation::get_f6 | ( | ) | const |
Returns if the license key has feature 6
| bool cryptolens_io::v20190401::LicenseKeyInformation::get_f7 | ( | ) | const |
Returns if the license key has feature 7
| bool cryptolens_io::v20190401::LicenseKeyInformation::get_f8 | ( | ) | const |
Returns if the license key has feature 8
| optional< int > const & cryptolens_io::v20190401::LicenseKeyInformation::get_global_id | ( | ) | const |
Returns a unique global identifier for the license key
| optional< int > const & cryptolens_io::v20190401::LicenseKeyInformation::get_id | ( | ) | const |
Returns the Id of the license key
| optional< std::string > const & cryptolens_io::v20190401::LicenseKeyInformation::get_key | ( | ) | const |
Return the license key string, eg. ABCDE-EFGHI-JKLMO-PQRST
| optional< int > const & cryptolens_io::v20190401::LicenseKeyInformation::get_maxnoofmachines | ( | ) | const |
Returns the maximum number of machines/devices that may activate this license key.
| optional< std::string > const & cryptolens_io::v20190401::LicenseKeyInformation::get_notes | ( | ) | const |
Returns the notes field of the license key
| int cryptolens_io::v20190401::LicenseKeyInformation::get_period | ( | ) | const |
Returns the duration of current license cycle eg. 30 days
| int cryptolens_io::v20190401::LicenseKeyInformation::get_product_id | ( | ) | const |
Returns the product Id of he license key
| std::uint64_t cryptolens_io::v20190401::LicenseKeyInformation::get_sign_date | ( | ) | const |
Returns the date the license key was created by the Web API
| bool cryptolens_io::v20190401::LicenseKeyInformation::get_trial_activation | ( | ) | const |
Returns if trial activation is enabled
|
static |
Attempt to construct a LicenseKeyInformation from a RawLicenseKey
|
static |
Attempt to construct a LicenseKeyInformation from an optional containing a RawLicenseKey
|
static |
Attempt to construct a LicenseKeyInformation from a json string
This is unsafe in the sense that by passing in the json string directly there is no check of the cryptographic signature. The signature verification is instead performed during construction of a RawLicenseKey object. A LicenseKeyInformation object can then be constructed from the RawLicenseKey using another static factory.
1.8.13