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
LS_API LSExtendedOptions * CreateLSExtendedOptionsEx(const wchar_t *licenseFilePath, const char *hardwareID, const LSProxySettings *proxy)
void(* enableLicenseCorruptionCheck)(struct LSExtendedOptions *self, bool enable)
bool(* isLoggingEnabled)(struct LSExtendedOptions *self)
void(* enableHardwareKey)(struct LSExtendedOptions *self, bool enable)
bool(* isVMDetectionEnabled)(struct LSExtendedOptions *self)
enum DeviceIDAlgorithm(* getDeviceIdAlgorithm)(struct LSExtendedOptions *self)
void(* setCryptoProviderSalt)(struct LSExtendedOptions *self, const char *salt)
long(* getConnectTimeout)(struct LSExtendedOptions *self)
void(* enableLogging)(struct LSExtendedOptions *self, bool enable)
LS_API LSSerialList ListAvailableHardwareKeys()
Lists the serial numbers of all connected YubiKeys with PIV support.
LS_API void FreeLSProxySettings(LSProxySettings *settings)
void(* enableSSLCheck)(struct LSExtendedOptions *self, bool enable)
void(* setAlternateServiceURL)(struct LSExtendedOptions *self, const char *URL)
void(* setProxySettings)(struct LSExtendedOptions *self, const struct LSProxySettings *settings)
bool(* isValid)(struct LSProxySettings *self)
LS_API struct LSProxySettings LSProxySettings
LS_API struct LSExtendedOptions LSExtendedOptions
void(* setHardwareID)(struct LSExtendedOptions *self, const char *ID)
bool(* isCollectNetworkInfoEnabled)(struct LSExtendedOptions *self)
void(* setUser)(struct LSProxySettings *self, const char *user)
LS_API LSExtendedOptions * CreateLSExtendedOptionsByPath(const wchar_t *licenseFilePath)
C-interface struct mirroring LicenseSpring::HardwareKeyOptions.
bool(* isHardwareKeyEnabled)(struct LSExtendedOptions *self)
LS_API LSProxySettings * CreateLSProxySettings(const char *proxy, const char *user, const char *password)
LS_API void FreeLSExtendedOptions(LSExtendedOptions *options)
void(* setPassword)(struct LSProxySettings *self, const char *password)
bool(* isGuardFileEnabled)(struct LSExtendedOptions *self)
int count
Number of strings in the serials array.
LS_API struct LSHardwareKeyOptions LSHardwareKeyOptions
C-interface struct mirroring LicenseSpring::HardwareKeyOptions.
bool(* isNativeTLSEnabled)(struct LSExtendedOptions *self)
void(* setLicenseFilePath)(struct LSExtendedOptions *self, const wchar_t *filePath)
DeviceIDAlgorithm
Type of Device ID algorithm used by the SDK.
Definition: PODTypes.h:118
uint32_t(* getGracePeriod)(struct LSExtendedOptions *self)
void(* enableGuardFile)(struct LSExtendedOptions *self, bool enable)
long(* getNetworkTimeout)(struct LSExtendedOptions *self)
void(* setTargetSerial)(struct LSHardwareKeyOptions *self, const char *serial)
Sets the target YubiKey serial number.
void(* setAlternateKey)(struct LSExtendedOptions *self, const char *key)
LS_API void FreeLSHardwareKeyOptions(LSHardwareKeyOptions *options)
Frees the memory associated with an LSHardwareKeyOptions object.
LS_API struct LSHardwareKeySerialList LSSerialList
Structure to hold a list of strings (serial numbers).
void(* setAlternateKeyInt)(struct LSExtendedOptions *self, int32_t *key, int32_t size)
void(* collectNetworkInfo)(struct LSExtendedOptions *self, bool collect)
LS_API void FreeLSSerialList(LSSerialList *list)
Frees the memory allocated for an LSSerialList structure.
bool(* isLicenseCorruptionCheckEnabled)(struct LSExtendedOptions *self)
LS_API LSHardwareKeyOptions * CreateLSHardwareKeyOptions()
Creates a new LSHardwareKeyOptions object.
void(* setConnectTimeout)(struct LSExtendedOptions *self, long timeout)
void(* enableVMDetection)(struct LSExtendedOptions *self, bool enable)
LS_API LSExtendedOptions * CreateLSExtendedOptions()
void(* setPin)(struct LSHardwareKeyOptions *self, const char *pin)
Sets the PIN for the YubiKey.
void(* setUseNativeTLS)(struct LSExtendedOptions *self, bool enable)
#define LS_API
Definition: APIDef.h:23
void(* setNetworkTimeout)(struct LSExtendedOptions *self, long timeout)
void(* setProxyUri)(struct LSProxySettings *self, const char *uri)
char ** serials
Array of null-terminated C strings (serial numbers).
void(* setCryptoProviderKey)(struct LSExtendedOptions *self, const char *key)
void(* setDeviceIdAlgorithm)(struct LSExtendedOptions *self, enum DeviceIDAlgorithm algorithm)
Structure to hold a list of strings (serial numbers).
void(* setHardwareKeyOptions)(struct LSExtendedOptions *self, const struct LSHardwareKeyOptions *options)
void(* setGracePeriod)(struct LSExtendedOptions *self, uint32_t value)
bool(* isSSLCheckEnabled)(struct LSExtendedOptions *self)