LicenseSpring C++ SDK  7.31.0
Easily add Software Licensing to your application
LicenseSpring::Configuration Class Reference

Class for configuring application. More...

#include <LicenseSpring/Configuration.h>

Public Types

using ptr_t = std::shared_ptr< Configuration >
 

Public Member Functions

 Configuration ()=default
 Constructor for internal needs, use Create instead. More...
 
const std::string & getApiKey () const
 Getter for API key (UUID). More...
 
const std::string & getSharedKey () const
 Getter for shared key. More...
 
const std::string & getProductCode () const
 Getter for product code. More...
 
const std::string & getAppName () const
 Getter for application name. More...
 
const std::string & getAppVersion () const
 Getter for application version. More...
 
const std::string & getCustomerAccount () const
 Returns customer group (account) code that is required for SSO. More...
 
void setCustomerAccount (const std::string &accountCode)
 Set customer group (account) code that is required for SSO. More...
 
const std::string & getAirGapPublicKey () const
 Getter for air gap public key. More...
 
void setAirGapPublicKey (const std::string &key)
 Setter for air gap public key. More...
 
const std::wstring & getLicenseFilePath () const
 This method is obsolete! Return license file path that was set through ExtendedOptions or empty string. More...
 
const std::string & getHardwareID ()
 Getter for device id. More...
 
void setHardwareID (const std::string &deviceId)
 Setter for device id. More...
 
void setDeviceIdAlgorithm (DeviceIDAlgorithm algorithm)
 Setter for DeviceIDAlgorithm. More...
 
bool isCollectNetworkInfoEnabled () const
 Checker for if collection of network information is enabled in ExtendedOptions. More...
 
bool isLoggingEnabled () const
 Checker for if logging is enabled in ExtendedOptions. More...
 
bool isGuardFileEnabled () const
 Checker for whether guard file usage is enabled in ExtendedOptions. More...
 
bool isSSLCheckEnabled () const
 Checker for whether SSL certificate verification is enabled. More...
 
bool isNativeTLSEnabled () const
 Checker for whether native TLS for curl enabled or not. More...
 
uint32_t getGracePeriod () const
 Getter for grace period. More...
 
long getNetworkTimeout () const
 Getter for network timeout. More...
 
void setNetworkTimeout (long timeoutValue)
 Setter for network timeout. More...
 
const ProxySettingsgetProxySettings () const
 Getter for ProxySettings object. More...
 
uint32_t getLicenseSpringAPIVersion () const
 Getter for LicenseSpring API version. More...
 
const std::string & getSdkVersion () const
 Getter for LicenseSpring SDK version. More...
 
const std::string & getOsVersion () const
 Getter for Operating System version. More...
 
const std::string & getHostName () const
 Getter for Host Name. More...
 
const std::string & getIP () const
 Getter for IP Address. More...
 
const std::string & getMAC () const
 Getter for MAC Address. More...
 
const NetworkInfogetNetworkInfo () const
 Getter for Network Information. More...
 
bool isVMDetectionEnabled () const
 Checker for whether Virtual Machine Detection is enabled. More...
 
bool isVM () const
 Checker for whether the user is on a virtual machine. More...
 
const std::string & getDetectedVMName () const
 Getter for hypervisor name, calls isVM first if not yet called. More...
 
CryptoProvider::ptr_t getCryptoProvider ()
 Getter for crypto provider. More...
 
const std::string & getAlternateServiceUrl () const
 Getter for alternate service URL. More...
 
const std::string & getAlternateKey () const
 Getter for alternate public key. More...
 
const std::string & getUserInfo () const
 Returns custom information to be passed along with all API requests. More...
 
void setUserInfo (const std::string &customInfo)
 Set custom information to be passed to the backend with all API requests. More...
 

Static Public Member Functions

static ptr_t Create (const std::string &apiKey, const std::string &sharedKey, const std::string &productCode, const std::string &appName, const std::string &appVersion, const ExtendedOptions &extendedOptions=ExtendedOptions())
 Creates shared pointer for configuration object. More...
 

Detailed Description

Class for configuring application.

Used to store information regarding the options related to the application configuration.

Definition at line 17 of file Configuration.h.

Member Typedef Documentation

◆ ptr_t

Definition at line 20 of file Configuration.h.

Constructor & Destructor Documentation

◆ Configuration()

LicenseSpring::Configuration::Configuration ( )
default

Constructor for internal needs, use Create instead.

Member Function Documentation

◆ Create()

