Skip to content

License activation#

This section describes license activation.

License activation should be performed after the distribution package is unarchived.

The generated license can only be used on the device where it was activated as the fingerprint of the device is used for its creation.

NOTE! Always remember that incorrect config may huck the things up very badly. Pay attention to what you configure and how. Always double-check what you deploy.

Online activation#

Online activation is performed when you have an Internet connection on the device where the LUNA SDK license is activated.

Licensing configuration options are specified via the "license.conf" file which is an XML document with special tag formatting.

You can find the "license.conf" file in the "data" directory in the distribution package.

This file is mandatory for license activation. You must fill it with the correct values before launching LUNA SDK.

Fill in this file carefully. Incorrectly entered data may cause problems with activation on the device.

Online activation process#

The activation process is as follows:

  • Request the Server, EID, and ProductID from VisionLabs
  • Go to the "data" directory
  • Open the "license.conf" file
  • Enter the received parameters
  • Save changes in the "license.conf" file

The license key will be generated and saved to the "data" directory.

Now you can use LUNA SDK.

Offline activation#

Offline activation is performed when you do not have an Internet connection on the device where the LUNA SDK license is activated.

In this case, you should create a fingerprint of your device and use it to receive a license key on any other device with the Internet.

Offline activation process#

The activation process is as follows:

  • Request the website address for license key activation and EID from VisionLabs

Perform the following steps on the device where the license should be activated:

  • Go to the "data" directory

  • Open the "license.conf" file

  • Enter the received EID

  • Save changes in the "license.conf" file

  • Go to the "./bin"

  • Run the "FingerprintViewer" utility to create a fingerprint of your device:

  • For Windows: launch the "FingerprintViewer.exe"

  • For Linux:

    • Give execution permissions to the "FingerprintViewer" utility
    chmod +x FingerprintViewer
    
    • Run the utility
    ./FingerprintViewer
    
  • The fingerprint will be printed in the console. Copy and save it.

Important: The FingerprintViewer application has compatibility issues on Astra Linux because some LUNA SDK shared libraries have the executable stack flag. For information how to troubleshoot the issue, see Astra Linux known issues.

Perform the following steps on the device with the Internet:

  • Go to the website to receive license (the website address was received on the first step of this instruction)

  • Enter your EID to enter the website, and using your device fingerprint activate a license.

  • Download license certificate. Please pay attention, by default filename is "licenseFile.v2c". Below are the steps (please choose one of them), how to configure. Move the "licenseFile.v2c" file to your device "data" directory of LUNA SDK.

    • Modify param "Filename" in file "license.conf" as in example below:
        <param name="Filename" type="Value::String" text="licenseFile.v2c"/>
    
    • Rename “licenseFile.v2c" to "license.dat". Param "Filename" in file "license.conf" need no modifications, by default as below:
        <param name="Filename" type="Value::String" text="license.dat"/>
    

Perform the following step on the device where the license should be activated:

  • Copy the received license key "license.dat" to the "data" directory of LUNA SDK.

License file parameters description#

License activation and next processing requires parameters listed below.

Parameter Description Type Default value
Server Activation server URL "Value::String" (empty)
EID Entitlement ID "Value::String" (empty)
ProductID Product ID "Value::String" (empty)
Filename Default license filename "Value::String" license.dat
Test If run in a test environment "Value::Int1" 0
ActivationMode Activation mode "Value::String" Hardware
FingerprintSource Generation option "Value::Int1" 0
ContainerMode If run in container "Value::Int1" 0
ConnectionTimeout Request timeout (in seconds) "Value::Int1" 15
ServerRetriesCount Retry attempts count "Value::Int1" 3
licenseModel License type "Value::Int1" 1

For more information on the parameters, see Parameter details.

By default, the file is created in the "data" directory. The file has a binary format. On subsequent launches of the product on the same device, the license will be automatically read from this file.

An example of the "license.conf" file:

