| LicenseSpring C++ SDK 7.27.0 Easily add Software Licensing to your application

Public Member Functions | List of all members
LicenseSpring::ExtendedOptions Class Reference

Class for storing useful settings that the Configuration object will inherit. More...

`#include <LicenseSpring/ExtendedOptions.h>`

## Public Member Functions
| ExtendedOptions ()
| Default constructor for ExtendedOptions. More...
| ExtendedOptions (const std::wstring &licenseFilePath)
| Constructor for ExtendedOptions. More...
| ExtendedOptions (const std::wstring &licenseFilePath, const std::string &hardwareID, const ProxySettings &proxy=ProxySettings())
| Constructor for ExtendedOptions. More...
| ~ExtendedOptions ()
| Destructor for ExtendedOptions. More...
void | setLicenseFilePath (const std::wstring &filePath)
| Set license file path. More...
const std::wstring & | getLicenseFilePath () const
| Get license file path. More...
void | setHardwareID (const std::string &ID)
| Setter for hardware ID. More...
const std::string & | getHardwareID () const
| Get hardware ID. More...
DeviceIDAlgorithm | getDeviceIdAlgorithm () const
| Get device (hardware) id calculation algorithm. More...
void | setDeviceIdAlgorithm (DeviceIDAlgorithm algorithm)
| Allows to choose device (hardware) id calculation algorithm. More...
void | collectNetworkInfo (bool collect)
| Collect network information. More...
bool | isCollectNetworkInfoEnabled () const
| Checker for whether collectNetworkInfo() is enabled. More...
void | enableLogging (bool enable)
| Enable logging. More...
bool | isLoggingEnabled () const
| Checker for whether enableLogging() is enabled. More...
void | enableGuardFile (bool enable)
| Enable guard file. More...
bool | isGuardFileEnabled () const
| Checker for whether enableGuardFile() is enabled. More...
void | enableVMDetection (bool enable)
| Enable VM detection. More...
bool | isVMDetectionEnabled () const
| Checker for whether enableVMDetection() is enabled. More...
void | enableSSLCheck (bool enable)
| Enable or disable SSL certificate verification. More...
bool | isSSLCheckEnabled () const
| Checker for whether SSL certificate verification is enabled. More...
void | setUseNativeTLS (bool value)
| Enable or disable native TLS for curl. More...
bool | isNativeTLSEnabled () const
| Checker for whether native TLS for curl enabled or not. More...
void | setGracePeriod (uint32_t value)
| Setter for grace period. More...
uint32_t | getGracePeriod () const
| Getter for grace period. More...
void | setNetworkTimeout (long timeout)
| Setter for network timeout. More...
long | getNetworkTimeout () const
| Getter for network timeout. More...
void | setProxySettings (const ProxySettings &settings)
| Setter for proxy settings. More...
const ProxySettings & | getProxySettings () const
| Getter for proxy settings. More...
void | overrideNetworkInfo (const NetworkInfo &networkInfo)
| Setter for NetworkInfo. More...
const NetworkInfo & | getNetworkInfo () const
| Getter for network info. More...
void | overrideCryptoProvider (CryptoProvider::ptr_t cryptoProvider)
| Setter for CryptoProvider. More...
CryptoProvider::ptr_t | getCryptoProvider ()
| Getter for CryptoProvider. More...
void | setAlternateServiceURL (const std::string &URL)
| This method can be used if you are planning to deploy self-hosted server. More...
const std::string & | getAlternateServiceURL () const
| Getter for alternate License API URL. More...
void | setAlternateKey (const std::string &key)
| Set alternate public key. This method can be used if you are planning to deploy self-hosted server. More...
void | setAlternateKey (const std::vector< int32_t > &key)
| Set alternate public key. More...
void | setAlternateKey (const int32_t *key, std::size_t size)
| Set alternate public key. More...
const std::string & | getAlternateKey () const
| Getter for alternate License API URL. More...

## Detailed Description

Class for storing useful settings that the Configuration object will inherit.

Definition at line 110 of file ExtendedOptions.h.

## Constructor & Destructor Documentation

## ◆ ExtendedOptions() [1/3]

LicenseSpring::ExtendedOptions::ExtendedOptions | ( |  | ) |

Default constructor for ExtendedOptions.

## ◆ ExtendedOptions() [2/3]

LicenseSpring::ExtendedOptions::ExtendedOptions | ( | const std::wstring & | licenseFilePath | ) |

Constructor for ExtendedOptions.

Parameters

  licenseFilePath | Path to license file (obsolete, see setLicenseFilePath())

## ◆ ExtendedOptions() [3/3]

LicenseSpring::ExtendedOptions::ExtendedOptions | ( | const std::wstring & | licenseFilePath,
|  | const std::string & | hardwareID,
|  | const ProxySettings & | proxy = `ProxySettings()`
| ) |  |

Constructor for ExtendedOptions.

Parameters

  licenseFilePath | Path to license file (obsolete, see setLicenseFilePath())
  hardwareID | Hardware ID
  proxy | Proxy settings