static ptr_t LicenseSpring::Configuration::Create ( const std::string &  apiKey,
const std::string &  sharedKey,
const std::string &  productCode,
const std::string &  appName,
const std::string &  appVersion,
const ExtendedOptions extendedOptions = ExtendedOptions() 
)
static

Creates shared pointer for configuration object.

Acts as constructor for configuration class.

Parameters
apiKeyVendor API key (UUID)
sharedKeyVendor shared key
productCodeProduct code
If you configuring FloatingServer v1.1.9 or earlier provide Product name instead of Product code
appNameName of application
appVersionVersion of application
extendedOptionsExtendedOptions object to attach to configuration
Exceptions
ConfigurationExceptionIf API/shared key or product code are empty

◆ getApiKey()

const std::string& LicenseSpring::Configuration::getApiKey ( ) const

Getter for API key (UUID).

Returns
String of API key (UUID).

◆ getSharedKey()

const std::string& LicenseSpring::Configuration::getSharedKey ( ) const

Getter for shared key.

Returns
String of shared key.

◆ getProductCode()

const std::string& LicenseSpring::Configuration::getProductCode ( ) const

Getter for product code.

Returns
String of product code.

◆ getAppName()

const std::string& LicenseSpring::Configuration::getAppName ( ) const

Getter for application name.

Returns
String of application name.

◆ getAppVersion()

const std::string& LicenseSpring::Configuration::getAppVersion ( ) const

Getter for application version.

Returns
String of application version.

◆ getCustomerAccount()

const std::string& LicenseSpring::Configuration::getCustomerAccount ( ) const

Returns customer group (account) code that is required for SSO.

By default empty. Contact support to get more details implementing SSO.

Returns
URL for single sign-on.

◆ setCustomerAccount()

void LicenseSpring::Configuration::setCustomerAccount ( const std::string &  accountCode)

Set customer group (account) code that is required for SSO.

Meaningful for user-based auth only. If you don't plan to provide SSO you can ignore this method.

Parameters
accountCodeCustomer account code

◆ getAirGapPublicKey()

const std::string& LicenseSpring::Configuration::getAirGapPublicKey ( ) const

Getter for air gap public key.

Returns
String of air gap public key.

◆ setAirGapPublicKey()

void LicenseSpring::Configuration::setAirGapPublicKey ( const std::string &  key)

Setter for air gap public key.

Parameters
keyAir gap public key.

◆ getLicenseFilePath()

const std::wstring& LicenseSpring::Configuration::getLicenseFilePath ( ) const

This method is obsolete! Return license file path that was set through ExtendedOptions or empty string.

Use BaseManager::dataLocation, BaseManager::licenseFilePath or LicenseFileStorage instead

Returns
License file path.

◆ getHardwareID()

const std::string& LicenseSpring::Configuration::getHardwareID ( )

Getter for device id.

Either returns device id passed by ExtendedOptions or, if not provided, creates a unique id for device.

Returns
String of device id.
Exceptions
LicenseSpringExceptionGeneral LicenseSpring exception, read warning to see possible reason
Warning
Needs at least 2 valid, readable hardware to create the hardware ID. These are your device's CPU, motherboard and disk.
May throw an exception if it can only read 1 or less pieces of listed hardware.

◆ setHardwareID()

void LicenseSpring::Configuration::setHardwareID ( const std::string &  deviceId)

Setter for device id.

You can override device id with your own device id generator.

Parameters
deviceIdDevice id.

◆ setDeviceIdAlgorithm()

void LicenseSpring::Configuration::setDeviceIdAlgorithm ( DeviceIDAlgorithm  algorithm)

Setter for DeviceIDAlgorithm.

Parameters
algorithmnew DeviceIDAlgorithm.

◆ isCollectNetworkInfoEnabled()

bool LicenseSpring::Configuration::isCollectNetworkInfoEnabled ( ) const

Checker for if collection of network information is enabled in ExtendedOptions.

Returns
True if enabled, false if not.

◆ isLoggingEnabled()

bool LicenseSpring::Configuration::isLoggingEnabled ( ) const

Checker for if logging is enabled in ExtendedOptions.

Returns
True if enabled, false if not.

◆ isGuardFileEnabled()

bool LicenseSpring::Configuration::isGuardFileEnabled ( ) const

Checker for whether guard file usage is enabled in ExtendedOptions.

Returns
True if enabled, false if not.

◆ isSSLCheckEnabled()

bool LicenseSpring::Configuration::isSSLCheckEnabled ( ) const

