LicenseSpring C++ SDK
Easily add Software Licensing to your application
ExtendedOptions.h
Go to the documentation of this file.
1 #ifndef LS_C_EXTENDED_OPTIONS_H
2 #define LS_C_EXTENDED_OPTIONS_H
3 
4 #include "../APIDef.h"
5 #include "../PODTypes.h"
6 #include <stdbool.h>
7 #include <wchar.h>
8 #include <stdint.h>
9 
10 #ifdef __cplusplus
11 extern "C"
12 {
13 #endif
14 
15  LS_API typedef struct LSProxySettings
16  {
17  void *inner;
18 
19  void (*setProxyUri)(struct LSProxySettings *self, const char *uri);
20 
21  const char *(*getProxyUri)(struct LSProxySettings *self);
22 
23  void (*setUser)(struct LSProxySettings *self, const char *user);
24 
25  const char *(*getUser)(struct LSProxySettings *self);
26 
27  void (*setPassword)(struct LSProxySettings *self, const char *password);
28 
29  const char *(*getPassword)(struct LSProxySettings *self);
30 
31  bool (*isValid)(struct LSProxySettings *self);
32 
34 
36  const char *proxy, const char *user, const char *password);
37 
39 
43  {
45  char **serials;
47  int count;
48  } LSSerialList;
49 
53 
56  {
57  void *inner;
58 
60  void (*setTargetSerial)(struct LSHardwareKeyOptions *self, const char *serial);
61 
63  const char *(*getTargetSerial)(struct LSHardwareKeyOptions *self);
64 
66  void (*setPin)(struct LSHardwareKeyOptions *self, const char *pin);
67 
69  const char *(*getPin)(struct LSHardwareKeyOptions *self);
70 
72 
76 
80 
87 
88  LS_API typedef struct LSExtendedOptions
89  {
90  void *inner;
91 
92  void (*setLicenseFilePath)(struct LSExtendedOptions *self, const wchar_t *filePath);
93 
94  const wchar_t *(*getLicenseFilePath)(struct LSExtendedOptions *self);
95 
96  void (*setHardwareID)(struct LSExtendedOptions *self, const char *ID);
97 
98  const char *(*getHardwareID)(struct LSExtendedOptions *self);
99 
100  void (*collectNetworkInfo)(struct LSExtendedOptions *self, bool collect);
101 
103 
104  void (*enableLogging)(struct LSExtendedOptions *self, bool enable);
105 
106  bool (*isLoggingEnabled)(struct LSExtendedOptions *self);
107 
108  void (*enableVMDetection)(struct LSExtendedOptions *self, bool enable);
109 
111 
112  void (*enableGuardFile)(struct LSExtendedOptions *self, bool enable);
113 
114  bool (*isGuardFileEnabled)(struct LSExtendedOptions *self);
115 
116  void (*enableSSLCheck)(struct LSExtendedOptions *self, bool enable);
117 
118  bool (*isSSLCheckEnabled)(struct LSExtendedOptions *self);
119 
120  void (*setUseNativeTLS)(struct LSExtendedOptions *self, bool enable);
121 
122  bool (*isNativeTLSEnabled)(struct LSExtendedOptions *self);
123 
124  void (*enableLicenseCorruptionCheck)(struct LSExtendedOptions *self, bool enable);
125 
127 
128  void (*enableHardwareKey)(struct LSExtendedOptions *self, bool enable);
129 
131 
132  void (*setGracePeriod)(struct LSExtendedOptions *self, uint32_t value);
133 
134  uint32_t (*getGracePeriod)(struct LSExtendedOptions *self);
135 
136  void (*setNetworkTimeout)(struct LSExtendedOptions *self, long timeout);
137 
138  long (*getNetworkTimeout)(struct LSExtendedOptions *self);
139 
140  void (*setConnectTimeout)(struct LSExtendedOptions *self, long timeout);
141 
142  long (*getConnectTimeout)(struct LSExtendedOptions *self);
143 
145  struct LSExtendedOptions *self, const struct LSProxySettings *settings);
146 
147  const struct LSProxySettings *(*getProxySettings)(struct LSExtendedOptions *self);
148 
149  void (*setAlternateServiceURL)(struct LSExtendedOptions *self, const char *URL);
150 
151  const char *(*getAlternateServiceURL)(struct LSExtendedOptions *self);
152 
153  void (*setAlternateKey)(struct LSExtendedOptions *self, const char *key);
154 
155  void (*setAlternateKeyInt)(struct LSExtendedOptions *self, int32_t *key, int32_t size);
156 
158 
160  struct LSExtendedOptions *self, enum DeviceIDAlgorithm algorithm);
161 
162  void (*setCryptoProviderKey)(struct LSExtendedOptions *self, const char *key);
163 
164  void (*setCryptoProviderSalt)(struct LSExtendedOptions *self, const char *salt);
165 
167  struct LSExtendedOptions *self, const struct LSHardwareKeyOptions *options);
168 
170 
172 
173  LS_API LSExtendedOptions *CreateLSExtendedOptionsByPath(const wchar_t *licenseFilePath);
174 
176  const wchar_t *licenseFilePath, const char *hardwareID, const LSProxySettings *proxy);
177 
179 
180 #ifdef __cplusplus
181 } // end extern "C"
182 #endif
183 
184 #endif // LS_C_EXTENDED_OPTIONS_H
LSExtendedOptions::isHardwareKeyEnabled
bool(* isHardwareKeyEnabled)(struct LSExtendedOptions *self)
Definition: ExtendedOptions.h:130
LSExtendedOptions::getGracePeriod
uint32_t(* getGracePeriod)(struct LSExtendedOptions *self)
Definition: ExtendedOptions.h:134
CreateLSExtendedOptionsEx
LS_API LSExtendedOptions * CreateLSExtendedOptionsEx(const wchar_t *licenseFilePath, const char *hardwareID, const LSProxySettings *proxy)
LSProxySettings::setProxyUri
void(* setProxyUri)(struct LSProxySettings *self, const char *uri)
Definition: ExtendedOptions.h:19
LSExtendedOptions::isLicenseCorruptionCheckEnabled
bool(* isLicenseCorruptionCheckEnabled)(struct LSExtendedOptions *self)
Definition: ExtendedOptions.h:126
LSProxySettings::setUser
void(* setUser)(struct LSProxySettings *self, const char *user)
Definition: ExtendedOptions.h:23
LSExtendedOptions::isGuardFileEnabled
bool(* isGuardFileEnabled)(struct LSExtendedOptions *self)
Definition: ExtendedOptions.h:114
LSExtendedOptions::setConnectTimeout
void(* setConnectTimeout)(struct LSExtendedOptions *self, long timeout)
Definition: ExtendedOptions.h:140
LSExtendedOptions::getNetworkTimeout
long(* getNetworkTimeout)(struct LSExtendedOptions *self)
Definition: ExtendedOptions.h:138
LSExtendedOptions::setAlternateKey
void(* setAlternateKey)(struct LSExtendedOptions *self, const char *key)
Definition: ExtendedOptions.h:153
LSExtendedOptions
Definition: ExtendedOptions.h:88
LSExtendedOptions::setAlternateKeyInt
void(* setAlternateKeyInt)(struct LSExtendedOptions *self, int32_t *key, int32_t size)
Definition: ExtendedOptions.h:155
CreateLSExtendedOptionsByPath
LS_API LSExtendedOptions * CreateLSExtendedOptionsByPath(const wchar_t *licenseFilePath)
LSExtendedOptions::enableGuardFile
void(* enableGuardFile)(struct LSExtendedOptions *self, bool enable)
Definition: ExtendedOptions.h:112
LSHardwareKeySerialList::count
int count
Number of strings in the serials array.
Definition: ExtendedOptions.h:47
LSHardwareKeySerialList::serials
char ** serials
Array of null-terminated C strings (serial numbers).
Definition: ExtendedOptions.h:45
LSExtendedOptions::enableVMDetection
void(* enableVMDetection)(struct LSExtendedOptions *self, bool enable)
Definition: ExtendedOptions.h:108
LSExtendedOptions::isNativeTLSEnabled
bool(* isNativeTLSEnabled)(struct LSExtendedOptions *self)
Definition: ExtendedOptions.h:122
LSProxySettings::inner
void * inner
Definition: ExtendedOptions.h:17
CreateLSProxySettings
LS_API LSProxySettings * CreateLSProxySettings(const char *proxy, const char *user, const char *password)
FreeLSProxySettings
LS_API void FreeLSProxySettings(LSProxySettings *settings)
LSExtendedOptions::setUseNativeTLS
void(* setUseNativeTLS)(struct LSExtendedOptions *self, bool enable)
Definition: ExtendedOptions.h:120
LSExtendedOptions::collectNetworkInfo
void(* collectNetworkInfo)(struct LSExtendedOptions *self, bool collect)
Definition: ExtendedOptions.h:100
ListAvailableHardwareKeys
LS_API LSSerialList ListAvailableHardwareKeys()
Lists the serial numbers of all connected YubiKeys with PIV support.
LSExtendedOptions::setNetworkTimeout
void(* setNetworkTimeout)(struct LSExtendedOptions *self, long timeout)
Definition: ExtendedOptions.h:136
LSExtendedOptions::enableLicenseCorruptionCheck
void(* enableLicenseCorruptionCheck)(struct LSExtendedOptions *self, bool enable)
Definition: ExtendedOptions.h:124
LSExtendedOptions::setDeviceIdAlgorithm
void(* setDeviceIdAlgorithm)(struct LSExtendedOptions *self, enum DeviceIDAlgorithm algorithm)
Definition: ExtendedOptions.h:159
DeviceIDAlgorithm
DeviceIDAlgorithm
Type of Device ID algorithm used by the SDK.
Definition: PODTypes.h:118
LSExtendedOptions::isVMDetectionEnabled
bool(* isVMDetectionEnabled)(struct LSExtendedOptions *self)
Definition: ExtendedOptions.h:110
LSExtendedOptions
LS_API struct LSExtendedOptions LSExtendedOptions
FreeLSExtendedOptions
LS_API void FreeLSExtendedOptions(LSExtendedOptions *options)
LSExtendedOptions::setHardwareKeyOptions
void(* setHardwareKeyOptions)(struct LSExtendedOptions *self, const struct LSHardwareKeyOptions *options)
Definition: ExtendedOptions.h:166
LSExtendedOptions::isSSLCheckEnabled
bool(* isSSLCheckEnabled)(struct LSExtendedOptions *self)
Definition: ExtendedOptions.h:118
LSExtendedOptions::setCryptoProviderKey
void(* setCryptoProviderKey)(struct LSExtendedOptions *self, const char *key)
Definition: ExtendedOptions.h:162
LSExtendedOptions::setCryptoProviderSalt
void(* setCryptoProviderSalt)(struct LSExtendedOptions *self, const char *salt)
Definition: ExtendedOptions.h:164
LSHardwareKeyOptions
LS_API struct LSHardwareKeyOptions LSHardwareKeyOptions
C-interface struct mirroring LicenseSpring::HardwareKeyOptions.
LS_API
#define LS_API
Definition: APIDef.h:23
LSExtendedOptions::enableSSLCheck
void(* enableSSLCheck)(struct LSExtendedOptions *self, bool enable)
Definition: ExtendedOptions.h:116
CreateLSHardwareKeyOptions
LS_API LSHardwareKeyOptions * CreateLSHardwareKeyOptions()
Creates a new LSHardwareKeyOptions object.
LSExtendedOptions::setGracePeriod
void(* setGracePeriod)(struct LSExtendedOptions *self, uint32_t value)
Definition: ExtendedOptions.h:132
LSHardwareKeyOptions::setTargetSerial
void(* setTargetSerial)(struct LSHardwareKeyOptions *self, const char *serial)
Sets the target YubiKey serial number.
Definition: ExtendedOptions.h:60
CreateLSExtendedOptions
LS_API LSExtendedOptions * CreateLSExtendedOptions()
LSExtendedOptions::setHardwareID
void(* setHardwareID)(struct LSExtendedOptions *self, const char *ID)
Definition: ExtendedOptions.h:96
LSHardwareKeyOptions::setPin
void(* setPin)(struct LSHardwareKeyOptions *self, const char *pin)
Sets the PIN for the YubiKey.
Definition: ExtendedOptions.h:66
LSExtendedOptions::enableHardwareKey
void(* enableHardwareKey)(struct LSExtendedOptions *self, bool enable)
Definition: ExtendedOptions.h:128
LSExtendedOptions::isLoggingEnabled
bool(* isLoggingEnabled)(struct LSExtendedOptions *self)
Definition: ExtendedOptions.h:106
FreeLSSerialList
LS_API void FreeLSSerialList(LSSerialList *list)
Frees the memory allocated for an LSSerialList structure.
LSHardwareKeyOptions::inner
void * inner
Definition: ExtendedOptions.h:57
LSExtendedOptions::setProxySettings
void(* setProxySettings)(struct LSExtendedOptions *self, const struct LSProxySettings *settings)
Definition: ExtendedOptions.h:144
LSExtendedOptions::setAlternateServiceURL
void(* setAlternateServiceURL)(struct LSExtendedOptions *self, const char *URL)
Definition: ExtendedOptions.h:149
LSProxySettings
Definition: ExtendedOptions.h:15
FreeLSHardwareKeyOptions
LS_API void FreeLSHardwareKeyOptions(LSHardwareKeyOptions *options)
Frees the memory associated with an LSHardwareKeyOptions object.
LSExtendedOptions::inner
void * inner
Definition: ExtendedOptions.h:90
LSExtendedOptions::enableLogging
void(* enableLogging)(struct LSExtendedOptions *self, bool enable)
Definition: ExtendedOptions.h:104
LSExtendedOptions::getDeviceIdAlgorithm
enum DeviceIDAlgorithm(* getDeviceIdAlgorithm)(struct LSExtendedOptions *self)
Definition: ExtendedOptions.h:157
LSProxySettings::setPassword
void(* setPassword)(struct LSProxySettings *self, const char *password)
Definition: ExtendedOptions.h:27
LSSerialList
LS_API struct LSHardwareKeySerialList LSSerialList
Structure to hold a list of strings (serial numbers).
LSExtendedOptions::getConnectTimeout
long(* getConnectTimeout)(struct LSExtendedOptions *self)
Definition: ExtendedOptions.h:142
LSExtendedOptions::isCollectNetworkInfoEnabled
bool(* isCollectNetworkInfoEnabled)(struct LSExtendedOptions *self)
Definition: ExtendedOptions.h:102
LSProxySettings
LS_API struct LSProxySettings LSProxySettings
LSExtendedOptions::setLicenseFilePath
void(* setLicenseFilePath)(struct LSExtendedOptions *self, const wchar_t *filePath)
Definition: ExtendedOptions.h:92
LSHardwareKeySerialList
Structure to hold a list of strings (serial numbers).
Definition: ExtendedOptions.h:42
LSHardwareKeyOptions
C-interface struct mirroring LicenseSpring::HardwareKeyOptions.
Definition: ExtendedOptions.h:55
LSProxySettings::isValid
bool(* isValid)(struct LSProxySettings *self)
Definition: ExtendedOptions.h:31