ImFusion C++ SDK 4.5.0
ImFusion::LicenseManagerSDK Namespace Reference

LicenseManagerSDK provide an interface to our license system for SDK users. More...

Detailed Description

LicenseManagerSDK provide an interface to our license system for SDK users.

Note: You must call Framework::init() before calling any function of LicenseManagerSDK (except for addCustomToken()). The earliest you are allowed to call any function of LicenseManagerSDK is in Framework::InitConfig::licenseInitFunction.

Functions

std::optional< ImFusion::Licensing::ErroractivateKeyOnline (const std::string &key)
 Perform regular online license activation of the SDK.
bool writeOfflineActivationRequestFile (const std::string &key, const std::string &outputPath)
 Write offline activation request file to disk.
std::string offlineActivationURL ()
 Returns the URL to the offline activation portal.
bool readOfflineActivationUnlockFile (const std::string &path)
 Read offline activation unlock file and activate license.
bool setProxy (const std::string &host)
 Set proxy to use for connecting to license server.
std::string key ()
 Return currently used license key.
bool isActivated ()
 Check whether a valid license is installed.
std::optional< std::chrono::system_clock::time_point > expirationDate ()
 Returns an optional point in time at which the license will expire. The optional will be empty if the license does not expire.
std::optional< DateTime::TimePointexpirationDateTimePoint ()
 Returns an optional point in time at which the license will expire. The optional will be empty if the license does not expire.

Function Documentation

◆ activateKeyOnline()

std::optional< ImFusion::Licensing::Error > ImFusion::LicenseManagerSDK::activateKeyOnline ( const std::string & key)

Perform regular online license activation of the SDK.

Parameters
keyLicense key
Returns
Error struct with further details in case of failure, empty otherwise
Note
This method needs to be called as part of Framework::InitConfig::licenseInitFunction. See Framework.h for details. Usually there is no need to call this method if isActivated() returns true.

◆ writeOfflineActivationRequestFile()

bool ImFusion::LicenseManagerSDK::writeOfflineActivationRequestFile ( const std::string & key,
const std::string & outputPath )

Write offline activation request file to disk.

Parameters
keyLicense key
outputPathFilesystem path for create license request file
Returns
true on success, false otherwise (which usually means the outputPath was not writable)
Note
The resulting file needs to be uploaded to offlineActivationURL() to perform an offline activation. This method needs to be called as part of Framework::InitConfig::licenseInitFunction. See Framework.h for details.

◆ readOfflineActivationUnlockFile()

bool ImFusion::LicenseManagerSDK::readOfflineActivationUnlockFile ( const std::string & path)

Read offline activation unlock file and activate license.

Parameters
pathPath to the unlock file produced by the portal at offlineActivationURL
Returns
true on success, false otherwise
Note
The input file of this function is produced by uploading the result of writeOfflineActivationRequestFile to offlineActivationURL. The request file must have been created by the same machine making this call, but upload to the portal can be done anywhere. Uploading the request file to the portal already consumed an activation for the license on the backend, which this function lets the SDK know about. This method needs to be called as part of Framework::InitConfig::licenseInitFunction. See Framework.h for details.

◆ setProxy()

bool ImFusion::LicenseManagerSDK::setProxy ( const std::string & host)

Set proxy to use for connecting to license server.

To disable a previously set proxy pass in an empty string.

Parameters
hostHost address of proxy server. Optionally can contain port in form :[port] at the end and a specific proxy type in the front (e.g. http://). If no port or proxy type is given 1080 and http are used.
Returns
True if proxy was set, false if proxy could not be set or is not supported

◆ expirationDate()

std::optional< std::chrono::system_clock::time_point > ImFusion::LicenseManagerSDK::expirationDate ( )

Returns an optional point in time at which the license will expire. The optional will be empty if the license does not expire.

Deprecated
"Use expirationDateTimePoint instead"
Search Tab / S to search, Esc to close