Air-Gapped Licensing
Air gap licensing is a useful feature for isolated environments. The concept is similar to offline license management.
The main difference is that in regular offline activation we exchange files and and in air-gapped environments we cannot use files so we have to rely on exchanging strings.
In this guide you will find the instructions for implementing air-gap licensing using LicenseSpring SDK.
- Initialized LicenseManager (or LicenseHandler) with your configuration using the appropriate settings.
- Activated a key-based license of any type.
The air-gap public key is necessary to verify the confirmation code obtained from the air-gap activation portal. The public key can be found on the LicenseSpring portal under Settings->Keys.
If the air-gap public key is not set correctly in the configuration, the activation process will raise an AirGapActivationException with the message "Confirmation code is invalid."
To set the air-gap public key in the configuration use:
To secure the air-gap activation, make sure that guard file option is not set to false. This feature is enabled by default and ensures that the license will not be activated multiple times with the same data, enhancing security and reliability.
To activate a license, follow these steps:
Open the air-gap activation portal and enter the license key. It will display the key and initialization code.
Use the GetAirGapActivationCode method to get the activation code, passing the key and initialization code as parameters. Additionally, retrieve the hardware ID from the SDK configuration.
Enter the license key, hardware ID, and activation code in the activation portal. It will provide the policy ID and confirmation code and make the license active on the platform.
Download the policy file from the licensing platform.
Use the ActivateAirGapLicense method, passing the policy ID, key, confirmation code, and the path to the policy file or the location of multiple policy files. This will activate the license on the device.
License data contains the information if the license was activated using air-gap approach and the license policy id,
To get the corresponding fields use:
The air-gap deactivation process is similar to the air-gap activation. It contains the following steps:
Open the air-gap activation portal and switch to license deactivation. Enter the license key, it will display the key and initialization code.
Use the GetAirGapDeactivationCode method to get the deactivation code, passing the key and initialization code as parameters. Additionally, retrieve the hardware ID from the SDK configuration.
Enter the license key, hardware ID, and deactivation code in the activation portal. It will provide the confirmation code and make the license inactive on the platform.
Use the DectivateAirGapLicense method, passing the confirmation code. This will deactivate the license on the device and remove the local license file.
During air-gap activation, various exceptions may occur, including those encountered during regular activation. Additionally, in .NET, not all versions are supported. In such cases, a LicenseSpringException with the message "Air gap feature is not supported on .NET Framework 3.5-4.6" may be thrown.
AirGapActivationException can be thrown during license activation and deactivation in case confirmation code verification failed.