?xml version="1.0"?>
<settings>
        <section name="Licensing::Settings">
                <param name="Server" type="Value::String" text=""/>
                <param name="EID" type="Value::String" text=""/>
                <param name="ProductID" type="Value::String" text=""/>
                <param name="Filename" type="Value::String" text="license.dat"/>
                <param name="Test" type="Value::Int1" x="1" />
                <param name="ActivationMode" type="Value::String" text="Hardware"/>
                <param name="FingerprintSource" type="Value::Int1" x="1"/>
                <param name="ContainerMode" type="Value::Int1" x="1"/>
                <param name="ConnectionTimeout" type="Value::Int1" x="15"/>
                <!-- Currently, the available values are: 1 and 2. Default is 1 -->
                <param name="licenseModel" type="Value::Int1" x="2" />
        </section>
</settings>

Parameter details#

Server, EID, and ProductID#

These parameters are mandatory for license activation. Obtain them from VisionLabs.

The EID parameter is required for both online and offline activation.

The Server and ProductID are only required for online activation.

Filename#

The Filename parameter specifies the name of the file where the license will be saved after activation.

The maximum length is 64 characters.

Important: Do not change the default name, as this may lead to unexpected behavior during activation or runtime.

Test#

Applies to FIT license only.

The Test parameter determines whether the system operates with a test entitlement in terms of FIT. It specifies whether the license being used is a test license or a production license. Possible values:

  • 0 - The system operates with a production license.
  • 1 - The system operates with a test license.

ActivationMode#

The ActivationMode parameter specifies which path to choose when retrieving device UID during license activation stage. Possible values:

  • Hardware
  • JNI

ContainerMode#

The ContainerMode parameter has the following possible values:

  • 0 - Ignore any virtual network interfaces in the formation of the fingerprint.
  • 1 - Take into account all virtual interfaces in the formation of a fingerprint.

The 1 value is used while running in docker container due to physical network interface is not available by default. Although, you can make physical interface available with --net=host and set ContainerMode to 0. In this case you can be sure fingerprint will not be changed among containers. For details, see "Licensing in docker container".

FingerprintSource#

The FingerprintSource parameter has the following possible values:

  • 0 - Default. First fingerprint generation option.
  • 1 - Second fingerprint generation option.

ConnectionTimeout#

The ConnectionTimeout specifies the maximum time, in seconds, allowed for the transfer operation during license activation.

Behavior:

  • A value of 0 disables the timeout, allowing the operation to proceed indefinitely.
  • Negative values or values exceeding the maximum limit (300 seconds) are invalid.

While longer timeouts reduce the risk of aborting valid operations, they may increase activation delays. Balance this parameter based on your network conditions.

ServerRetriesCount#

The ServerRetriesCount parameter defines the number of retry attempts for connecting to the activation server. It helps handle transient failures, improving application stability.

The parameter must be a non-negative integer, with a maximum value of 100 attempts.

licenseModel#

The licenseModel defines the license to be used. Possible values:

  • 1 - The system uses FIT license.
  • 2 - The system uses Zeus license.

Licensing in docker container#

Linux: Licensing of sdk in docker container is a bit peculiar.

When you start sdk in container first time it will try to activate license. During activation sdk will generate fingerprint of device for bounding device to current container. One of hardware parameter used during this process is mac address of network interface. The difference between host license activation and container activation - mac address of network interface generated randomly each time container run.

So, in following scenario, if user delete container and docker run a new one, he could not use sdk with already activated license because it bounded to fingerprint of container he just deleted. Two workarounds suggested in this case:

  1. User can use host physical interface by running docker run --network host ... and set ContainerMode == 0 in data/license.conf. In this case host physical interface will be available in container and fingerprint will be generated based on mac address of physical interface .If you run another one instance with the same option, fingerprint of this instance will be the same. Valid use cases: --network host and ContainerMode==0 or without --network host and ContainerMode==1
  2. It's not always convenient to share host and container network namespace. So another option is hardcode mac address for container beforehand with, for example, docker run --mac-address 00:00:00:00:00:11, and set ContainerMode==1 in data/license.conf. Then, if you need delete container and run with same license again, use the same mac address for sequential container runs specifying it with --mac-address option.

    The downside of this approach - you can support only one running container at the time due to possible frame collisions in case two or more containers with the same mac running on the same docker engine or L2 domain. More reading.

Note, mac address does not change if you just restart container.

Windows: For Docker desktop on Windows you can use option 2 from Linux instructions above