![]() |
LicenseSpring C++ SDK 7.31.0
Easily add Software Licensing to your application
|
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... | |
Class for storing useful settings that the Configuration object will inherit.
Definition at line 110 of file ExtendedOptions.h.
LicenseSpring::ExtendedOptions::ExtendedOptions | ( | ) |
Default constructor for ExtendedOptions.
LicenseSpring::ExtendedOptions::ExtendedOptions | ( | const std::wstring & | licenseFilePath | ) |
Constructor for ExtendedOptions.
licenseFilePath | Path to license file (obsolete, see setLicenseFilePath()) |
LicenseSpring::ExtendedOptions::ExtendedOptions | ( | const std::wstring & | licenseFilePath, |
const std::string & | hardwareID, | ||
const ProxySettings & | proxy = ProxySettings() |
||
) |
Constructor for ExtendedOptions.
licenseFilePath | Path to license file (obsolete, see setLicenseFilePath()) |
hardwareID | Hardware ID |
proxy | Proxy settings |
LicenseSpring::ExtendedOptions::~ExtendedOptions | ( | ) |
Destructor for ExtendedOptions.
void LicenseSpring::ExtendedOptions::setLicenseFilePath | ( | const std::wstring & | filePath | ) |
Set license file path.
This method is obsolete, use BaseManager::setDataLocation() or LicenseFileStorage instead.
filePath | Absolute or relative path to the license file |
const std::wstring & LicenseSpring::ExtendedOptions::getLicenseFilePath | ( | ) | const |
Get license file path.
This method is obsolete, see setLicenseFilePath().
void LicenseSpring::ExtendedOptions::setHardwareID | ( | const std::string & | ID | ) |
Setter for hardware ID.
ID | Hardware ID |
const std::string & LicenseSpring::ExtendedOptions::getHardwareID | ( | ) | const |
Get hardware ID.
DeviceIDAlgorithm LicenseSpring::ExtendedOptions::getDeviceIdAlgorithm | ( | ) | const |
Get device (hardware) id calculation algorithm.
void LicenseSpring::ExtendedOptions::setDeviceIdAlgorithm | ( | DeviceIDAlgorithm | algorithm | ) |
Allows to choose device (hardware) id calculation algorithm.
By default it is DeviceIDAlgorithm::Default for backward compatibility.
algorithm | Device id algorithm. |
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.
collect | True to collect info, false to not |
bool LicenseSpring::ExtendedOptions::isCollectNetworkInfoEnabled | ( | ) | const |
Checker for whether collectNetworkInfo() is enabled.
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.
enable | True to enable logging, false to not |
bool LicenseSpring::ExtendedOptions::isLoggingEnabled | ( | ) | const |
Checker for whether enableLogging() is enabled.
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.
enable | True to enable guard file, false to not |
bool LicenseSpring::ExtendedOptions::isGuardFileEnabled | ( | ) | const |
Checker for whether enableGuardFile() is enabled.
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.
enable | True to enable VM detection, false to not |
bool LicenseSpring::ExtendedOptions::isVMDetectionEnabled | ( | ) | const |
Checker for whether enableVMDetection() is enabled.
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
enable | True to enable SSL certificate verification, false to not |
bool LicenseSpring::ExtendedOptions::isSSLCheckEnabled | ( | ) | const |
Checker for whether SSL certificate verification is enabled.
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
value | True to use native TLS, false to use OpenSSL |
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.
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.
value | Unsigned int for grace period in hours |
uint32_t LicenseSpring::ExtendedOptions::getGracePeriod | ( | ) | const |
Getter for grace period.
void LicenseSpring::ExtendedOptions::setNetworkTimeout | ( | long | timeout | ) |
Setter for network timeout.
If not set, then default timeout will be 5 seconds.
timeout | Long for timeout |
long LicenseSpring::ExtendedOptions::getNetworkTimeout | ( | ) | const |
Getter for network timeout.
void LicenseSpring::ExtendedOptions::setProxySettings | ( | const ProxySettings & | settings | ) |
Setter for proxy settings.
If not set, then proxy servers are not used, by default.
settings | ProxySettings object |
const ProxySettings & LicenseSpring::ExtendedOptions::getProxySettings | ( | ) | const |
Getter for proxy settings.
void LicenseSpring::ExtendedOptions::overrideNetworkInfo | ( | const NetworkInfo & | networkInfo | ) |
Setter for NetworkInfo.
networkInfo | NetworkInfo object |
const NetworkInfo & LicenseSpring::ExtendedOptions::getNetworkInfo | ( | ) | const |
Getter for network info.
void LicenseSpring::ExtendedOptions::overrideCryptoProvider | ( | CryptoProvider::ptr_t | cryptoProvider | ) |
Setter for CryptoProvider.
If not set, then default CryptoProvider will be used.
cryptoProvider | CryptoProvider object |
CryptoProvider::ptr_t LicenseSpring::ExtendedOptions::getCryptoProvider | ( | ) |
Getter for CryptoProvider.
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"
URL | Alternate License API URL |
const std::string & LicenseSpring::ExtendedOptions::getAlternateServiceURL | ( | ) | const |
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-----"
key | Public key for verification |
void LicenseSpring::ExtendedOptions::setAlternateKey | ( | const std::vector< int32_t > & | key | ) |
Set alternate public key.
Overloaded method, reserved for internal use.
key | Public key for verification |
void LicenseSpring::ExtendedOptions::setAlternateKey | ( | const int32_t * | key, |
std::size_t | size | ||
) |
Set alternate public key.
Overloaded method, reserved for internal use.
key | Public key for verification |
size | Size of key to create vector from |
const std::string & LicenseSpring::ExtendedOptions::getAlternateKey | ( | ) | const |