Offline License

The LicenseSpring SDK supports full offline license activation, refresh, and deactivation. This is useful in environments where no direct internet access is available on the client machine. This guide walks you through the entire offline flow using the SDK.

Overview

Offline licensing is a multi-step process involving manual steps with the LicenseSpring portal. Each of these steps has a corresponding function in the SDK.

1

Generate an Offline Activation Request

This function creates an activation request file and stores it in a specified or default path (Desktop). You can upload this request on the LicenseSpring portal to get a license activation file.

See the detailed section below for example usage.

2

Activate License Using Activation File

After receiving the activation file from the LicenseSpring portal, use the SDK method to activate the license locally. The file is verified (signature, hardware ID, etc.) before updating the local license state.

See the detailed section below for example usage.

3

Apply Updates via a Refresh File

If the license is updated on the portal (e.g., extended expiration, additional features), you can download a refresh file and update your local license using the SDK. Option to reset local consumption counts is available.

See the detailed section below for example usage.

4

Generate Offline Deactivation Request

This function creates a deactivation request file that includes local license state (e.g., updated consumptions). Upload this file to the LicenseSpring portal to complete the deactivation. After calling this function, the license should be marked as inactive locally.

See the detailed section below for example usage.


Generate Offline Activation Request

This function creates an activation request file and stores it in a specified or default path (Desktop). You can upload this request on the LicenseSpring portal to get a license activation file.

// Provide a path where the request file should be stored.
// If an empty string is given, the file will be saved to the default desktop path.
offlineActivationData, path, err := lh.CreateOfflineActivationFile("")
if err != nil {
	return err
}

fmt.Printf("Offline Activation Request Data: %s\n Stored in path: %s\n", offlineActivationData, path)

By uploading this request file to the LicenseSpring's offline portal, you can activate the license and receive a license activation file.

Activate License Using Activation File

After receiving the activation file from the LicenseSpring portal, use this method to activate the license locally. The file is verified (signature, hardware ID, etc.) before updating the local license state.

Update License Using Refresh File

If the license is updated on the portal (e.g., extended expiration, additional features), you can download a refresh file and update your local license using this function. The second argument specifies whether to reset local consumption counts. If set to false, the number of local consumptions remain unchanged, otherwise, this value will be set to zero.

Generate Offline Deactivation Request

This function creates a deactivation request file that includes local license state (e.g., updated consumptions). Upload this file to the LicenseSpring portal to complete the deactivation. After calling this function, the license should be marked as inactive locally. License Offline Deactivation updates the LicenseSpring server with the latest state of the license before being deactivated.

Notes

  • These offline flows are meant for environments where no internet access is available.

  • Offline deactivation is currently the only way to sync local changes (such as consumption updates) back to the cloud in offline mode.

Was this helpful?