llkActivateLicense
Descriptionβ
Depending on the conditions, makes license activation, or environment initialization
Activationβ
The activation is the very first call of llkActivateLicense
,
when the the system receives the Program key
and installs it using the path specified in the PathToSaveTheLicenseData
field
Environment Initializationβ
This is the case when an activation (Program Key) is already installed.
And each launch of the protected software calling llkActivateLicense
reads (path - PathToSaveTheLicenseData
) the installed Program key
, to initialize the environment
Syntaxβ
llkActivateLicense
LLK_API LLKStatus llkActivateLicense(const char* scopeJSON);
Parametersβ
Param | Description |
---|---|
scopeJSON | Activation parameters in JSON format, details below |
Example of scopeJSON
β
scopeJSON
{
"HostName": "licentrix.tech",
"PathToSaveTheLicenseData": "./data/license.l2c",
"SerialNumber": "989e79-140a9f1aw880-323b973g960d",
"VendorID": "15cva7cyd4q0-a1f8t5d056b5"
}
Field | Description |
---|---|
HostName | The activation server address. Default value is licentrix.tech, replace only with backup address |
PathToSaveTheLicenseData | Local path to install the Program key . Default name of Program key is license.l2c |
SerialNumber | Serial numbers are on the Entitlements page |
VendorID (Vendor Code) | Located at the top of the Entitlements page |
Return Valuesβ
Status Code | No. | Description |
---|---|---|
LLK_OK | 0 | Request was successfully completed. The operation status is successful |
LLK_INVALID_PARAMETER | 1 | The parameter scopeJSON is invalid (null pointers are forbidden) |
LLK_INVALID_LICENSE_FILE | 7 | The Product key has been violated. One of the possible reasons is attempt to edit and/or copy of a Product key from another PC |
LLK_LICENSE_FILE_NOT_FOUND | 8 | Program key lookup has failed. For example, the Program key file was corrupted or deleted |
LLK_LICENSE_FILE_PATH_IS_EMPTY | 9 | Invalid path to the Program key . The field PathToSaveTheLicenseData can't be passed as empty string |
LLK_SERIAL_NUMBER_MISMATCH | 11 | If a Program key with some Serial number installed, the attempt to initialize the environment with another serial number can't be successful. This is a protection for unintentional overwrites |
LLK_NETWORK_ERROR | 14 | Network error. A service was denied by the server due to lack of access |
LLK_INVALID_SERIAL_NUMBER | 15 | Invalid SerialNumber (empty or length error). Maybe the Vendor canceled the entitlement. Can't be passed as empty string |
LLK_ACTIVATION_HOST_IS_EMPTY | 16 | Invalid activation server address. The field HostName can't be passed as empty string |
LLK_INVALID_VENDOR_CODE | 18 | Invalid Vendor Code. The field VendorID can't be passed as empty string |
LLK_INVALID_FORMAT | 19 | Invalid JSON format. The parameter scopeJSON can't be passed as empty string, or contains invalid fields |
LLK_INTERNAL_TRY_AGAIN | 701 | Internal error. Please try again, or contact development team if retry was not helpful |
For successful Activation or Environment Initialization all parameters must contain valid string values
Examplesβ
C++ example
const nlohmann::json inputJSON =
{
{ "VendorID", vendorID },
{ "SerialNumber" , serialNumber },
{ "PathToSaveTheLicenseData" , pathToSaveTheLicenseData },
{ "HostName" , server },
};
const LLKStatus status = llkActivateLicense(inputJSON.dump().c_str());
std::cout << "ErrorCode: " << llkStatusDescription(status) << std::endl;
Example of a successful operation
ErrorCode: The operation status is successful.
In this example, used the library nlohmann json, to format the activation parameters in JSON format
If a
Program key
with someSerial number
installed, the attempt to initialize the environment with anotherserial number
can't be successful. This is a protection for unintentional overwritesIf need a new activation on the current PC, you must delete the old
Program key
. Or, specify a different path than the original one to save the newProgram key
Version historyβ
- Added in version
1.0.0