Offline Licenses

When a machine has no internet access at the time of activation, your app cannot reach the Cryptlex servers directly. Instead, you activate the license offline by exchanging files through the admin or customer portal.

How offline activation works

  1. Your app generates a request file. The user enters their license key, and LexActivator writes an offline activation request file that identifies the license and the machine.
  2. The request is exchanged for a response. You (or your customer) upload the request file on the admin or customer portal from any machine that has internet access, such as a phone, laptop, or edge device. The portal validates it and returns an offline activation response file that is valid for a limited period.
  3. Your app consumes the response. LexActivator reads the response file to activate the license on the offline machine and stores the activation on disk in encrypted form.

Once activated, your app verifies the license locally on every start, with no internet access required. For a time-bound license, LexActivator returns the LA_EXPIRED status when the license expires, which your application should handle based on your business requirements.

What the offline request file contains

The request file that GenerateOfflineActivationRequest() writes is an encrypted blob, not human-readable. Its payload is essentially the same JSON an online activation sends to the Cryptlex servers, identifying the license and the machine:

{
"licenseKey": "XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXXXX",
"productId": "63dfd63e-ed71-4f84-9236-02ee0ddb062c",
"fingerprint": "<machine fingerprint hash>",
"releaseVersion": "1.4.2",
"os": "windows",
"metadata": {},
...
}

The response file the portal returns is an encrypted, signed token with a validity window (see Creating the activation response). LexActivator verifies the signature and confirms the machine's current fingerprint still matches before activating, so the activation cannot be moved to another machine.

Generating the activation request

The user enters their license key, and your app generates the offline activation request file at the path you pass to the function:

SetLicenseKey("LICENSE_KEY");
GenerateOfflineActivationRequest("REQUEST_FILE_PATH");

Creating the activation response

Take the request file to any machine with internet access. In the admin portal, open the Activations page, click CREATE OFFLINE, upload the offline activation request file, set the validity of the response file, and click ACTIVATE. If the request is valid, the offline activation response file can be downloaded.

The response file is valid only for the period you set, so it must be consumed on the offline machine before that period expires. On the admin portal you can configure this validity; on the customer portal it is fixed at 3 days.

Activating with the response

Move the response file to the offline machine and let your app consume it from the path you pass to the function:

ActivateLicenseOffline("RESPONSE_FILE_PATH");

LexActivator persists the activation on disk in encrypted form. On every application start, it verifies the stored activation and confirms that the machine's current fingerprint still matches the fingerprint recorded in the activation data, so the license cannot be moved to another machine.

Deactivating offline

To free a seat from a machine without internet access, generate an offline deactivation request at the path you pass to the function:

GenerateOfflineDeactivationRequest("REQUEST_FILE_PATH");

This invalidates the local license data and writes an offline deactivation request file, which the user sends to you. To release the seat, delete the corresponding activation from the Activations page in the admin portal.

Offline floating licenses

For on-premise floating deployments, borrowing works differently, through LexFloatClient. See Borrowing a license for offline use.

Feature-Based LicensingSoftware Maintenance and Support
Last updated: