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

Custom License Storage

9min

While a default location is predefined for the local license file, the flexibility to modify its location exists within LicenseSpring's C++ and .NET SDK.

This versatility allows for storing the license file in various alternative locations, including databases, Windows registries, or remote servers.

Note: This guide operates under the assumption that SQLite3 is properly installed on the reader's device, and a fundamental understanding of SQL is present.

If you require more information about SQLite, it's recommended to refer to their official documentation for comprehensive insights.

Prerequisites

  1. Completed the Getting Started Tutorial, specifically:
    • Initialized LicenseManager (or LicenseHandler) with your configuration using the appropriate settings.
    • Created a LicenseID using either LicenseID::fromKey or LicenseID::fromUser function, depending on the activation method you prefer.
    • Implemented basic license management, including license activations, deactivations, and both online and local license checks.

Default License File Encryption

In the LicenseStorage interface, the encryption and decryption of the license file are executed by invoking basic functions within the C++ and .NET SDK.

Encryption takes place during the activation and initial storage of the license, utilizing the activateLicense() method on the LicenseManager object.

Decryption of the license file is done when either reloadLicense() or getCurrentLicense() are called, also on the LicenseManager object.

Note: The methods loadLicense() and saveLicense() present in LicenseFileStorage are responsible for reading and writing the license file, without involving encryption or decryption. Encryption is exclusively carried out during license activation and retrieval processes.

Adding License File to a Database

Once you've established the derived class and successfully implemented the loadLicense(), saveLicense(), and clear() methods, the next step involves customizing the default file location.

To accomplish this, when instantiating the LicenseManager object, you should provide a second parameter. This additional parameter allows you to specify a different storage location for the local license.

By default, the local license is stored in a file. To check this default location, see our Local License File tutorial.

C++
|
licenseManager->create( configuration, storage );


Reminder: Encryption operations are conducted independently of the loadLicense() and saveLicense() methods. These methods do not require encryption or decryption procedures.

License File Terminology

LicenseFileStorageBase:

LicenseFileStorageBase serves as the foundational class responsible for storing licenses in a file and implementing the LicenseStorage interface. It is important to note that this class does not incorporate any mechanisms for ensuring synchronized access to files, rendering it unsuitable for concurrent multi-threaded operations.

LicenseFileStorage

Derived from LicenseFileStorageBase, the LicenseFileStorage Class inherits its characteristics and functionality, but with the added feature of thread-safe file operations. This class stands as the default choice for license storage, as it guarantees safe file handling even in multi-threaded scenarios.

LicenseFileStorageEx

A further specialization of the LicenseFileStorageBase class is LicenseFileStorageEx. This advanced license file storage variant is specifically designed for interprocess applications. It employs a synchronization mechanism using a mutex provided by the Boost library, ensuring both thread and process safety. This class is ideal for scenarios where concurrent access from multiple threads and processes is required while maintaining the integrity of file operations.

Updated 06 Sep 2023
Did this page help you?
PREVIOUS
Floating Server Usage
NEXT
Security and Crypto Providers
Docs powered by
Archbee
TABLE OF CONTENTS
Prerequisites
Default License File Encryption
Adding License File to a Database
License File Terminology
LicenseFileStorageBase:
LicenseFileStorage
LicenseFileStorageEx
Docs powered by
Archbee