SDKs
...
v2
Samples
Local License
6min
local license check the sdk provides the ability to perform a local license check , which validates the locally stored license file without communicating with the licensespring server this function is especially useful in offline or air gapped environments where no internet connection is available, or when you want to ensure the local license is still valid after restarting your application what does it check? when you call the local license check, the sdk performs several validations whether the license is active and enabled whether the license is expired if the device is authorized to use the license if system time manipulation is detected (clock tampering) if the product code matches if the license is floating , whether its floating usage has expired (optional) it verifies the license signature 	license data, check resp, err = lh localcheck(true) 	if err != nil { 	 return err 	} the true flag enables signature verification you can set it to false if signature validation is not needed response structure the function returns a localcheckresponse type localcheckresponse struct { 	licenseresponse 	licenseactive bool `json "license active"` 	licenseenabled bool `json "license enabled"` 	isexpired bool `json "is expired"` 	devicelicensed bool `json "is device licensed"` 	isclocktampered bool `json "is clock tampered"` 	productmismatch bool `json "product mismatch"` 	floatingexpired bool `json "floating expired"` } use this response to determine whether the local license should be trusted get current license if your application restarts or you want to resume from the last known license state, you can load the locally stored license file using 	ld, err = lh getcurrentlicense() 	if err != nil { 	 return err 	} this retrieves the in memory license data previously saved by the sdk notes local checks do not validate or sync with the cloud use localcheck to determine license validity before performing actions that depend on license state