## ◆ ~ExtendedOptions()

LicenseSpring::ExtendedOptions::~ExtendedOptions | ( |  | ) |

Destructor for ExtendedOptions.

## Member Function Documentation

## ◆ setLicenseFilePath()

void LicenseSpring::ExtendedOptions::setLicenseFilePath | ( | const std::wstring & | filePath | ) |

Set license file path.

This method is obsolete, use BaseManager::setDataLocation() or LicenseFileStorage instead.

Parameters

  filePath | Absolute or relative path to the license file

## ◆ getLicenseFilePath()

const std::wstring& LicenseSpring::ExtendedOptions::getLicenseFilePath | ( |  | ) | const

Get license file path.

This method is obsolete, see setLicenseFilePath().

Returns
  String of license file path.

## ◆ setHardwareID()

void LicenseSpring::ExtendedOptions::setHardwareID | ( | const std::string & | ID | ) |

Setter for hardware ID.

Parameters

  ID | Hardware ID

## ◆ getHardwareID()

const std::string& LicenseSpring::ExtendedOptions::getHardwareID | ( |  | ) | const

Get hardware ID.

Returns
  String of hardware ID.

## ◆ getDeviceIdAlgorithm()

DeviceIDAlgorithm LicenseSpring::ExtendedOptions::getDeviceIdAlgorithm | ( |  | ) | const

Get device (hardware) id calculation algorithm.

Returns
  Device id algorithm. By default it is DeviceIDAlgorithm::Default.

## ◆ setDeviceIdAlgorithm()

void LicenseSpring::ExtendedOptions::setDeviceIdAlgorithm | ( | DeviceIDAlgorithm | algorithm | ) |

Allows to choose device (hardware) id calculation algorithm.

By default it is DeviceIDAlgorithm::Default for backward compatibility.

Parameters

  algorithm | Device id algorithm.

## ◆ collectNetworkInfo()

void LicenseSpring::ExtendedOptions::collectNetworkInfo | ( | bool | collect | ) |

Collect network information.

When it's set, SDK collects info on MAC address, local IP, host name and sends this info in the requests to the LicenseSpring platform.
When not set, network collecting is disabled by default.

Parameters

  collect | True to collect info, false to not

## ◆ isCollectNetworkInfoEnabled()

bool LicenseSpring::ExtendedOptions::isCollectNetworkInfoEnabled | ( |  | ) | const

Checker for whether collectNetworkInfo() is enabled.

Returns
  True if enabled, false if not.

## ◆ enableLogging()

void LicenseSpring::ExtendedOptions::enableLogging | ( | bool | enable | ) |

Enable logging.

Enabling logging will create a text file: LicenseSpringLog in the same place your local license file is stored (see BaseManager::setDataLocation).
When not set, logging is disabled by default.

Parameters

  enable | True to enable logging, false to not

Warning
  It is for developers only so make sure it's disabled in your release builds. You can check to see if it is off using
  Configuration::isLoggingEnabled.

## ◆ isLoggingEnabled()

bool LicenseSpring::ExtendedOptions::isLoggingEnabled | ( |  | ) | const

Checker for whether enableLogging() is enabled.

Returns
  True if enabled, false if not.

## ◆ enableGuardFile()

void LicenseSpring::ExtendedOptions::enableGuardFile | ( | bool | enable | ) |

Enable guard file.

Guard files for protecting offline activation process.
When not set, guard file is enabled by default.

Parameters

  enable | True to enable guard file, false to not

## ◆ isGuardFileEnabled()

bool LicenseSpring::ExtendedOptions::isGuardFileEnabled | ( |  | ) | const

Checker for whether enableGuardFile() is enabled.

Returns
  True if enabled, false if not.

## ◆ enableVMDetection()

void LicenseSpring::ExtendedOptions::enableVMDetection | ( | bool | enable | ) |

Enable VM detection.

Control (enable or disable) detection of Virtual machines.
When not set, VM detection is disabled by default.

Parameters

  enable | True to enable VM detection, false to not

## ◆ isVMDetectionEnabled()

bool LicenseSpring::ExtendedOptions::isVMDetectionEnabled | ( |  | ) | const

Checker for whether enableVMDetection() is enabled.

Returns
  True if enabled, false if not.

## ◆ enableSSLCheck()

void LicenseSpring::ExtendedOptions::enableSSLCheck | ( | bool | enable | ) |

Enable or disable SSL certificate verification.

By default SSL certificate verification is enabled and we strongly discaraging disabling this option.
For more details see https://curl.se/libcurl/c/CURLOPT_SSL_VERIFYPEER.html

Parameters

  enable | True to enable SSL certificate verification, false to not

## ◆ isSSLCheckEnabled()

bool LicenseSpring::ExtendedOptions::isSSLCheckEnabled | ( |  | ) | const

Checker for whether SSL certificate verification is enabled.

Returns
  True if enabled, false if not.

## ◆ setUseNativeTLS()

