website logo
⌘K
Getting Started
Introduction
Basic Concepts
Opening an Account
Creating & Configuring Products
Integrating SDK and Configuring License Fulfillment
Activate a Key-Based License
Vendor Platform
Issuing New Licenses
License Detail View
Order Detail View
Customer Detail View
Metadata
Analytics
Settings
Product Configuration
Product Features
Product Custom Fields
Product Versioning
License Policies
Product Bundles
License Entitlements
License Types
Activations & Device Transfers
Features
Custom Fields
License Start Date
License Note
Maintenance Period
Trial Licenses
Floating Licenses
License Activation Types
Portals
End-User Portal
Offline Portal
Air-Gapped Portal
License API
License API Authorization
License Activation/Deactivation
License Check
Consumption
Floating
Trial Key
Product Details
Device Variables
Changing Password
Management API
Making API Requests
Management API Authorization
Customer
Product
Order
License
Device
Analytics
SDKs
Tutorials
.NET/C# SDK
.NET/C# Management SDK
C++ SDK
Java SDK
Python SDK
Go SDK
Delphi SDK
Swift/Objective-C SDK
Android SDK
Unity SDK
Errors and Response Codes
Floating Server
API Reference
Deployment
Configuration
Floating Server UI
Securing the Server
Whitelabeling
FAQ
Floating Server Changelog
Integrations
Salesforce
FastSpring
Stripe
Shopify
Common Scenarios
Single Sign On (SSO)
Glossary
General
SDK Glossary
Vendor Platform
Product Configuration Glossary
License Configuration
Postman Collections
Frequently Asked Questions
Changelog
License API changelog
Platform changelog
Docs powered by
Archbee
SDKs
...
Tutorials
Licensing Scenarios

Air-Gapped Licensing

15min

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
|
configuration.airgapKey = "your_air_gap_public_key"


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#
|
ExtendedOptions.ProtectOfflineActivation = true;


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
|
let activationCode = try manager.generateAirgapActivationCode(
    initializationCode: initCode,
    licenseKey: licenseKey
)
let hardwareID = configuration.hardwareID


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
|
try manager.verifyAirgapConfirmationCode(
    confirmationCode: "confirm_code",
    licenseKey: licenseKey,
    policyID: policyID
)
    
let license = try manager.activateLicense(
    airgapPolicyFile: policyFileLocation,
    licenseKey: licenseKey,
    policyID: policyID
)


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
|
bool isAirGapped = license->isAirGapped();
std::string policyId = license->policyId();


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#
|
var deactivationCode = licenseManager.GetAirGapDeactivationCode( initCode, licenseKey );
var hardwareId = configuration.HardwareID;


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#
|
license.DeactivateAirGap( "confirmation_code" );


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.

Updated 05 Sep 2023
Did this page help you?
PREVIOUS
User-Based Licensing
NEXT
License Type Options
Docs powered by
Archbee
TABLE OF CONTENTS
Prerequisites
Air-Gap Configuration
License Activation
Air-Gap license fields
License deactivation
Errors
Docs powered by
Archbee