Skip to main content

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​

ParamDescription
scopeJSONActivation parameters in JSON format, details below

Example of scopeJSON​

scopeJSON
{
"HostName": "licentrix.tech",
"PathToSaveTheLicenseData": "./data/license.l2c",
"SerialNumber": "989e79-140a9f1aw880-323b973g960d",
"VendorID": "15cva7cyd4q0-a1f8t5d056b5"
}
FieldDescription
HostNameThe activation server address. Default value is licentrix.tech, replace only with backup address
PathToSaveTheLicenseDataLocal path to install the Program key. Default name of Program key is license.l2c
SerialNumberSerial numbers are on the Entitlements page
VendorID (Vendor Code)Located at the top of the Entitlements page

Return Values​

Status CodeNo.Description
LLK_OK0Request was successfully completed. The operation status is successful
LLK_INVALID_PARAMETER1The parameter scopeJSON is invalid (null pointers are forbidden)
LLK_INVALID_LICENSE_FILE7The 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_FOUND8Program key lookup has failed. For example, the Program key file was corrupted or deleted
LLK_LICENSE_FILE_PATH_IS_EMPTY9Invalid path to the Program key. The field PathToSaveTheLicenseData can't be passed as empty string
LLK_SERIAL_NUMBER_MISMATCH11If 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_ERROR14Network error. A service was denied by the server due to lack of access
LLK_INVALID_SERIAL_NUMBER15Invalid SerialNumber (empty or length error). Maybe the Vendor canceled the entitlement. Can't be passed as empty string
LLK_ACTIVATION_HOST_IS_EMPTY16Invalid activation server address. The field HostName can't be passed as empty string
LLK_INVALID_VENDOR_CODE18Invalid Vendor Code. The field VendorID can't be passed as empty string
LLK_INVALID_FORMAT19Invalid JSON format. The parameter scopeJSON can't be passed as empty string, or contains invalid fields
LLK_INTERNAL_TRY_AGAIN701Internal error. Please try again, or contact development team if retry was not helpful
Note

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

IMPORTANT

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

If 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 new Program key


Version history​

  • Added in version 1.0.0