void LicenseSpring::ExtendedOptions::setUseNativeTLS | ( | bool | value | ) |

Enable or disable native TLS for curl.

For Windows it is Schannel, for macOS Secure Transport.
Before changing SDK default setting know what you are doing. Refer to curl documentation:
https://curl.se/docs/ssl-compared.html
https://curl.se/docs/sslcerts.html

Parameters

  value | True to use native TLS, false to use OpenSSL

## ◆ isNativeTLSEnabled()

bool LicenseSpring::ExtendedOptions::isNativeTLSEnabled | ( |  | ) | const

Checker for whether native TLS for curl enabled or not.

By default it is enabled for macOS, and disabled for Linux, Windows.

Returns
  True if enabled, false if not.

## ◆ setGracePeriod()

void LicenseSpring::ExtendedOptions::setGracePeriod | ( | uint32_t | value | ) |

Setter for grace period.

If not set, then default will be 48 hours. Set 0 to disable grace period. For cloud floating licenses grace period on license check is enabled if more than an hour of floating period remains.

Parameters

  value | Unsigned int for grace period in hours

## ◆ getGracePeriod()

uint32_t LicenseSpring::ExtendedOptions::getGracePeriod | ( |  | ) | const

Getter for grace period.

Returns
  Unsigned int for grace period in hours

## ◆ setNetworkTimeout()

void LicenseSpring::ExtendedOptions::setNetworkTimeout | ( | long | timeout | ) |

Setter for network timeout.

If not set, then default timeout will be 5 seconds.

Parameters

  timeout | Long for timeout

## ◆ getNetworkTimeout()

long LicenseSpring::ExtendedOptions::getNetworkTimeout | ( |  | ) | const

Getter for network timeout.

Returns
  long of timeout.

## ◆ setProxySettings()

void LicenseSpring::ExtendedOptions::setProxySettings | ( | const ProxySettings & | settings | ) |

Setter for proxy settings.

If not set, then proxy servers are not used, by default.

Parameters

  settings | ProxySettings object

## ◆ getProxySettings()

const ProxySettings& LicenseSpring::ExtendedOptions::getProxySettings | ( |  | ) | const

Getter for proxy settings.

Returns
  ProxySettings object.

## ◆ overrideNetworkInfo()

void LicenseSpring::ExtendedOptions::overrideNetworkInfo | ( | const NetworkInfo & | networkInfo | ) |

Setter for NetworkInfo.

Parameters

  networkInfo | NetworkInfo object

## ◆ getNetworkInfo()

const NetworkInfo& LicenseSpring::ExtendedOptions::getNetworkInfo | ( |  | ) | const

Getter for network info.

Returns
  NetworkInfo object.

## ◆ overrideCryptoProvider()

void LicenseSpring::ExtendedOptions::overrideCryptoProvider | ( | CryptoProvider::ptr_t | cryptoProvider | ) |

Setter for CryptoProvider.

If not set, then default CryptoProvider will be used.

Parameters

  cryptoProvider | CryptoProvider object

## ◆ getCryptoProvider()

CryptoProvider::ptr_t LicenseSpring::ExtendedOptions::getCryptoProvider | ( |  | ) |

Getter for CryptoProvider.

Returns
  CryptoProvider object.

## ◆ setAlternateServiceURL()

void LicenseSpring::ExtendedOptions::setAlternateServiceURL | ( | const std::string & | URL | ) |

This method can be used if you are planning to deploy self-hosted server.

In most cases should be left blank.
In order to connect to the LS FloatingServer set its address, for example "http://localhost:8080"

Parameters

  URL | Alternate License API URL

## ◆ getAlternateServiceURL()

const std::string& LicenseSpring::ExtendedOptions::getAlternateServiceURL | ( |  | ) | const

Getter for alternate License API URL.

Returns
  Alternate License API URL.

## ◆ setAlternateKey() [1/3]

void LicenseSpring::ExtendedOptions::setAlternateKey | ( | const std::string & | key | ) |

Set alternate public key. This method can be used if you are planning to deploy self-hosted server.

Key should be in format "-----BEGIN PUBLIC KEY-----\n.....key body...\n-----END PUBLIC KEY-----"

Parameters

  key | Public key for verification

## ◆ setAlternateKey() [2/3]

void LicenseSpring::ExtendedOptions::setAlternateKey | ( | const std::vector< int32_t > & | key | ) |

Set alternate public key.

Overloaded method, reserved for internal use.

Parameters

  key | Public key for verification

## ◆ setAlternateKey() [3/3]

void LicenseSpring::ExtendedOptions::setAlternateKey | ( | const int32_t * | key,
|  | std::size_t | size
| ) |  |

Set alternate public key.

Overloaded method, reserved for internal use.

Parameters

  key | Public key for verification
  size | Size of key to create vector from

## ◆ getAlternateKey()

const std::string& LicenseSpring::ExtendedOptions::getAlternateKey | ( |  | ) | const

Getter for alternate License API URL.

Returns
  Alternate License API URL.

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

- LicenseSpring/ExtendedOptions.h