Cryptolens Client API for C++
Public Member Functions | List of all members
cryptolens_io::v20190401::LicenseKey Class Reference

#include <LicenseKey.hpp>

Public Member Functions

 LicenseKey (LicenseKeyInformation &&license_key_information, RawLicenseKey &&raw_license_key)
 
std::string to_string () const
 
LicenseKeyInformationget_license_key_information ()
 
LicenseKeyInformation const & get_license_key_information () const
 
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
 

Detailed Description

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();
}

Member Function Documentation

◆ check()

LicenseKeyChecker cryptolens_io::v20190401::LicenseKey::check ( ) const

Return a LicenseKeyChecker working on this LicenseKey object

◆ get_activated_machines()

optional< std::vector< ActivationData > > const & cryptolens_io::v20190401::LicenseKey::get_activated_machines ( ) const

Returns the list of activated machines

◆ get_allowed_machines()

optional< std::string > const & cryptolens_io::v20190401::LicenseKey::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.

◆ get_block()

bool cryptolens_io::v20190401::LicenseKey::get_block ( ) const

Returns if the license key is blocked

◆ get_created()

std::uint64_t cryptolens_io::v20190401::LicenseKey::get_created ( ) const

Returns the date and time the license key was created

Format is a unix time stamp in seconds.

◆ get_customer()

optional< Customer > const & cryptolens_io::v20190401::LicenseKey::get_customer ( ) const

Returns the customer object assigned to the license key

◆ get_data_objects()

optional< std::vector< DataObject > > const & cryptolens_io::v20190401::LicenseKey::get_data_objects ( ) const

Returns the data objects associated with the license key.

◆ get_expires()

std::uint64_t cryptolens_io::v20190401::LicenseKey::get_expires ( ) const

Returns the date and time the license key expires

Format is a unix time stamp in seconds.

◆ get_f1()

bool cryptolens_io::v20190401::LicenseKey::get_f1 ( ) const

Returns if the license key has feature 1

◆ get_f2()

bool cryptolens_io::v20190401::LicenseKey::get_f2 ( ) const

Returns if the license key has feature 2

◆ get_f3()

bool cryptolens_io::v20190401::LicenseKey::get_f3 ( ) const

Returns if the license key has feature 3

◆ get_f4()

bool cryptolens_io::v20190401::LicenseKey::get_f4 ( ) const

Returns if the license key has feature 4

◆ get_f5()

bool cryptolens_io::v20190401::LicenseKey::get_f5 ( ) const

Returns if the license key has feature 5

◆ get_f6()

bool cryptolens_io::v20190401::LicenseKey::get_f6 ( ) const

Returns if the license key has feature 6

◆ get_f7()

bool cryptolens_io::v20190401::LicenseKey::get_f7 ( ) const

Returns if the license key has feature 7

◆ get_f8()

bool cryptolens_io::v20190401::LicenseKey::get_f8 ( ) const

Returns if the license key has feature 8

◆ get_global_id()

optional< int > const & cryptolens_io::v20190401::LicenseKey::get_global_id ( ) const

Returns a unique global identifier for the license key

◆ get_id()

optional< int > const & cryptolens_io::v20190401::LicenseKey::get_id ( ) const

Returns the Id of the license key

◆ get_key()

optional< std::string > const & cryptolens_io::v20190401::LicenseKey::get_key ( ) const

Return the license key string, eg. ABCDE-EFGHI-JKLMO-PQRST

◆ get_maxnoofmachines()

optional< int > const & cryptolens_io::v20190401::LicenseKey::get_maxnoofmachines ( ) const

Returns the maximum number of machines/devices that may activate this license key.

◆ get_notes()

optional< std::string > const & cryptolens_io::v20190401::LicenseKey::get_notes ( ) const

Returns the notes field of the license key

◆ get_period()

int cryptolens_io::v20190401::LicenseKey::get_period ( ) const

Returns the duration of current license cycle, eg. 30 days

Format is given as number of days.

◆ get_product_id()

int cryptolens_io::v20190401::LicenseKey::get_product_id ( ) const

Returns the product Id of the license key

◆ get_sign_date()

std::uint64_t cryptolens_io::v20190401::LicenseKey::get_sign_date ( ) const

Returns the date the license key was created by the Web API

Format is a unix time stamp in seconds.

◆ get_trial_activation()

bool cryptolens_io::v20190401::LicenseKey::get_trial_activation ( ) const

Returns if trial activation is enabled


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