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

Loading...
Searching...
No Matches
Configuration.h
Go to the documentation of this file.
1#ifndef LS_CONFIGURATION_H
2#define LS_CONFIGURATION_H
3
4#ifdef _MSC_VER
5#pragma once
6#pragma warning( push )
7#pragma warning( disable : 4251 )
8#endif
9
10#include <memory>
11#include "ExtendedOptions.h"
12
13 namespace LicenseSpring
14{
17 class LS_API Configuration
18 {
19 public:
20 using ptr_t = std::shared_ptr<Configuration>;
21
23 Configuration() = default;
24
35 static ptr_t Create( const std::string& apiKey,
36 const std::string& sharedKey,
37 const std::string& productCode,
38 const std::string& appName,
39 const std::string& appVersion,
40 const ExtendedOptions& extendedOptions = ExtendedOptions() );
41
44 const std::string& getApiKey() const;
45
48 const std::string& getSharedKey() const;
49
52 const std::string& getProductCode() const;
53
56 const std::string& getAppName() const;
57
60 const std::string& getAppVersion() const;
61
65 const std::string& getCustomerAccount() const;
66
70 void setCustomerAccount( const std::string& accountCode );
71
74 const std::string& getAirGapPublicKey() const;
75
78 void setAirGapPublicKey( const std::string& key );
79
83 const std::wstring& getLicenseFilePath() const;
84
91 const std::string& getHardwareID();
92
96 void setHardwareID( const std::string& deviceId );
97
100 void setDeviceIdAlgorithm( DeviceIDAlgorithm algorithm );
101
104 bool isCollectNetworkInfoEnabled() const;
105
108 bool isLoggingEnabled() const;
109
112 bool isGuardFileEnabled() const;
113
117 bool isSSLCheckEnabled() const;
118
122 bool isNativeTLSEnabled() const;
123
126 uint32_t getGracePeriod() const;
127
131 long getNetworkTimeout() const;
132
135 void setNetworkTimeout( long timeoutValue );
136
139 const ProxySettings& getProxySettings() const;
140
143 uint32_t getLicenseSpringAPIVersion() const;
144
147 const std::string& getSdkVersion() const;
148
151 const std::string& getOsVersion() const;
152
155 const std::string& getHostName() const; // note: string is UTF-8 encoded
156
159 const std::string& getIP() const;
160
163 const std::string& getMAC() const;
164
167 const NetworkInfo& getNetworkInfo() const;
168
171 bool isVMDetectionEnabled() const;
172
177 bool isVM() const;
178
183 const std::string& getDetectedVMName() const;
184
187 CryptoProvider::ptr_t getCryptoProvider();
188
191 const std::string& getAlternateServiceUrl() const;
192
195 const std::string& getAlternateKey() const;
196
200 const std::string& getUserInfo() const;
201
204 void setUserInfo( const std::string& customInfo );
205
206 private:
207 std::string m_apiKey;
208 std::string m_sharedKey;
209 std::string m_productCode;
210 std::string m_customerAccount;
211 std::string m_appName;
212 std::string m_appVersion;
213 std::string m_userInfo;
214 std::string m_airGapPublicKey;
215 ExtendedOptions m_extOptions;
216 };
217}
218
219#ifdef _MSC_VER
220#pragma warning( pop )
221#endif
222
223#endif // LS_CONFIGURATION_H
LS_API
#define LS_API
Macros that expands to dllexport, dllimport or nothing on non Windows platforms or in case of static ...
Definition APIDef.h:22
ExtendedOptions.h
DeviceIDAlgorithm
DeviceIDAlgorithm
Type of Device ID algorithm used by the SDK.
Definition PODTypes.h:104
LicenseSpring::Configuration
Class for configuring application.
Definition Configuration.h:18
LicenseSpring::Configuration::ptr_t
std::shared_ptr< Configuration > ptr_t
Definition Configuration.h:20
LicenseSpring::Configuration::getAirGapPublicKey
const std::string & getAirGapPublicKey() const
Getter for air gap public key.
LicenseSpring::Configuration::isVM
bool isVM() const
Checker for whether the user is on a virtual machine.
LicenseSpring::Configuration::getApiKey
const std::string & getApiKey() const
Getter for API key (UUID).
LicenseSpring::Configuration::getIP
const std::string & getIP() const
Getter for IP Address.
LicenseSpring::Configuration::setDeviceIdAlgorithm
void setDeviceIdAlgorithm(DeviceIDAlgorithm algorithm)
Setter for DeviceIDAlgorithm.
LicenseSpring::Configuration::getAppName
const std::string & getAppName() const
Getter for application name.
LicenseSpring::Configuration::isCollectNetworkInfoEnabled
bool isCollectNetworkInfoEnabled() const
Checker for if collection of network information is enabled in ExtendedOptions.
LicenseSpring::Configuration::getNetworkInfo
const NetworkInfo & getNetworkInfo() const
Getter for Network Information.
LicenseSpring::Configuration::getNetworkTimeout
long getNetworkTimeout() const
Getter for network timeout.
LicenseSpring::Configuration::getGracePeriod
uint32_t getGracePeriod() const
Getter for grace period.
LicenseSpring::Configuration::getCryptoProvider
CryptoProvider::ptr_t getCryptoProvider()
Getter for crypto provider.
LicenseSpring::Configuration::getProxySettings
const ProxySettings & getProxySettings() const
Getter for ProxySettings object.
LicenseSpring::Configuration::getLicenseFilePath
const std::wstring & getLicenseFilePath() const
This method is obsolete! Return license file path that was set through ExtendedOptions or empty strin...
LicenseSpring::Configuration::getHardwareID
const std::string & getHardwareID()
Getter for device id.
LicenseSpring::Configuration::isLoggingEnabled
bool isLoggingEnabled() const
Checker for if logging is enabled in ExtendedOptions.
LicenseSpring::Configuration::getSdkVersion
const std::string & getSdkVersion() const
Getter for LicenseSpring SDK version.
LicenseSpring::Configuration::Configuration
Configuration()=default
Constructor for internal needs, use Create instead.
LicenseSpring::Configuration::getMAC
const std::string & getMAC() const
Getter for MAC Address.
LicenseSpring::Configuration::setUserInfo
void setUserInfo(const std::string &customInfo)
Set custom information to be passed to the backend with all API requests.
LicenseSpring::Configuration::isGuardFileEnabled
bool isGuardFileEnabled() const
Checker for whether guard file usage is enabled in ExtendedOptions.
LicenseSpring::Configuration::getOsVersion
const std::string & getOsVersion() const
Getter for Operating System version.
LicenseSpring::Configuration::setHardwareID
void setHardwareID(const std::string &deviceId)
Setter for device id.
LicenseSpring::Configuration::getUserInfo
const std::string & getUserInfo() const
Returns custom information to be passed along with all API requests.
LicenseSpring::Configuration::setCustomerAccount
void setCustomerAccount(const std::string &accountCode)
Set customer group (account) code that is required for SSO.
LicenseSpring::Configuration::getSharedKey
const std::string & getSharedKey() const
Getter for shared key.
LicenseSpring::Configuration::isNativeTLSEnabled
bool isNativeTLSEnabled() const
Checker for whether native TLS for curl enabled or not.
LicenseSpring::Configuration::getHostName
const std::string & getHostName() const
Getter for Host Name.
LicenseSpring::Configuration::isSSLCheckEnabled
bool isSSLCheckEnabled() const
Checker for whether SSL certificate verification is enabled.
LicenseSpring::Configuration::getDetectedVMName
const std::string & getDetectedVMName() const
Getter for hypervisor name, calls isVM first if not yet called.
LicenseSpring::Configuration::getAlternateKey
const std::string & getAlternateKey() const
Getter for alternate public key.
LicenseSpring::Configuration::isVMDetectionEnabled
bool isVMDetectionEnabled() const
Checker for whether Virtual Machine Detection is enabled.
LicenseSpring::Configuration::getAlternateServiceUrl
const std::string & getAlternateServiceUrl() const
Getter for alternate service URL.
LicenseSpring::Configuration::setAirGapPublicKey
void setAirGapPublicKey(const std::string &key)
Setter for air gap public key.
LicenseSpring::Configuration::getAppVersion
const std::string & getAppVersion() const
Getter for application version.
LicenseSpring::Configuration::getCustomerAccount
const std::string & getCustomerAccount() const
Returns customer group (account) code that is required for SSO.
LicenseSpring::Configuration::Create
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.
LicenseSpring::Configuration::setNetworkTimeout
void setNetworkTimeout(long timeoutValue)
Setter for network timeout.
LicenseSpring::Configuration::getLicenseSpringAPIVersion
uint32_t getLicenseSpringAPIVersion() const
Getter for LicenseSpring API version.
LicenseSpring::Configuration::getProductCode
const std::string & getProductCode() const
Getter for product code.
LicenseSpring::CryptoProvider::ptr_t
std::shared_ptr< CryptoProvider > ptr_t
Definition CryptoProvider.h:22
LicenseSpring::ExtendedOptions
Class for storing useful settings that the Configuration object will inherit.
Definition ExtendedOptions.h:123
LicenseSpring::NetworkInfo
Class for storing a device's network information.
Definition ExtendedOptions.h:20
LicenseSpring::ProxySettings
Class for storing settings when using a proxy server.
Definition ExtendedOptions.h:60
LicenseSpring
Definition BaseManager.h:16