SDKs
...
v2
License Handler

Configuration Options

16min

Configuration Options for License Manager

The LicenseManager in the SDK provides several configuration options that allow you to tailor its behavior to your specific use cases, including air-gapped environments, logging control, offline support, and more.

Custom Logger (Resty)

The License Manager uses a Resty client to communicate with LicenseSpring’s API. By default, Resty logs to standard output. You can override this behavior by passing a custom logger using WithRestyLogger.

Go

Go


WithAirGapPublicKey

Go


This option is required for air-gapped licenses. The AirGap public key can be found on your LicenseSpring dashboard and is separate from your API and Shared keys.

WithGracePeriod

Go


By default, the SDK allows the license to be offline for 48 hours before invalidating it. This option lets you customize the duration of this grace period.

WithSyncPeriod

Go


Sets how frequently (in seconds) the SDK should try to synchronize the license with the server.

WithRestyVerbose

Go


When set to true, the SDK outputs detailed logs for LicenseClient operations.

WithVerifySignature

Go


When enabled, this option enforces signature verification on all responses from LicenseSpring.

WithEnableGuardFile

Go


This enables the use of guard files to protect against reuse of offline activation requests and ensure that hardware IDs match.

WithHardwareId

Go


Overrides the hardware ID used to identify the device.

WithAppName

Go


Overrides the App Name.

WithAppVersion

Go


Overrides the App Version.

WithServerPublicKey

Go


Overrides the server public key used to verify the signature in API responses. Setting up this value is mandatory if you are using a server other than LicenseSpring's servers.

WithHardwareIdAlgo

Go


Overrides the hardware ID used to identify the device. You can use this configuration option if you want to enable the built-in hardware ID module, which supports multiple hardware ID algorithms. You’ll need to select one of the supported algorithms from the list below:

  • HWIDAlgorithmWindowsFingerprint
  • HWIDAlgorithmComputerSystemProduct
  • HWIDAlgorithmCryptography
  • HWIDAlgorithmLinuxMachineID
  • HWIDAlgorithmCloudPlatform

Each algorithm generates the hardware ID differently depending on the operating system and environment. Choose the one that best fits your use case.

Go


WithMachineId

Go


Overrides the hardware ID and sets it to match the machine ID used in SDK v1. Use this option if you want to maintain compatibility with the hardware ID format from v1.