Checker for whether SSL certificate verification is enabled.

See ExtendedOptions::enableSSLCheck for more details.

Returns
True if enabled, false if not.

◆ isNativeTLSEnabled()

bool LicenseSpring::Configuration::isNativeTLSEnabled ( ) const

Checker for whether native TLS for curl enabled or not.

See ExtendedOptions::isNativeTLSEnabled for more details.

Returns
True if enabled, false if not.

◆ getGracePeriod()

uint32_t LicenseSpring::Configuration::getGracePeriod ( ) const

Getter for grace period.

Returns
Unsigned int for grace period

◆ getNetworkTimeout()

long LicenseSpring::Configuration::getNetworkTimeout ( ) const

Getter for network timeout.

If not previously set through ExtendedOptions, default timeout will be 5 seconds.

Returns
Network timeout value in seconds.

◆ setNetworkTimeout()

void LicenseSpring::Configuration::setNetworkTimeout ( long  timeoutValue)

Setter for network timeout.

Parameters
timeoutValueTimeout given in seconds, 0 means no timeout

◆ getProxySettings()

const ProxySettings& LicenseSpring::Configuration::getProxySettings ( ) const

Getter for ProxySettings object.

Returns
ProxySettings object.

◆ getLicenseSpringAPIVersion()

uint32_t LicenseSpring::Configuration::getLicenseSpringAPIVersion ( ) const

Getter for LicenseSpring API version.

Returns
Integer representing LicenseSpring API version.

◆ getSdkVersion()

const std::string& LicenseSpring::Configuration::getSdkVersion ( ) const

Getter for LicenseSpring SDK version.

Returns
String of LicenseSpring SDK version.

◆ getOsVersion()

const std::string& LicenseSpring::Configuration::getOsVersion ( ) const

Getter for Operating System version.

Returns
String of Operating System version.

◆ getHostName()

const std::string& LicenseSpring::Configuration::getHostName ( ) const

Getter for Host Name.

Returns
String of Host Name.

◆ getIP()

const std::string& LicenseSpring::Configuration::getIP ( ) const

Getter for IP Address.

Returns
String of IP Address.

◆ getMAC()

const std::string& LicenseSpring::Configuration::getMAC ( ) const

Getter for MAC Address.

Returns
String of MAC Address.

◆ getNetworkInfo()

const NetworkInfo& LicenseSpring::Configuration::getNetworkInfo ( ) const

Getter for Network Information.

Returns
NetworkInfo object.

◆ isVMDetectionEnabled()

bool LicenseSpring::Configuration::isVMDetectionEnabled ( ) const

Checker for whether Virtual Machine Detection is enabled.

Returns
True if enabled, false if not.

◆ isVM()

bool LicenseSpring::Configuration::isVM ( ) const

Checker for whether the user is on a virtual machine.

For Windows builds LSVMD.dll should be deployed along with your software if you use VM detection.

Returns
True if VM detection is enabled and device is currently using a VM, otherwise false.
Exceptions
VMDNotAvailableExceptionWindows only. In case VM detection dll not found, tempered or detection failed.

◆ getDetectedVMName()

const std::string& LicenseSpring::Configuration::getDetectedVMName ( ) const

Getter for hypervisor name, calls isVM first if not yet called.

Return an empty string if VM detection is not enabled.

Returns
String of hypervisor name or empty string.
Exceptions
VMDNotAvailableExceptionWindows only. In case VM detection dll not found, tempered or detection failed.

◆ getCryptoProvider()

CryptoProvider::ptr_t LicenseSpring::Configuration::getCryptoProvider ( )

Getter for crypto provider.

Returns
Shared pointer for CryptoProvider set by vendor or default CryptoProvider if not set.

◆ getAlternateServiceUrl()

const std::string& LicenseSpring::Configuration::getAlternateServiceUrl ( ) const

Getter for alternate service URL.

Returns
String of alternate service URL.

◆ getAlternateKey()

const std::string& LicenseSpring::Configuration::getAlternateKey ( ) const

Getter for alternate public key.

Returns
String of alternate key.

◆ getUserInfo()

const std::string& LicenseSpring::Configuration::getUserInfo ( ) const

Returns custom information to be passed along with all API requests.

Representing user defined generic field to be passed to the backend.

Returns
String of user defined info.

◆ setUserInfo()

void LicenseSpring::Configuration::setUserInfo ( const std::string &  customInfo)

Set custom information to be passed to the backend with all API requests.

Parameters
customInfoUser information, aka generic data field to be passed to the backend

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