Developer Documentation
Security/License Interface
SecurityInterface.png


Functionality

The security Interface can be used to add a license management to your plugin. When it is used, plugins will only start, if a valid license is available. The license is bound to a machine (Processor,network,...) and expires after a specified date.

Usage

To use this interface do the following steps:

Includes

Add the LicenseManager include to your plugin header file.

QObject Replacement

Don't derive your Plugin from QObject anymore but from LicenseManager which has to be the first one in your class definition.

Cmake Change

Additionally add the option LICENSEMANAGER to your CMakeLists generator e.g.:

openflipper_plugin (LICENSEMANAGER ) )

Salt File

Copy the example sat file from OpenFlipper/LicenseManager/salt.hh.example to your plugin directory and rename it to salt.hh ( e.g. Plugin-Example/salt.hh ). Modify the contents of your salt file to match your plugin:

The contact line will be presented to the user when a license has to be retrieved. The user gets the option to start the mail program with this destination address and the license request.

#define CONTACTMAIL QString("contact@openflipper.org")

Afterwards modify the ADD_SALT_PRE and ADD_SALT_POST macros. Set the characters to some numbers you want. These salts will basically define a password that will be added to the hashes. It has to be kept !!secret!! as everybody who knows these salts, can generate licenses for your plugin. So don't give away your salt file. It is only used when compiling your plugin and the corresponding license manager.

The last thing to change is the ADD_PLUGIN_FILENAME macro. Specify the filename of your plugin here, omitting the ending as this will be added platform dependent by OpenFlipper.

License generation

When the plugin is now build, an additional LicenseManager is generated which shows a widget on execution. It will be in your build directory in the subdirectory LicenseManagement.

To generate a license, copy the license request you received into the widget. Remove all text lines. The manager will split the request into its separate strings. Enter a date, until the license should be valid and generate it.

The generated license has to be copied into OpenFlippers License subdirectory.