SDKs
...
Tutorials
Advanced Usage
Custom License Storage
7min
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 completed the getting started docid\ lsfy9tq3vfq4roow9shkd 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 docid\ fkfzhha n838tznrzu0sz tutorial licensemanager >create( configuration, storage ); java licensemanager initialize(configuration, repository); 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