SDKs
...
v2
Samples

Offline License

7min
the licensespring sdk supports full offline license activation, refresh, and deactivation this is useful in the 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 generate an offline activation request upload the request to the portal and download the activation file use the activation file to activate the license locally (optional) apply updates via a refresh file deactivate the license and upload the deactivation request file each of these steps has a corresponding function in the sdk 1\ 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 2\ 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 	// provide the path to the license activation file obtained from the portal 	// the sdk verifies the file (signature, hardware id, etc ) and stores the license locally 	ld, err = lh activatelicenseoffline(path) 	if err != nil { 	 return err 	} the licensespring sdk supports full offline license activation, refresh, and deactivation this is useful in air gapped environments where no direct internet access is available on the client machine this guide walks you through the entire offline flow using the sdk 2\ 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 	ld, err = lh offlineupdate(path, true) 	if err != nil { 	 return err 	} 2\ 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 lastest state of the license before being deactivated 	ld, deactivationreq, path, err = lh deactivateoffline("") 	if err != nil { 	 return err 	} 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