![]() |
LicenseSpring C++ SDK 7.31.0
Easily add Software Licensing to your application
|
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 ProxySettings & | getProxySettings () 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 NetworkInfo & | getNetworkInfo () 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... | |
Class for configuring application.
Used to store information regarding the options related to the application configuration.
Definition at line 17 of file Configuration.h.
using LicenseSpring::Configuration::ptr_t = std::shared_ptr<Configuration> |
Definition at line 20 of file Configuration.h.
|
default |
Constructor for internal needs, use Create instead.
|
static |
Creates shared pointer for configuration object.
Acts as constructor for configuration class.
apiKey | Vendor API key (UUID) |
sharedKey | Vendor shared key |
productCode | Product code If you configuring FloatingServer v1.1.9 or earlier provide Product name instead of Product code |
appName | Name of application |
appVersion | Version of application |
extendedOptions | ExtendedOptions object to attach to configuration |
ConfigurationException | If API/shared key or product code are empty |
const std::string & LicenseSpring::Configuration::getApiKey | ( | ) | const |
Getter for API key (UUID).
const std::string & LicenseSpring::Configuration::getSharedKey | ( | ) | const |
Getter for shared key.
const std::string & LicenseSpring::Configuration::getProductCode | ( | ) | const |
Getter for product code.
const std::string & LicenseSpring::Configuration::getAppName | ( | ) | const |
Getter for application name.
const std::string & LicenseSpring::Configuration::getAppVersion | ( | ) | const |
Getter for application version.
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.
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.
accountCode | Customer account code |
const std::string & LicenseSpring::Configuration::getAirGapPublicKey | ( | ) | const |
Getter for air gap public key.
void LicenseSpring::Configuration::setAirGapPublicKey | ( | const std::string & | key | ) |
Setter for air gap public key.
key | Air gap public key. |
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
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.
LicenseSpringException | General LicenseSpring exception, read warning to see possible reason |
void LicenseSpring::Configuration::setHardwareID | ( | const std::string & | deviceId | ) |
Setter for device id.
You can override device id with your own device id generator.
deviceId | Device id. |
void LicenseSpring::Configuration::setDeviceIdAlgorithm | ( | DeviceIDAlgorithm | algorithm | ) |
Setter for DeviceIDAlgorithm.
algorithm | new DeviceIDAlgorithm. |
bool LicenseSpring::Configuration::isCollectNetworkInfoEnabled | ( | ) | const |
Checker for if collection of network information is enabled in ExtendedOptions.
bool LicenseSpring::Configuration::isLoggingEnabled | ( | ) | const |
Checker for if logging is enabled in ExtendedOptions.
bool LicenseSpring::Configuration::isGuardFileEnabled | ( | ) | const |
Checker for whether guard file usage is enabled in ExtendedOptions.
bool LicenseSpring::Configuration::isSSLCheckEnabled | ( | ) | const |
Checker for whether SSL certificate verification is enabled.
See ExtendedOptions::enableSSLCheck for more details.
bool LicenseSpring::Configuration::isNativeTLSEnabled | ( | ) | const |
Checker for whether native TLS for curl enabled or not.
See ExtendedOptions::isNativeTLSEnabled for more details.
uint32_t LicenseSpring::Configuration::getGracePeriod | ( | ) | const |
Getter for grace period.
long LicenseSpring::Configuration::getNetworkTimeout | ( | ) | const |
Getter for network timeout.
If not previously set through ExtendedOptions, default timeout will be 5 seconds.
void LicenseSpring::Configuration::setNetworkTimeout | ( | long | timeoutValue | ) |
Setter for network timeout.
timeoutValue | Timeout given in seconds, 0 means no timeout |
const ProxySettings & LicenseSpring::Configuration::getProxySettings | ( | ) | const |
Getter for ProxySettings object.
uint32_t LicenseSpring::Configuration::getLicenseSpringAPIVersion | ( | ) | const |
Getter for LicenseSpring API version.
const std::string & LicenseSpring::Configuration::getSdkVersion | ( | ) | const |
Getter for LicenseSpring SDK version.
const std::string & LicenseSpring::Configuration::getOsVersion | ( | ) | const |
Getter for Operating System version.
const std::string & LicenseSpring::Configuration::getHostName | ( | ) | const |
Getter for Host Name.
const std::string & LicenseSpring::Configuration::getIP | ( | ) | const |
Getter for IP Address.
const std::string & LicenseSpring::Configuration::getMAC | ( | ) | const |
Getter for MAC Address.
const NetworkInfo & LicenseSpring::Configuration::getNetworkInfo | ( | ) | const |
Getter for Network Information.
bool LicenseSpring::Configuration::isVMDetectionEnabled | ( | ) | const |
Checker for whether Virtual Machine Detection is enabled.
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.
VMDNotAvailableException | Windows only. In case VM detection dll not found, tempered or detection failed. |
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.
VMDNotAvailableException | Windows only. In case VM detection dll not found, tempered or detection failed. |
CryptoProvider::ptr_t LicenseSpring::Configuration::getCryptoProvider | ( | ) |
Getter for crypto provider.
const std::string & LicenseSpring::Configuration::getAlternateServiceUrl | ( | ) | const |
Getter for alternate service URL.
const std::string & LicenseSpring::Configuration::getAlternateKey | ( | ) | const |
Getter for alternate public key.
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.
void LicenseSpring::Configuration::setUserInfo | ( | const std::string & | customInfo | ) |
Set custom information to be passed to the backend with all API requests.
customInfo | User information, aka generic data field to be passed to the backend |