SDKs
...
Tutorials
Licensing Scenarios

Air-Gapped Licensing

11min

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.

Prerequisites

  1. Completed the Getting Started Tutorial, specifically:
    • Initialized LicenseManager (or LicenseHandler) with your configuration using the appropriate settings.
    • Activated a key-based license of any type.

Air-Gap Configuration

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.

Document image


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:

C++
C#
Swift
Python


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. 

C++
C#


License Activation

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.

Document image

Document image


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.

C++
C#
Swift
Python


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.

Document image

Document image


Download the policy file from the licensing platform.

Document image


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.

C++
C#
Swift
Python


Air-Gap license fields

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:

C++
C#
Swift
Python


License deactivation

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.

Document image

Document image


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.

C++
C#
Python


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.

Document image

Document image


Use the DectivateAirGapLicense method, passing the confirmation code. This will deactivate the license on the device and remove the local license file.

C++
C#
Python


Errors

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.