LicenseSpring C++ SDK
Easily add Software Licensing to your application
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 {
18  {
19  public:
20  using ptr_t = std::shared_ptr<Configuration>;
21 
23  Configuration() = default;
24 
36  static ptr_t Create( const std::string& apiKey,
37  const std::string& sharedKey,
38  const std::string& productCode,
39  const std::string& appName,
40  const std::string& appVersion,
41  const ExtendedOptions& extendedOptions = ExtendedOptions() );
42 
53  static ptr_t CreateOAuth( const std::string& clientId,
54  const std::string& clientSecret,
55  const std::string& productCode,
56  const std::string& appName,
57  const std::string& appVersion,
58  const ExtendedOptions& extendedOptions = ExtendedOptions() );
59 
62  bool isOAuth() const;
63 
66  const std::string& getApiKey() const;
67 
70  const std::string& getSharedKey() const;
71 
74  const std::string& getClientId() const;
75 
78  const std::string& getClientSecret() const;
79 
82  const std::string& getProductCode() const;
83 
86  const std::string& getAppName() const;
87 
90  const std::string& getAppVersion() const;
91 
95  const std::string& getCustomerAccount() const;
96 
100  void setCustomerAccount( const std::string& accountCode );
101 
104  const std::string& getAirGapPublicKey() const;
105 
108  void setAirGapPublicKey( const std::string& key );
109 
113  const std::wstring& getLicenseFilePath() const;
114 
121  const std::string& getHardwareID();
122 
126  void setHardwareID( const std::string& deviceId );
127 
130  void setDeviceIdAlgorithm( DeviceIDAlgorithm algorithm );
131 
134  bool isCollectNetworkInfoEnabled() const;
135 
138  bool isLoggingEnabled() const;
139 
142  bool isGuardFileEnabled() const;
143 
147  bool isSSLCheckEnabled() const;
148 
152  bool isNativeTLSEnabled() const;
153 
157  bool isLicenseCorruptionCheckEnabled() const;
158 
161  uint32_t getGracePeriod() const;
162 
166  long getNetworkTimeout() const;
167 
170  void setNetworkTimeout( long timeoutValue );
171 
175  long getConnectTimeout() const;
176 
179  void setConnectTimeout( long timeoutValue );
180 
183  const ProxySettings& getProxySettings() const;
184 
187  uint32_t getLicenseSpringAPIVersion() const;
188 
191  const std::string& getSdkVersion() const;
192 
195  const std::string& getOsVersion() const;
196 
199  const std::string& getHostName() const; // note: string is UTF-8 encoded
200 
203  const std::string& getIP() const;
204 
207  const std::string& getMAC() const;
208 
211  const NetworkInfo& getNetworkInfo() const;
212 
215  bool isVMDetectionEnabled() const;
216 
221  bool isVM() const;
222 
227  const std::string& getDetectedVMName() const;
228 
231  CryptoProvider::ptr_t getCryptoProvider();
232 
235  const std::string& getAlternateServiceUrl() const;
236 
239  const std::string& getAlternateKey() const;
240 
244  const std::string& getUserInfo() const;
245 
248  void setUserInfo( const std::string& customInfo );
249 
250  private:
251  bool m_isOAuth;
252  std::string m_apiKey;
253  std::string m_sharedKey;
254  std::string m_clientId;
255  std::string m_clientSecret;
256  std::string m_productCode;
257  std::string m_customerAccount;
258  std::string m_appName;
259  std::string m_appVersion;
260  std::string m_userInfo;
261  std::string m_airGapPublicKey;
262  ExtendedOptions m_extOptions;
263  };
264 }
265 
266 #ifdef _MSC_VER
267 #pragma warning( pop )
268 #endif
269 
270 #endif // LS_CONFIGURATION_H
Class for storing a device&#39;s network information.
std::shared_ptr< Configuration > ptr_t
Definition: Configuration.h:20
std::shared_ptr< CryptoProvider > ptr_t
Class for storing useful settings that the Configuration object will inherit.
Class for configuring application.
Definition: Configuration.h:17
DeviceIDAlgorithm
Type of Device ID algorithm used by the SDK.
Definition: PODTypes.h:107
Class for storing settings when using a proxy server.
#define LS_API
Macros that expands to dllexport, dllimport or nothing on non Windows platforms or in case of static ...
Definition: APIDef.h:22