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 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

  • 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.

Air-gap public key location

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.

License Activation

Follow these steps to activate a license via air-gap:

1

Open the air-gap activation portal

Open the air-gap activation portalarrow-up-right and enter the license key. It will display the key and initialization code.

Portal step 1
Portal step 2
2

Generate the activation code locally

Use the GetAirGapActivationCode method to get the activation code, passing the initialization code and license key as parameters. Also retrieve the hardware ID from the SDK configuration.

3

Submit data to the portal to get confirmation and policy

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.

Portal confirmation
Confirmation code
4

Download the policy file

Download the policy file from the licensing platform.

Policy file download
5

Activate the license locally

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.

Air-Gap license fields

License data contains information if the license was activated using the air-gap approach and the license policy id.

To get the corresponding fields use:

License deactivation

The air-gap deactivation process is similar to the air-gap activation. It contains the following steps:

1

Open the air-gap portal and switch to deactivation

Open the air-gap activation portalarrow-up-right and switch to license deactivation. Enter the license key; it will display the key and initialization code.

Deactivation portal step 1
Deactivation portal step 2
2

Generate the deactivation code locally

Use the GetAirGapDeactivationCode method to get the deactivation code, passing the initialization code and license key as parameters. Also retrieve the hardware ID from the SDK configuration.

3

Submit data to the portal to get confirmation

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.

Deactivation confirmation 1
Deactivation confirmation 2
4

Deactivate locally

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

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.

Last updated

Was this helpful?