LIMAN SDK

Introduction

LIMAN SDK is a library of functions to add license protection to software applications. It offers an affordable, easy-to-use and industrial-strength solution against unauthorized use and duplication of software. It is distributed in the form of static and shared (dynamic) libraries ready to be embedded into a host application. It provides a framework to generate encrypted license keys and a set of functions to verify their validity. It is also equipped with protective features against tampering.

LIMAN SDK enables the creation and verification of

  • machine-locked licenses
  • user-locked licenses
  • time-limited licenses for trials and subscription based software
  • feature-based licenses

The licenses issued by LIMAN can also be configured to

  • be valid for a specific group of products
  • be valid for a specific version in the sense that major upgrades would require new licenses
  • possess varying capacities restricting the data quantity processed.
  • support custom features

The licensing framework is based on asymmetric cryptography, where license generation and verification require different keys. In asymmetric cryptography, key size is the primary measure of the cryptographic strength of the encryption. Although the keys are related mathematically (which is why they are often referred to as keypairs), it is virtually impossible to guess one with the knowledge of the other.

Most commonly, the private key is used to encrypt/sign the licenses, whereas the public key is used to decrypt/verify them. In such a framework, the public key would be embedded into the software application whereas the private key would be kept secret outside the software application.

Getting Started

This section gives an overview of the LIMAN SDK, instructions for getting started, sample applications and details concerning contact and support information. It also presents two utility applications that you will need

  • to generate product-specific keypairs
  • to generate product-specific license-keys to be sent out to your customers
  • to determine hostid on client machines for generating node-locked licenses

Note
These utility applications would meet most of your requirements in managing the licenses you are distributing. You can extend their source-code and rebuild to better suit your needs.

Download

Obtain the distribution package specific to your platform from our web site https://www.baroks.com/downloads. The names of distribution packages for supported operating systems (OS) are listed below. The tag x.y stands for the version of LIMAN SDK.

OS Platform Directory Library Format Installer
Windows 32-bit win32x86 Static (.lib) liman_core-x.y-win32x86.tar.gz
Windows 64-bit win64x86 Static (.lib) liman_core-x.y-win64x86.tar.gz
Linux 32-bit linux32x86 Static (.a) liman_core-x.y-linux32x86.tar.gz
Linux 64-bit linux64x86 Static (.a) liman_core-x.y-linux64x86.tar.gz
Download Page

Obtain Your License Key

You can purchase a LIMAN SDK license key from

https://www.baroks.com/buy

or request a time-limited trial license from

https://www.baroks.com/try

Once your order is completed, you will receive a confirmation email and a download link to your license key. The download file contains the license key embedded in a C/C++ code snippet. Follow the instructions in Installation section to incorporate it into LIMAN SDK.

Prepare the Development Environment

Prepare your development environment based on your platform.

  • Windows/VisualStudio: download and install Visual Studio Community https://visualstudio.microsoft.com/vs/community/

  • Windows/MinGW: download and install MinGW from the following links

    • https://www.mingw.org (for Windows 32-bit)
    • https://mingw-w64.org (for Windows 64-bit)
    • During MinGW installation, make sure to include gcc compiler toolchain
    • Prepend c:/MinGW/path/to/gcc directory to your %PATH% environment variable. Typically gcc is located under
      Copy to Clipboard

Note

Windows allows environment variables to be configured permanently at both the User level and the System level, or temporarily in a command prompt.To temporarily set environment variables, open Command Prompt and use the set command:

Copy to Clipboard

or

Copy to Clipboard

To permanently modify the default environment variables, click Start and search for Edit Environment Variables , or open System properties, Advanced System Settings and click the Environment Variables button. In this dialog, you can add or modify User and System variables. To change System variables, you need non-restricted access to your machine (i.e. Administrator rights).

  • Linux: Linux operating systems usually comes with GCC pre-installed. To verify if the compiler is installed on the machine, run the following command in the terminal
    Copy to Clipboard
    If the compiler is found, this will return the information about the compiler version. Otherwise, use the following commands to install gcc on Ubuntu/Debian
    Copy to Clipboard
    On Fedora/RedHat
    Copy to Clipboard
  • OSX: To set up a ‘C’ programming environment on Mac/OSX system, you have two options:
    1. Command Line Tools for Xcode
      • Download Command Line Tools for XCode from https://developer.apple.com/downloads/index.action. You will need an Apple developer ID.
      • After the file is downloaded on the machine, double click and follow the wizard and install the file. Always keep the default settings as suggested by the installation wizard.
      • After the installation process, open a terminal and run gcc -v command to check if everything is successfully installed.
    2. Homebrew package manager
      • Install homebrew (if not already installed)
        Copy to Clipboard
      • Run the following brew commands
        Copy to Clipboard
      • After the installation process, open a terminal and run gcc -v command to check if everything is successfully installed.

Installation

In this setup, a 64-bit Linux installation is assumed. For other platforms, the steps would be identical except for package names and system commands to use for building, copying, etc…

  1. Locate the liman-x.y-linux64x86.tar.gz file in your download folder. Copy this file into an installation directory of your choice (eg. /opt ) using the following command:

    Copy to Clipboard
  2. Change working directory to /opt and decompress liman-x.y-linux64x86.tar.gz using tar -xzvf command. This will create the root LIMAN SDK directory liman-x.y under /opt. It is your installation directory.
    Copy to Clipboard
    The following sub-directories will be placed within the installation directory.
    • apps/  : contains project and source files for the sample applications in  programming language.

    • bin/ : contains utility scripts for license management.

    • lib/ : contains platform independent jar files to link with java applications

    • lib/ : core LIMAN library, utility executables.

    • include/ : contains include or header files, defining the function prototypes, needed to compile applications in different programming languages.

    • license/ : contains the license file (e.g. usr_liman_lic.c) required to use LIMAN SDK.

    • doc/ : contains documentation files.

  3. Set the environment variable LIMAN_ROOT to point to the installation directory and update system path

    Copy to Clipboard

    Note
    To execute these lines automatically at logon, append these lines to the end of your startup script (.bashrc or .bash_profile for bash shell). Alternatively, update $LIMAN_ROOT/bin/limsetenv.sh script with the above lines and have your startup script (.bashrc or .bash_profile) source from that file with the following line

    Copy to Clipboard
  4. Change working directory to $LIMAN_ROOT/lib/linux64x86. The contents of this directory are
    Copy to Clipboard
  5. Save the license-file you obtained from baroks.com as $LIMAN_ROOT/license/usr_liman_lic.c
    Copy to Clipboard

    Note
    ~/Downloads/usr_XXXXXXXX_lic.c is the file you obtained from baroks.com

  6. Build the LIMAN SDK library with the following command.
    Copy to Clipboard
    This step will link the core LIMAN library lib/linux64x86/libliman_core.a against your license-file and create a licensed version LIMAN SDK. After the build is complete, you will have the following files in the working directory
    Copy to Clipboard
    This step completes the creation of LIMAN SDK library and utility executables integrated with your license-key. Take a note of the roles of the files in this folder
    Copy to Clipboard

Building a Product-Specific LIMAN SDK

The LIMAN SDK library lib/libliman_sdk.a you just built is not yet ready to be used to protect a particular application. In order to achieve that, the following component needs to be created and linked against lib/libliman_sdk.a.

Copy to Clipboard

Once this step is completed, you will have a custom build of LIMAN SDK to protect your product.

Note
This is the step where a product-specific keypair is required. You can create as many keypairs as you need, and protect as many products as you need.

For the purposes of this illustration, we will embed LIMAN SDK into a hypothetical product called TESTAPP.

Use limutil tool to generate a new product-license-base.  A product-license-base is a set of attributes and files associated with a specific product pertaining to license protection. In particular, it involves

  • A string of at most 12 characters that uniquely identifies a product. This could be specified by the user or be generated randomly by limutil.
  • The method of cryptography to be used. The default is RSA encryption.
  • A private and public keypair of specified size associated with the product. Default key size is 2048.

To display the list of available command-line options of limutil, type.

Copy to Clipboard
The following output will be displayed
Copy to Clipboard

NoteThis step considers a hypothetical product/application called TESTAPP for license-protection.

Run limutil to generate the product-license-base. Change the default key size to a different value if required. An RSA key size of 2048 bits is the default. This key size is considered safe by US-NIST until the year 2030. See this special publication for further information.

Copy to Clipboard
Now, you can verify that TESTAPP's keypair is written to subfolder ./TESTAPP. The folder will contain four files in it.
Copy to Clipboard

Two of the files have extension .key in which private and public keys are encoded in hexadecimal format. The other two contain the same keys embedded in a C/C++ function ready to be included in a C/C++ application.

The file TESTAPP_public_key.c is one of the components to be embedded into the product-specific LIMAN SDK and will eventually be linked against TESTAPP application.

The file TESTAPP_private*.* files will continue to live outside TESTAPP application and will be used by only the license generator (See License Generation section).

  • The other component that goes into the product-specific LIMAN SDK is the LIMAN SDK license key sent to you via email. This key is embedded in a C/C++ function which should be compiled and linked to core LIMAN library (libliman_core.a). If you haven’t received your LIMAN SDK license key, please visit https://www.baroks.com/try to get it. Your license key will be sent to you via email. Once you receive it, copy it into $LIMAN_ROOT/license directory and perform the following step to create the product-specific library libliman_<PRODUCT>_sdk.a. Note that we continue to assume that product TESTAPP is being targeted.
    Copy to Clipboard
    This final step will build the product-specific LIMAN SDK libliman_TESTAPP_sdk.aTESTAPP application will eventually be linked against this library to enable LIMAN powered license protection. In a Java or .NET application, libliman_TESTAPP_sdk.so (on Linux), libliman_TESTAPP_sdk.dylib (on OSX), or libliman_TESTAPP_sdk.dll (on Windows) would be used.For housekeeping purposes, libliman_TESTAPP_sdk.a is placed in lib/TESTAPP directory so that it is not mixed-up with other libraries built for other products or platforms. If you decide to switch to another private and public key pair, you will need to rebuild libliman_TESTAPP_sdk.a with a new keypair as described in Building a Product-Specific LIMAN SDK section. It is recommended to use different keypairs for different products or different versions of the same product.

    Note If product code is not specified explicitly, then limutil will generate a random string of 12-characters to be associated with the product-license-base generated. To see this, execute the following

    Copy to Clipboard
    Product-id is ‘FC16ADA16362’. Written private key in FC16ADA16362/FC16ADA16362_private.key. Written public key in FC16ADA16362/FC16ADA16362_public.key. Written private key as C/C++ code in FC16ADA16362/FC16ADA16362_private_key.c. Written public key as C/C++ code in FC16ADA16362/FC16ADA16362_public_key.c.When the product code is generated randomly, it will take a different value in each run. Therefore, the string value you see will be different than the above. To confirm the product-license-base for FC16ADA16362 was generated successfully, execute the following command.
    Copy to Clipboard

You will need to repeat this setup process for each product you want to protect with LIMAN SDK. In a hypothetical 3-product business, you will typically have the following directory structure after the setup. The product codes are assumed to be randomly generated by limutil. Running the following two more times

Copy to Clipboard

three product-license-bases, each with its own subfolder, will be created.

To build the LIMAN SDK for all products, run the following

Copy to Clipboard

The product-specific LIMAN libraries are now ready to be linked against by their respective products.

Copy to Clipboard

Your products should now be linked against the associated libliman_<PRODUCT>_sdk.a and the license generator limgen should use the private key associated with that product. For instance, the product 52ADB5129389 should be linked against libliman_52ADB5129389_sdk.a and limgen should use 52ADB5129389_private.key to generate licenses.

Note The libliman_<PRODUCT>_sdk.a library is meant to be used with a specific product, it should not be used for protecting multiple products.

License Generation

License generation involves creating an encrypted license key that contains the following information

  • A string with LIMPAR_MAX_LEN_PRODUCTID characters that uniquely identifies a product (like a barcode, brand name and/or model number)
  • An integer platform identifier that specifies the platform or architecture. (e.g. Windows 32-bit, Linux 64-bit, etc..) for which the license is good for.
  • An integer specifying the major version number.
  • An integer specifying the minor version number.
  • An integer specifying the size of license (e.g. when the software’s capabilities should vary with license size. A typical example is when a database application could process at most a prespeficed number of records for a given license size).
  • An integer constant specifying the type of license (e.g. educational, trial, commerical).
  • An integer specifying the number of concurrent seats/users allowed by the license (reserved for future use).
  • An integer specifying the expiry date of the license in YYYYMMDD format (optional).
  • A string with LIMPAR_MAX_LEN_SERIAL characters specifying the serial number for the product (optional).
  • A string with LIMPAR_MAX_LEN_UUID characters specifying a universally unique identifier for the product (optional).
  • A string with LIMPAR_MAX_LEN_HOSTID characters specifying the host-id of the host machine (optional).
  • A byte (char) array of 4 elements to specify additional features using bitmasks (optional). Each byte can characterize 8 features.

LIMAN SDK has two data types which needs to be initialized before any license-related operation could be performed.

The steps to create a license key can be summarized as below

  • Create a new environment instance by calling lim_create_env().
  • Read the private key associated with the product by calling lim_read_private_key().
  • Create an empty license instance by calling lim_create_lic().
  • Call lim_load_lic() after setting up the following arguments to be passed
    • Product code.
    • Platform identifier.
    • Major and minor version number.
    • License size (optional).
    • License type (optional).
    • An expiry date (optional).
    • A serial number created with lim_gen_rkey() or your own serial-generation code. It should have at most LIMPAR_MAX_LEN_SERIAL characters.
    • Create a random UUID for the license with lim_gen_uuid() (optional). It should have at most LIMPAR_MAX_LEN_UUID non-hyphen characters.
    • The host-id of the node (machine) the license will be installed on. This is required only if the license will be node-locked. Request this information from your customer.
    • Set up optional features (optional).
  • Call lim_write_lickey() to export the license key to a file.
  • Call lim_free_lic() and lim_free_env() to free the memory used.
  • Send the license key to your customer.

These steps are illustrated in sample application limgen. It is located in apps/c/limgen directory. Run the following command to build it

Copy to Clipboard

After the build is complete, type

Copy to Clipboard

to display the list of available command-line options. The setup of the license key is achieved by setting associated command-line options. You can use this utility for most of your license generation needs. Alternatively, you can modify it to suit your needs or extend it to a GUI application.

Copy to Clipboard

Using Bitmasks to Enable Optional License Features

Your application may have different features and functionalities which require to be licensed separately. LIMAN SDK allows you to enable a maximum of 32 optional features in a license key. This is achieved by setting the elements of a byte (char) array with 4 elements to specific bitmask values during license generation and thereby enabling/disabling required features. Each byte (char) is assigned to a 8-bit bitmask value in the range [0..255]. By default all elements are set to zero. After this array is set up, it is passed to lim_load_lic() to incorporate these features into the license key.

We illustrate the workings with a hypothetical case for a single byte. It is straightforward to extended the same logic to four bytes. Suppose your application offers 8 different techniques for sorting records of data. Because they have varying efficiencies and requirements, you may want to price them individually. This will require you to set up the license keys with feature-availability information. Your customers may want to purchase one or some or all or none of these features depending on your licensing model. Let the following be the sort techniques offered by your hypothetical application

  • Quick Sort
  • Merge Sort
  • Heap Sort
  • Insertion Sort
  • Intro Sort
  • Block Sort
  • Shell Sort
  • Bubble Sort

For a particular license key, availability of each feature could be represented with a specific bit in a byte of license data. Consider the following byte (char) variable and how each bit is designated to a specific sorting method (feature). This 8-bit data block would be one of the components of the input passed to the license generation phase. So, it has to be set up according to customer’s license requirements. Initially, all bits are set to zero (empty) meaning that none of the sorting methods (features) are available to the license holder.

Suppose your customer requested a license with Quick Sort, Heap Sort and Block Sort. This is accomodated by switching on the bits associated with these features in a single byte (char) variable.

Note

Specific bits of a byte can be modified by ( | ) , (~) , (^) and (&) operators.

This 8-bit data block corresponds to binary number $ (00100101)_2 $ which equals $ 2^0 + 2^2 + 2^5$ = $ 1 + 4 + 32 = 37$ in base-10. In $LIMAN_ROOT/include/liman.h symbolic constants are provided for each bit position

Copy to Clipboard

A code similar to the following could be used to set up desired features. This task would typically be performed by the license generation application, e.g. limgen. This particular code turns on bits 0, 2 and 5 in feature[0] and enables the associated sort methods. In this example, other features feature[1], feature[2] and feature[3] are also set to various values for illustration purposes.

Copy to Clipboard

After the license key is generated and sent to the customer, the application will check the available features by a code snippet similar to the following.

Copy to Clipboard

You can test this scenario by running limgen using lg_testapp.sh, which is the license generation script for TESTAPP application. This script will create a license keyfile, TESTAPP/usr_<product>.lic, with properties specified in lg_testapp.sh.

Copy to Clipboard

Note

If command line option –hostid option was specified, you would have seen a warning that the license is not valid, implying that it is good only for the client machine with hostid=. This is a message you will see for all node-locked licenses you generate for client machines.

Copy to Clipboard

This license is written into TESTAPP folder and ready to be used with testapp application. Running testapp with specified license file will produce the given output. As indicated by the application log, only licensed sort methods are confirmed to be available with the specified license

Copy to Clipboard

See testapp.c implementation for details, especially how other features are checked to control the flow of the code.

License Key Format

The licenses generated by LIMAN SDK will be in the following format. They contain an encryption of the data specifying license properties. The actual license key is the string contained within BEGIN LICENSE KEY and END LICENSE KEY lines. The creation of license keys require your private key, which should remain private on your local site and should not be shared with the outside world. The validation will be performed by your application using the public key embedded in libliman_TESTAPP_sdk.a.

Copy to Clipboard

Contact and Support Information

LIMAN SDK is licensed and supported by Baroks Inc. (https://www.baroks.com). General information regarding LIMAN SDK can be found at the Baroks website

https://www.baroks.com/document

For technical support, send questions to

Copy to Clipboard

Questions regarding licensing information or other information about Baroks products can be sent to

Copy to Clipboard

Appendix A: Error Codes

The list of errors in LIMAN SDK along with a brief description is given in the following. The symbolic constants are defined in include/liman.h header file.

Symbolic Constant Description
LIMERR_FIRST_CARD Specified file was not found
LIMERR_MEMORY Error in allocating memory
LIMERR_FILE_NOT_FOUND Specified file was not found
LIMERR_INVALID_NULL Specified reference is invalid or null
LIMERR_INVALID_LICENSE Specified license is invalid
LIMERR_ENVAR_NOT_FOUND Specified environment variable is not found
LIMERR_LICENSE_EXPIRED License has expired
LIMERR_LICENSE_NOT_LOADED License is not loaded
LIMERR_INVALID_DOMAIN Domain parameters are invalid
LIMERR_INVALID_PRODUCT_CODE Specified product code is invalid for the given license
LIMERR_INVALID_USER Current user is invalid for the given license
LIMERR_INVALID_PRODUCT_VERSION Specified product version is invalid for the given license
LIMERR_INVALID_PLATFORM Specified platform code is invalid for the given license
LIMERR_INVALID_ENVAR Specified environment variable is invalid
LIMERR_INVALID_ENV Specified environment is invalid
LIMERR_INVALID_INPUT Specified input is invalid
LIMERR_UNABLE_TO_OPEN_FILE Failed to open specified file
LIMERR_INVALID_LICENSE_FILE_NAME Specified license file is invalid
LIMERR_OPERATION_FAILED An internal crypto-operation has failed
LIMERR_PRIVKEY_FILE_NOT_FOUND Private key file is not found
LIMERR_PUBKEY_FILE_NOT_FOUND Public key file is not found
LIMERR_NOT_SUPPORTED Feature is not supported
LIMERR_INVALID_KEYLEN The key length is invalid
LIMERR_NOT_AVAILABLE Requested information is not available
LIMERR_INVALID_KEY Key under operation is invalid
LIMERR_SHORT_KEY Key under operation is too short
LIMERR_BAD_ERRORCODE Specified error code is invalid
LIMERR_INTERNAL An internal error has occurred. Contact your vendor
LIMERR_ENV_NOT_READY LIMAN environment is not ready
LIMERR_ALREADY_LOADED Specified object is already loaded
LIMERR_SYSTEM Platform specific system error
LIMERR_CLOCK_SETBACK Clock setback detected
LIMERR_INVALID_HOST Host is invalid or hardware has changed
LIMERR_KEYS_NOT_LOADED Private and Public keys are not loaded
LIMERR_PRIVKEY_FILE_EXISTS Private key file ‘usr_private.key’ already exists
LIMERR_PUBKEY_FILE_EXISTS Public key file ‘usr_public.key’ already exists
LIMERR_KEYSIZE_MISMATCH_ENV The size of specified key does not conform the environment
LIMERR_RANGE_TYPE_CODE Specified type-code is out-of-range
LIMERR_RANGE_PRODUCT_CODE Specified product-code is out-of-range
LIMERR_RANGE_MAJOR_VERSION Specified major-version is out-of-range
LIMERR_RANGE_MINOR_VERSION Specified minor-version is out-of-range
LIMERR_RANGE_SIZE_CODE Specified size code is out-of-range
LIMERR_RANGE_PLATFORM_CODE Specified platform code is out-of-range.
LIMERR_INVALID_HOSTMASK Host is invalid or hardware has changed
LIMERR_BUFFER_TOO_LONG Buffer is too long
LIMERR_MKDIR_FAILED Cannot create directory
LIMERR_PRIVKEY_NOT_LOADED Private key is not loaded
LIMERR_PUBKEY_NOT_LOADED Public key is not loaded
LIMERR_FILE_TOO_SMALL Specified file is too small
LIMERR_FILE_IO File I/O error
LIMERR_INPUT_TOO_BIG Specified input is too big
LIMERR_LAST_CARD Placeholder for last error

Modules

LIMAN SDK Functions

Functions Table
PRECALL
int
STDCALL
lim_exd_bstream (pLIMENV pEnv,
char *pachBufferIn, 
int nBytesIn, 
char *pachBufferOut, 
int *pnBytesOut, 
int nDirection)

Encrypts or decrypts arbitrarily large byte-streams. More…

PRECALL
pLIMENV
STDCALL
lim_create_env(int nKeySize,
int nHashSize,
int *pnErr)

Constructs a new LIMAN environment. More…

PRECALL
int
STDCALL
lim_load_lic(pLIMLIC pLic,
const char *szProductCode,
int mPlatformId,
int nMajorVersion,
int nMinorVersion,
int mSizeId,
int mTypeId,
int nUsers,
int nExpiration,
const char *pcFeatures,
const char *szSerial,
const char *szUUID,
const char *szHost,
const char *szUserid,
int nHostIdMask)

Loads the specified license with specified properties. It is recommended to use symbolic constants to specify constant values as given in liman.hMore…

PRECALL
int
STDCALL
lim_free_lic (pLIMLIC *ppLic)

Destroys the specified license. More…

PRECALL
int
STDCALL
lim_delete_lic (pLIMLIC pLic)

Deletes the specified license. More…

PRECALL
int
STDCALL
lim_free_env (pLIMENV *ppEnv)

Destroys the specified LIMAN environment. More…

PRECALL
int
STDCALL
lim_delete_env(pLIMENV pEnv)

Deletes the specified LIMAN environment. More…

PRECALL
int
STDCALL
lim_print_lic (pLIMLIC pLic, char *strbuf)

Prints the license data to an output string buffer. More…

PRECALL
int
STDCALL
lim_get_hash16 (const char *pachBuffer,
int nBytesIn,
char *szHash)

Gets 16-byte hash of input buffer. More…

PRECALL
int
STDCALL
lim_get_hash12 (const char *pachBuffer,
int nBytesIn,
char *szHash)

Gets 12-byte hash of input buffer. More…

PRECALL
int
STDCALL
lim_get_hash8 (const char *pachBuffer,
int nBytesIn,
char *szHash)

Gets 8-byte hash of input buffer. More…

PRECALL
int
STDCALL
lim_get_sha (const char *pachBufferIn,
int nBytesIn,
char *pachBufferOut,
int nHashSize)

Gets sha/sha3 hash of input buffer. More…

PRECALL
int
STDCALL
lim_get_licsha (pLIMLIC pLic, char *pachBufferOut)

Gets hash of license. More…

PRECALL
int
STDCALL
lim_get_libsha (pLIMENV pEnv, char *pachBufferOut)

Gets hash of library. More…

PRECALL
int
STDCALL
lim_get_hostid(char *szStr255, int nHostIdMask)

Gets the hostid (fingerprint) of current host. More…

PRECALL
int
STDCALL
lim_get_macid (char *szStr255, int id)

Gets the MAC address of i'th device of current host. More…

PRECALL
int
STDCALL
lim_get_cpuid (char *szStr255)

Gets the cpu-id of current host. More…

PRECALL
int
STDCALL
lim_get_verkey (int *pnMajor,
int *pnMinor,
int *pnRelease,
int *pnRevision,
char *szComment)

Get LIMAN SDK version identifiers. More…

PRECALL
int
STDCALL
lim_get_verstr (char *szComment)

Get version string. More…

PRECALL
int
STDCALL
lim_gen_rkey (pLIMENV pEnv,
int nSeed,
int nLen,
int nBase,
char *szRandKey)

Generates a random key of specified length. More…

PRECALL
int
STDCALL
lim_gen_uuid (pLIMENV pEnv,
int nSeed,
char *szRandUUID)

Generates a new UUID (version 4) in non-canonical form, which is a series of 32 hexadecimal characters with no hyphens. In version 4, the 13’th character is ‘4’ and 17’th character is one of 8, 9, A, or B. More…

PRECALL
int
STDCALL
lim_gen_product_id (pLIMENV pEnv,
int nSeed,
char *szRandProductId)

Generates a random hexadecimal product code. More…

PRECALL
int
STDCALL
lim_get_keypair (pLIMENV pEnv,
char *szP,
char *szQ,
char *szN)

Gets key pairs in hex. More…

PRECALL
int
STDCALL
lim_new_keypair (pLIMENV pEnv, int nKeySize)

Loads a new RSA key pair of specified size to LIMAN environment. More…

PRECALL
int
STDCALL
lim_gen_keypair (int nKeySize,
int nSeed,
const char *szProductCode)

Generates an RSA key pair of specified size and writes them to files _private.key and _public.key respectively. More…

PRECALL
int
STDCALL
lim_gen_keypair_ecp (int nKeySize, int nSeed)

Generates an RSA key pair of specified size and writes them to files usr_private.key and usr_public.key respectively. More…

PRECALL
int
STDCALL
lim_write_keypair (pLIMENV pEnv,
const char *szPrivateKeyFile,
const char *szPublicKeyFile)

Writes the RSA key pair associated with specified LIMAN environment. More…

PRECALL
int
STDCALL
lim_write_keypair_carr (pLIMENV pEnv,
const char *szPrivateKeyFile,
const char *szPublicKeyFile)

Writes the RSA key pair associated with specified LIMAN environment as a C array. More…

PRECALL
int
STDCALL
lim_hash_file (const char *szFile,
char *szHash,
int nHashSize)

Calculate and get the base16 encoded hash of the bytes of the given file. More…

PRECALL
int
STDCALL
lim_read_public_key (pLIMENV pEnv,
const char *szPublicKeyFile)

Reads the public key from specified file. More…

PRECALL
pLIMLIC
STDCALL
lim_create_lic (pLIMENV pEnv, int *pnErr)

Constructs a new blank license to be set up with lim_load_lic() More…

PRECALL
int
STDCALL
lim_read_private_key (pLIMENV pEnv,
const char *szPrivateKeyFile)

Reads the private key from specified file. More…

PRECALL
int
STDCALL
lim_load_public_key (pLIMENV pEnv,
const char *szPublicKey)

Loads the public key string to LIMAN environment. More…

PRECALL
int
STDCALL
lim_load_private_key (pLIMENV pEnv,
const char *szPrivateKeyP,
const char *szPrivateKeyQ)

Loads the private key string to LIMAN environment. More…

PRECALL
int
STDCALL
lim_parse_keypair (pLIMENV pEnv)

Parses the imported RSA key pair into the LIMAN environment. More…

PRECALL
int
STDCALL
lim_assert_valid (pLIMLIC pLic)

Validates specified license instance. More…

PRECALL
int
STDCALL
lim_days_to_expiry (pLIMLIC pLic)

Returns the number of days to expiration. More…

PRECALL
const
char
*STDCALL
lim_product_id (pLIMLIC pLic)

Returns the product code associated with the license. More…

PRECALL
int
STDCALL
lim_has_feature (pLIMLIC pLic,
int idSlot,
int mFeature)

Returns whether the specified feature is available in the given license. More…

PRECALL
int
STDCALL
lim_is_verified (pLIMLIC pLic)

Generates a flag indicating whether the license is valid or not. More…

PRECALL
char
*STDCALL
lim_get_lickey (pLIMLIC pLic)

Returns the license key parsed into a license instance. More…

PRECALL
pLIMLIC
STDCALL
lim_create_lic_fromfile (pLIMENV pEnv,
const char *szKeyFile,
int *pnErr)

Creates a new license key from the specified license file. More…

PRECALL
pLIMLIC
STDCALL
lim_create_lic_fromkey (pLIMENV pEnv,
const char *szKey,
int *pnErr)

Creates a new license instance from license key. More…

PRECALL
int
STDCALL
lim_copy_lic2str (pLIMLIC pLic, char *szKey)

Copies the license data into a string. More…

PRECALL
int
STDCALL
lim_copy_str2lic (const char *szBuffer,
pLIMLIC pLic)

Copies the license string to the specified license instance. More…

PRECALL
int
STDCALL
lim_keys_loaded (pLIMENV pEnv)

Returns a flag to specify if keys are loaded to LIMAN environment. More…

PRECALL
int
STDCALL
lim_write_lickey (pLIMLIC pLic,
const char *szKeyFile)

Writes the license key to specified file. More…

PRECALL
int
STDCALL
lim_write_lickey_carr (pLIMLIC pLic,
const char *szKeyFile)

Writes the license key as a C/C++ function into specified file. More…

PRECALL
int
STDCALL
lim_sign_lic (pLIMLIC pLic)

Sign the license. More…

PRECALL
int
STDCALL
lim_veri_lic (pLIMLIC pLic)

Verify the license data. More…

PRECALL
int
STDCALL
lim_set_licreq (pLIMLIC pLic,
int mPlatformId,
char *szProductCode,
int nMajorVersion,
int nMinorVersion,
int mSizeId,
int mTypeId)

Sets license requirements. More…

PRECALL
int
STDCALL
lim_major_version (pLIMLIC pLic)

Returns the major version associated with the license. More…

PRECALL
int
STDCALL
lim_minor_version (pLIMLIC pLic)

Returns the minor version associated with the license. More…

PRECALL
int
STDCALL
lim_platform_id (pLIMLIC pLic)

Returns the platform identifier associated with the license. More…

PRECALL
int
STDCALL
lim_size_id (pLIMLIC pLic)

Returns the size associated with the license. More…

PRECALL
char
*STDCALL
lim_lic_id (pLIMLIC pLic)

Returns the license identifier. More…

PRECALL
int
STDCALL
lim_type_id (pLIMLIC pLic)

Returns the type associated with the license. More…

PRECALL
int
STDCALL
lim_set_rsa_dir (pLIMENV pEnv, int nFlag)

Set the RSA encryption direction. More…

PRECALL
int
STDCALL
lim_write_secretmsg (pLIMENV pEnv,
const char *szPlainMsg,
const char *szSecretMsgFile)

Write a secret message (encrypted with public key) to a file. This message can be decrypted with the associated private key. More…

PRECALL
int
STDCALL
lim_get_userid (char *szUserId)

Get the current userid on host. More…

PRECALL
int
STDCALL
lim_get_dmiuuid (char *szDMIUUD)

Get the current dmiuuid on host. More…

PRECALL
char
*STDCALL
lim_canonical_uuid (const char *szUUID)

Converts the specified non-canonical UUID into canonical form, i.e. groups of 8,4,4,4,12 characters as in xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. More…

Detailed Description

License Manager SDK Functions.

This group contains API functions in LIMAN SDK.

Function Documentation

◆ 
lim_assert_valid()

PRECALL int STDCALL lim_assert_valid(pLIMLIC pLic)

Validates specified license instance.

Parameters
pLic An instance of license object
Returns
An error code listed in Appendix A

◆ 
lim_canonical_uuid()

PRECALL char* STDCALL lim_canonical_uuid(const char * szUUID)

Converts the specified non-canonical UUID into canonical form, i.e. groups of 8,4,4,4,12 characters as in xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.

Parameters
         szUUID An UUID in non-canonical form
Returns
The UUID in canonical form.
Remarks
This function is not thread-safe.
Examples:
limutil.c.

◆ 
lim_copy_lic2str()

PRECALL int STDCALL lim_copy_lic2str (pLIMLIC pLic, char * szKey)

Copies the license data into a string.

Parameters
pLic An instance of license
szKey A string to copy the license key into
Returns
An error code listed in Appendix A

Remarks
Also see lim_copy_str2lic

◆ 
lim_copy_str2lic()

PRECALL int STDCALL lim_copy_str2lic (const char * szBuffer, pLIMLIC pLic)

Copies the license string to the specified license instance.

Parameters
szBuffer A string containing the license data
pLic An instance of licens
Returns
An error code listed in Appendix A
Remarks
Also see lim_copy_lic2str

lim_create_env()

PRECALL pLIMENV STDCALL lim_create_env (int nKeySize, int nHashSize, int * pnErr )

Constructs a new LIMAN environment.

Parameters
nKeySize License key size in bits
nHashSize Hash size in bits
pnErr A reference to an integer error code listed in Appendix A
Returns
A new instance of LIMAN environment
Examples:
limgen.climutil.c, and testapp.c.

lim_create_lic()

PRECALL pLIMLIC STDCALL lim_create_lic(pLIMENV pEnv, int * pnErr)

Constructs a new blank license to be set up with lim_load_lic()

construct a new license

Parameters
pEnv An instance of LIMAN environment
pnErr A reference to an error code listed in Appendix A
Returns
A new license instance (LIMLIC)
Remarks
See lim_load_lic()
Examples:
limgen.c.

lim_create_lic_fromfile()

PRECALL pLIMLIC STDCALL lim_create_lic_fromfile (pLIMENV pEnv, const char * szKeyFile, int * pnErr )

Creates a new license key from the specified license file.

Parameters
pEnv An instance of LIMAN environment
szKeyFile License file
pnErr A reference to an error code listed in Appendix A
Returns
An instance of license object
Examples:
limgen.c, and testapp.c.

lim_create_lic_fromkey()

PRECALL pLIMLIC STDCALL lim_create_lic_fromkey (pLIMENV pEnv,const char * szKey,int * pnErr )

Creates a new license instance from license key.

Parameters
pEnv An instance of LIMAN environment
szKey License key
pnErr A reference to an error code listed in Appendix A
Returns
An instance of license object

lim_days_to_expiry()

PRECALL int STDCALL lim_days_to_expiry(pLIMLIC pLic)

Returns the number of days to expiration.

Parameters
pLic An instance of license object
Returns
An error code listed in Appendix A

◆ 
lim_delete_env()

PRECALL int STDCALL lim_delete_env(pLIMENV pEnv)

Deletes the specified LIMAN environment.

Parameters
pEnv An instance of LIMAN environment
Returns
An error code listed in Appendix A

◆ 
lim_delete_lic()

PRECALL int STDCALL lim_delete_lic(pLIMLIC pLic)

Deletes the specified license.

Parameters
pLic An instance of license object LIMLIC
Returns
An error code listed in Appendix A

◆ lim_exd_bstream()

PRECALL int STDCALL lim_exd_bstream(pLIMENV pEnv, char * pachBufferIn, int nBytesIn, char * pachBufferOut, int * pnBytesOut, int nDirection)

Encrypts or decrypts arbitrarily large byte-streams.

Parameters
pEnv An instance of LIMAN environment
pachBufferIn Input buffer
nBytesIn Length of input buffer
pachBufferOut Output buffer (should pre-allocated by the caller)
pnBytesOut A reference to an integer returning the length of output buffer
nDirection Flag to specify whether the call should perform an encryption or a decryption
Returns
An error code listed in Appendix A

◆ 
lim_free_env()

PRECALL int STDCALL lim_free_env(pLIMENV * ppEnv)

Destroys the specified LIMAN environment.

Parameters
ppEnv A reference to an instance of LIMAN environment LIMENV
Returns
An error code listed in Appendix A
Examples: 

limgen.climutil.c, and testapp.c.

◆ 
lim_free_lic()

PRECALL int STDCALL lim_free_lic(pLIMLIC * ppLic)

Destroys the specified license.

Parameters
ppLic A reference to LIMLIC instance
Returns
An error code listed in Appendix A
Examples: 

limgen.climutil.c, and testapp.c.

◆ 
lim_gen_keypair()

PRECALL int STDCALL lim_gen_keypair(int nKeySize, int nSeed, const char * szProductCode )

Generates an RSA key pair of specified size and writes them to files _private.key and _public.key respectively.

Parameters
nKeySize Size of RSA key
nSeed Seed to initialize random number generator
szProductCode Product id to tag the generated key files. If NULL, product code will be randomly generated. (Optional)
Returns
An error code listed in Appendix A
Examples: 

limgen.c, and limutil.c.

◆ 
lim_gen_keypair_ecp()

PRECALL int STDCALL lim_gen_keypair_ecp (int nKeySize, int nSeed)

Generates an RSA key pair of specified size and writes them to files usr_private.key and usr_public.key respectively.

Parameters
nKeySize An instance of LIMAN environment
nSeed Size of RSA key
Returns
An error code listed in Appendix A

◆ 
lim_gen_product_id()

PRECALL int STDCALL lim_gen_product_id (pLIMENV pEnv, int nSeed, char * szRandProductId)

Generates a random hexadecimal product code.

Parameters
pEnv An instance of LIMAN environment

nSeed Seed value to initialize the random-number-generator. Possible values are integers with the following behavior. >0: initialize with speficied value =0: initialize with a random value <0: do not initialize (assuming it was initialized previously)

szRandProductId Random UUID generated

Returns
An error code listed in Appendix A
Remarks
useful for generating serials seeding on user’s unique identifier (e.g. order number, etc.).

◆ 
lim_gen_rkey()

PRECALL int STDCALL lim_gen_rkey(pLIMENV pEnv, int nSeed, int nLen, int nBase, char * szRandKey)

Generates a random key of specified length.

Parameters
pEnv An instance of LIMAN environment

nSeed Seed value to initialize the random-number-generator. Possible values are integers with the following behavior. >0: initialize with speficied value =0: initialize with a random value <0: do not initialize (assuming it was initialized previously)

nLen Number of digits in the random key

nBase Base of random key. Possible values are 16 and 32. Default is 16.

szRandKey Random key generated

Returns
An error code listed in Appendix A
Remarks
useful for generating serials seeding on user’s unique identifier (e.g. order number, etc.).
Examples:
limgen.c.

◆ 
lim_gen_uuid()

PRECALL int STDCALL lim_gen_uuid(pLIMENV pEnv, int nSeed, char * szRandUUID)

Generates a new UUID (version 4) in non-canonical form, which is a series of 32 hexadecimal characters with no hyphens. In version 4, the 13’th character is ‘4’ and 17’th character is one of 8, 9, A, or B.

Parameters
pEnv An instance of LIMAN environment

nSeed Seed value to initialize the random-number-generator. Possible values are integers with the following behavior. >0: initialize with speficied value =0: initialize with a random value <0: do not initialize (assuming it was initialized previously)

szRandUUID Random UUID generated. It should have at least a size of 2*LIMPAR_MAX_LEN_UUID+1.

Returns
An error code listed in Appendix A
Remarks
useful for generating serials seeding on user’s unique identifier (e.g. order number, etc.).
Examples:
limgen.c, and limutil.c.

◆ 
lim_get_cpuid()

PRECALL int STDCALL lim_get_cpuid(char * szStr255)

Gets the cpu-id of current host.

Parameters
szStr255 A string buffer to return the cpu-id
Returns
An error code listed in Appendix A
Examples:
limutil.c.

◆ 
lim_get_dmiuuid()

PRECALL int STDCALL lim_get_dmiuuid(char * szDMIUUD)

Get the current dmiuuid on host.

Parameters
szDMIUUDA string buffer to return the dmiuuid
Returns
An error code listed in Appendix A

◆ 
lim_get_hash12()

PRECALL int STDCALL lim_get_hash12(const char * pachBuffer, int nBytesIn, char * szHash)

Gets 12-byte hash of input buffer.

Parameters
pachBuffer Input buffer
nBytesIn Length of input buffer
szHash 12-byte null terminated hash
Returns
An error code listed in Appendix A
Examples:
limgen.c.

◆ 
lim_get_hash16()

PRECALL int STDCALL lim_get_hash16(const char * pachBuffer, int nBytesIn, char * szHash)

Gets 16-byte hash of input buffer.

Parameters
pachBuffer Input buffer
nBytesIn Length of input buffer
szHash 16-byte null terminated hash
Returns
An error code listed in Appendix A

◆ 
lim_get_hash8()

PRECALL int STDCALL lim_get_hash8(const char * pachBuffer, int nBytesIn, char * szHash)

Gets 8-byte hash of input buffer.

Parameters
pachBuffer Input buffer
nBytesIn Length of input buffer
szHash 8-byte null terminated hash
Returns
An error code listed in Appendix A

◆ 
lim_get_hostid()

PRECALL int STDCALL lim_get_hostid(char * szStr255, int nHostIdMask)

Gets the hostid (fingerprint) of current host.

Parameters
szStr255 A string buffer to return the hostid
nHostIdMask An integer specifying the mask defining host identifier. Possible values are:

  • LIMPAR_MACID 1
  • LIMPAR_CPUID 2
  • LIMPAR_DISKID 4
  • LIMPAR_HOSTNAME 8
  • LIMPAR_USERID 16
  • LIMPAR_DMI 32

Default (0) implies LIMPAR_MACID.

Returns
An error code listed in Appendix A
Examples:
ahostid.climgen.c, and limutil.c.

◆ 
lim_get_keypair()

PRECALL int STDCALL lim_get_keypair(pLIMENV pEnv, char * szP, char * szQ, char * szN)

Gets key pairs in hex.

Parameters
pEnv An instance of LIMAN environment
szP Private key (part 1)
szQ Private key (part 2)
szN Public key
Returns
An error code listed in Appendix A

◆ 
lim_get_libsha()

PRECALL int STDCALL lim_get_libsha(pLIMENV pEnv, char * pachBufferOut)

Gets hash of library.

Parameters
pEnv An instance of LIMAN environment
pachBufferOut Digest buffer with size in bits greater than or equal to the key size used to initialize the given LIMAN environment.
Returns
An error code listed in Appendix A

◆ 
lim_get_lickey()

PRECALL char* STDCALL lim_get_lickey(pLIMLIC pLic)

Returns the license key parsed into a license instance.

Parameters
pLic An instance of license
Returns
License key

◆ 
lim_get_licsha()

PRECALL int STDCALL lim_get_licsha(pLIMLIC pLic, char * pachBufferOut)

Gets hash of license.

Parameters
pLic An instance of license object LIMLIC
pachBufferOut Digest buffer with size (in bytes) greater than or equal to the hash size used to initialize the given LIMAN environment.
Returns
An error code listed in Appendix A

◆ 
lim_get_macid()

PRECALL int STDCALL lim_get_macid(char * szStr255, int id)

Gets the MAC address of i'th device of current host.

Parameters
szStr255 A string buffer to return the MAC address
id device id requested. Possible values are 0,1,2,.. depending on the number of devices installed on the host
Returns
An error code listed in Appendix A
Examples:
limutil.c.

◆ 
lim_get_sha()

PRECALL int STDCALL lim_get_sha(const char * pachBufferIn, int nBytesIn, char * pachBufferOut, int nHashSize)

Gets sha/sha3 hash of input buffer.

Parameters
pachBufferIn Input buffer
nBytesIn Length of input buffer
pachBufferOut Digest buffer ‘nbits’ long
nHashSize Length of hash in bits. Possible values of 0,160,224,256(default),384,512.
Returns
An error code listed in Appendix A

◆ 
lim_get_userid()

PRECALL int STDCALL lim_get_userid(char * szUserId)

Get the current userid on host.

Parameters
szUserId A string buffer to return the userid
Returns
An error code listed in Appendix A
Examples:
limutil.c.

◆ 
lim_get_verkey()

PRECALL int STDCALL lim_get_verkey(int * pnMajor, int * pnMinor, int * pnRelease, int * pnRevision, char * szComment)

Get LIMAN SDK version identifiers.

Parameters
pnMajor LIMAN SDK major version
pnMinor LIMAN SDK minor version
pnRelease LIMAN SDK release identifier
pnRevision LIMAN SDK revision identifier
szComment LIMAN SDK build comment
Returns
An error code listed in Appendix A

◆ 
lim_get_verstr()

PRECALL int STDCALL lim_get_verstr(char* szComment)

Get version string.

Parameters
szComment A string buffer to return version string
Returns
An error code listed in Appendix A
Examples:
limgen.c, and limutil.c.

◆ 
lim_has_feature()

PRECALL int STDCALL lim_has_feature(pLIMLIC pLic, int idSlot, int mFeature)

Returns whether the specified feature is available in the given license.

Parameters
pLic An instance of license object
idSlot Slot identifier. Possible values are 0,…,3.
mFeature Feature bitmask
Returns
An error code listed in Appendix A
Examples:
testapp.c.

◆ 
lim_hash_file()

PRECALL int STDCALL lim_hash_file(const char* szFile, char* szHash, int nHashSize)

Calculate and get the base16 encoded hash of the bytes of the given file.

Parameters
szFile File to get the digest of
szHash Base16 encoded hash of the file
nHashSize Hash size in bits.
Returns
An error code listed in Appendix A
Examples:
limutil.c.

◆ 
lim_is_verified()

PRECALL int STDCALL lim_is_verified(pLIMLIC pLic)

Generates a flag indicating whether the license is valid or not.

Parameters
pLic An instance of license object
Returns
An error code listed in Appendix A
Examples:
limgen.c, and testapp.c.

◆ 
lim_keys_loaded()

PRECALL int STDCALL lim_keys_loaded(pLIMENV pEnv)

Returns a flag to specify if keys are loaded to LIMAN environment.

Parameters
pEnv An instance of LIMAN environment
Returns
0 (not loaded), 1 (loaded)

◆ 
lim_lic_id()

PRECALL char* STDCALL lim_lic_id(pLIMLIC pLic)

Returns the license identifier.

Parameters
pLic An instance of license object
Returns
an string identifier
Examples:
limgen.c, and testapp.c.

◆ 
lim_load_lic()

PRECALL int STDCALL lim_load_lic(pLIMLIC pLic, const char* szProductCode, int mPlatformId, int nMajorVersion, int nMinorVersion, int mSizeId, int mTypeId, int nUsers, int nExpiration, const char* pcFeatures, const char* szSerial, const char* szUUID, const char* szHost, const char* szUserid, int nHostIdMask)

Loads the specified license with specified properties. It is recommended to use symbolic constants to specify constant values as given in liman.h.

Parameters
pLic An instance of license object LIMLIC

szProductCode A null terminated string of at most LIMPAR_MAX_LEN_PRODUCTID characters specifying a unique product code. It could be associated with a barcode or a unique brand name or a model number.

mPlatformId An integer constant specifying the platform or architecture. Possible values are in the range of 0..255

nMajorVersion An integer constant specifying the product’s major version to be allowed with this license.Possible values are in the range of 0..255

nMinorVersion An integer constant specifying the product’s minor version to be allowed with this license. Possible values are in the range of 0..255

mSizeId An integer constant specifying the size of license (e.g. when the software’s capabilities are to be bound to data size. A typical example is when a database application is to process a certain number of records) Possible values are in the range of 0..255

mTypeId An integer constant specifying the type of license (e.g. educational, trial, commercial) Possible values are in the range of 0..255

nUsers An integer specifying the number of concurrent seats/users allowed by the license. Possible values are in the range of 0..2147483647

nExpiration An integer specifying the Expiry date of the license in YYYYMMDD format

pcFeatures A character array of LIMPAR_NUM_FEATURE_SLOTS elements where each element is to be used as a bitmask slot to specify a license option or feature.

szSerial A null terminated string of LIMPAR_MAX_LEN_SERIAL characters specifying the serial number (optional)

szUUID A null terminated string of 2*LIMPAR_MAX_LEN_UUID characters specifying the UUID of the product (optional)

szHost A null terminated string of LIMPAR_MAX_LEN_HOSTID characters specifying the hostid of the target machine (optional)

szUserid A null terminated string of LIMPAR_MAX_LEN_USERID characters specifying the userid of the user (optional)

nHostIdMask An integer specifying the bitmask to identify the host machine. Possible values are:

  • LIMPAR_MACID 1
  • LIMPAR_CPUID 2
  • LIMPAR_DISKID 4
  • LIMPAR_HOSTNAME 8
  • LIMPAR_USERID 16 Default (0) implies LIMPAR_MACID.
Returns
An error code listed in Appendix A
Examples:
limgen.c.

◆ 
lim_load_private_key()

PRECALL int STDCALL lim_load_private_key(pLIMENV pEnv, const char* szPrivateKeyP, const char* szPrivateKeyQ)

Loads the private key string to LIMAN environment.

Parameters
pEnv An instance of LIMAN environment
szPrivateKeyP Private key (part 1)
szPrivateKeyQ Private key (part 2)
Returns
An error code listed in Appendix A

◆ 
lim_load_public_key()

PRECALL int STDCALL lim_load_public_key(pLIMENV pEnv, const char* szPublicKey)

Loads the public key string to LIMAN environment.

Parameters
pEnv An instance of LIMAN environment
szPublicKey Public key
Examples:
limgen.c, and testapp.c.

lim_major_version()

PRECALL int STDCALL lim_major_version(pLIMLIC pLic)

Returns the major version associated with the license.

Parameters
pLic An instance of license object
Returns
an integer version number
Examples:
testapp.c.

lim_minor_version()

PRECALL int STDCALL lim_minor_version(pLIMLIC pLic)

Returns the minor version associated with the license.

Parameters
pLic An instance of license object
Returns
an integer version number
Examples:
testapp.c.

◆ 
lim_new_keypair()

PRECALL int STDCALL lim_new_keypair(pLIMENV pEnv, int nKeySize)

Loads a new RSA key pair of specified size to LIMAN environment.

Parameters
pEnv An instance of LIMAN environment
nKeySize Size of RSA key
Returns
An error code listed in Appendix A

◆ 
lim_parse_keypair()

PRECALL int STDCALL lim_parse_keypair(pLIMENV pEnv)

Parses the imported RSA key pair into the LIMAN environment.

Parameters
pEnv An instance of LIMAN environment
Returns
An error code listed in Appendix A

◆ 
lim_platform_id()

PRECALL int STDCALL lim_platform_id(pLIMLIC pLic)

Returns the platform identifier associated with the license.

Parameters
pLic An instance of license object
Returns
an integer platform identifier
Examples:
testapp.c.

◆ lim_print_lic()

PRECALL int STDCALL lim_print_lic(pLIMLIC pLic, char* strbuf)

Prints the license data to an output string buffer.

Parameters
pLic An instance of license object LIMLIC
strbuf A string buffer to dump the license data
Returns
An error code listed in Appendix A
Examples:
limgen.c.

◆ 
lim_product_id()

PRECALL const char* STDCALL lim_product_id(pLIMLIC pLic)

Returns the product code associated with the license.

Parameters
pLic An instance of license object
Returns
An error code listed in Appendix A
Examples:
testapp.c.

◆ 
lim_read_private_key()

PRECALL int STDCALL lim_read_private_key(pLIMENV pEnv, const char* szPrivateKeyFile)

Reads the private key from specified file.

Parameters
pEnv An instance of LIMAN environment
szPrivateKeyFile Private key file
Returns
An error code listed in Appendix A
Examples:
limgen.c.

◆ 
lim_read_public_key()

PRECALL int STDCALL lim_read_public_key(pLIMENV pEnv, const char* szPublicKeyFile)

Reads the public key from specified file.

Parameters
pEnv An instance of LIMAN environment
szPublicKeyFile Public key file
Returns
An error code listed in Appendix A
Examples:
limgen.c, and limutil.c.

◆ lim_set_licreq()

PRECALL int STDCALL lim_set_licreq(pLIMLIC pLic, int mPlatformId, char* szProductCode, int nMajorVersion, int nMinorVersion, int mSizeId, int mTypeId)

Sets license requirements.

Parameters
pLic An instance of license object

mPlatformId An integer specifying the platform or arhitecture

szProductCode An string specifying the product code

nMajorVersion An integer specifying the product’s major version to be allowed with this license.

nMinorVersion An integer specifying the product’s minor version to be allowed with this license.

mSizeId An integer specifying the size of license (e.g. when the software’s capabilities are to be bound to data size. A typical example is when a database application is to process a certain number of records)

mTypeId An integer specifying the type of license (e.g. educational, trial, commerical)

Returns
An error code listed in Appendix A

◆ lim_set_rsa_dir()

PRECALL int STDCALL lim_set_rsa_dir(pLIMENV pEnv, int nFlag)

Set the RSA encryption direction.

Parameters
pEnv An instance of LIMAN environment
nFlag A flag to identify the direction. Possible values are

  • 0 encrypt with private key, decrypt with public key
  • 1 encrypt with public key, decrypt with private key
Returns
An error code listed in Appendix A

◆ 
lim_sign_lic()

PRECALL int STDCALL lim_sign_lic(pLIMLIC pLic)

Sign the license.

Parameters
pLic An instance of license
Returns
An error code listed in Appendix A
Remarks
Also see lim_sign_lic

◆ 
lim_size_id()

PRECALL int STDCALL lim_size_id(pLIMLIC pLic)

Returns the size associated with the license.

Parameters
pLic An instance of license object
Returns
an integer size identifier
Examples:
testapp.c.

◆ lim_type_id()

PRECALL int STDCALL lim_type_id(pLIMLIC pLic)

Returns the type associated with the license.

Parameters
pLic An instance of license object
Returns
an integer type identifier
Examples:
testapp.c.

lim_veri_lic()

PRECALL int STDCALL lim_veri_lic(pLIMLIC pLic)

Verify the license data.

Parameters
pLic An instance of license
Returns
An error code listed in Appendix A
Remarks
Also see lim_sign_lic

◆ 
lim_write_keypair()

PRECALL int STDCALL lim_write_keypair(pLIMENV pEnv, const char* szPrivateKeyFile, const char* szPublicKeyFile)

Writes the RSA key pair associated with specified LIMAN environment.

Parameters
pEnv An instance of LIMAN environment
szPrivateKeyFile Private key file
szPublicKeyFile Public key file
Returns
An error code listed in Appendix A

◆ 
lim_write_keypair_carr()

PRECALL int STDCALL lim_write_keypair_carr(pLIMENV pEnv, const char* szPrivateKeyFile, const char* szPublicKeyFile)

Writes the RSA key pair associated with specified LIMAN environment as a C array.

Parameters
pEnv An instance of LIMAN environment
szPrivateKeyFile Private key C file
szPublicKeyFile Public key C file
Returns
An error code listed in Appendix A

◆ 
lim_write_lickey()

PRECALL int STDCALL lim_write_lickey(pLIMLIC pLic, const char* szKeyFile)

Writes the license key to specified file.

Parameters
pLic An instance of license object
szKeyFile Keyfile name
Returns
An error code listed in Appendix A
Examples:
limgen.c.

◆ 
lim_write_lickey_carr()

PRECALL int STDCALL lim_write_lickey_carr(pLIMLIC pLic, const char* szKeyFile)

Writes the license key as a C/C++ function into specified file.

Parameters
pLic An instance of license object
szKeyFile Keyfile name
Returns
An error code listed in Appendix A
Examples:
limgen.c.

◆ 
lim_write_secretmsg()

PRECALL int STDCALL lim_write_secretmsg (pLIMENV pEnv, const char* szPlainMsg, const char* szSecretMsgFile)

Write a secret message (encrypted with public key) to a file. This message can be decrypted with the associated private key.

Parameters
pEnv An instance of LIMAN environment
szPlainMsg Plain text message
szSecretMsgFile File to write the encrypted message
Returns
An error code listed in Appendix A
Remarks
Typical use is when the users of software protected by LIMAN need to send the software vendor a message in encrypted form. One common c Software vendor will use the private key to decrypt the message.
Examples:
limutil.c.

LIMAN Error Handling Functions

LIMAN Error Handling Functions. More…

Functions

PRECALL void STDCAL lim_set_lasterr (pLIMENV pEnv, int nErr)

Set the specified error as the last error (for debug purposes) More…

PRECALL int STDCALL lim_get_errmsg (pLIMENV pEnv, int nErrCode, char *szMessage)

Retrieves the error message associated with an error code listed in Appendix AMore…

PRECALL const char *STDCALL lim_errmsg (pLIMENV pEnv, int nErrCode)

Returns the error message associated with an error code listed in Appendix AMore…

PRECALL const char *STDCALL lim_errmacro (pLIMENV pEnv, int nErrCode)

Returns the macro symbol associated with an error code listed in Appendix AMore…

PRECALL const char *STDCALL lim_errctx (pLIMENV pEnv)

Returns the context of the last error thrown. More…

Detailed Description


LIMAN Error Handling Functions.

Function Documentation


◆ 
lim_errctx()

PRECALL const char* STDCALL lim_errctx(pLIMENV pEnv)

Returns the context of the last error thrown.

lim_errctx

Parameters
pEnv a reference to a LIMAN environment object.
Returns
szContext a reference to the string containing the error context.

◆ 
lim_errmacro()

PRECALL const char* STDCALL lim_errmacro(pLIMENV pEnv, int nErrCode)

Returns the macro symbol associated with an error code listed in Appendix A.

lim_errmacro

Parameters
pEnv a reference to a LIMAN environment object.
nErrCode an integer error code to retrieve the message for.
Returns
pMessage a reference to the macro symbol.
Examples:
limutil.c.

◆ 
lim_errmsg()

PRECALL const char* STDCALL lim_errmsg(pLIMENV pEnv, int nErrCode)

Returns the error message associated with an error code listed in Appendix A.

lim_errmsg

Parameters
pEnv a reference to a LIMAN environment object.
nErrCode an integer error code to retrieve the message for.
Returns
pMessage a reference to the error message listed in Appendix A.
Examples:
limgen.climutil.c, and testapp.c.

◆ 
lim_get_errmsg()

PRECALL int STDCALL lim_get_errmsg(pLIMENV pEnv, int nErrCode, char* szMessage)

Retrieves the error message associated with an error code listed in Appendix A.

lim_get_errmsg

Parameters
pEnv a reference to a LIMAN environment object.
nErrCode an integer error code to retrieve the message for.
szMessage a string buffer to retrive the error message into.
Returns
nErr an integer error code listed in Appendix A.

◆ 
lim_set_lasterr()

PRECALL void STDCALL lim_set_lasterr(pLIMENV pEnv, int nErr)

Set the specified error as the last error (for debug purposes)

Parameters
pEnv An instance of LIMAN environment
nErr An error code listed in Appendix A
Returns
void

Symbolic Constants

Modules

Host identifiers

List of host identifiers to create locked licenses.

Miscellenous constants

List of constants.

String lengths

List of string lengths for various data.

Error codes

Error codes in LIMAN SDK. See Appendix A for descriptions.

License properties

List of license properties.

Sample symbolic constants to set up a license

This is a list of symbolic constants provided in includeliman.h for grouping the input required to set up a license into sensible sets. The symbols and their values can be modified as the user sees fit or they could be ignored altogether because LIMAN SDK does not use them internally. These constants are intended to be used mainly with lim_load_lic() or when checking license properties (lim_platform_id()lim_product_id(), etc..)

Version constants

Version tags can be integer values in 0-255 range.


Host identifiers

Symbolic Constants


List of host identifiers to create locked licenses. More…

Macros

#define LIMPAR_MACID   1
#define LIMPAR_CPUID   2
#define LIMPAR_DISKID   4
#define LIMPAR_HOSTNAME   8
#define LIMPAR_USERID   16
#define LIMPAR_DMI   32

Detailed Description


List of host identifiers to create locked licenses.

Macro Definition Documentation


◆ 
LIMPAR_CPUID

#define LIMPAR_CPUID   2

CPU identifier

LIMPAR_DISKID

#define LIMPAR_DISKID   4

HardDisk identifier

◆ 
LIMPAR_DMI

#define LIMPAR_DMI   32

DMI identifier (Linux only)

◆ 
LIMPAR_HOSTNAME

#define LIMPAR_HOSTNAME   8

Hostname

Examples:
ahostid.c.

◆ 
LIMPAR_MACID

#define LIMPAR_MACID   1

MAC identifier

Examples:
ahostid.c.

◆ 
LIMPAR_USERID

#define LIMPAR_USERID   16

Username


Miscellenous constants

Symbolic Constants


List of constants. More…

Macros

#define LIMPAR_MAX_PATH   2048
#define LIMPAR_MAX_CHARS_PER_LINE   256
#define LIMPAR_MAX_LIC_STRING_LEN   4096
#define LIMPAR_NUMBER_OF_ERROR_CODES   52
#define LIMPAR_MAX_LENGTH_ERROR_MESSAGE   32
#define LIMPAR_NUM_FEATURE_SLOTS   4

Detailed Description


List of constants.

Macro Definition Documentation


◆ 
LIMPAR_MAX_CHARS_PER_LINE

#define LIMPAR_MAX_CHARS_PER_LINE   256

Max-allowable characters per line in text input files

◆ 
LIMPAR_MAX_LENGTH_ERROR_MESSAGE

#define LIMPAR_MAX_LENGTH_ERROR_MESSAGE   32

Max length of error messages

◆ 
LIMPAR_MAX_LIC_STRING_LEN

#define LIMPAR_MAX_LIC_STRING_LEN   4096

Max characters of license string

Examples:
limgen.c.

◆ 
LIMPAR_MAX_PATH

#define LIMPAR_MAX_PATH   2048

Max-allowable path length

Examples:
limgen.c, and limutil.c.

◆ 
LIMPAR_NUM_FEATURE_SLOTS

#define LIMPAR_NUM_FEATURE_SLOTS   4

Max number of feature slots

Examples:
limgen.c.

◆ 
LIMPAR_NUMBER_OF_ERROR_CODES

#define LIMPAR_NUMBER_OF_ERROR_CODES   52

Max number of error codes, see LIMERR_LAST_CARD


String lengths

Symbolic Constants


List of string lengths for various data. More…

Macros

#define LIMPAR_MAX_LEN_PRODUCTID   12
#define LIMPAR_MAX_LEN_UUID   16
#define LIMPAR_MAX_LEN_SERIAL   24
#define LIMPAR_MAX_LEN_HOSTID   12
#define LIMPAR_MAX_LEN_USERID   12
#define LIMPAR_MAX_LEN_LICID   16

Detailed Description


List of string lengths for various data.

Macro Definition Documentation


◆ 
LIMPAR_MAX_LEN_HOSTID

#define LIMPAR_MAX_LEN_HOSTID   12

The length of hostid string

Examples:
ahostid.climgen.c, and limutil.c.

◆ 
LIMPAR_MAX_LEN_LICID

#define LIMPAR_MAX_LEN_LICID   16

The length of license-id string

◆ 
LIMPAR_MAX_LEN_PRODUCTID

#define LIMPAR_MAX_LEN_PRODUCTID   12

Max allowable length of product-id

Examples:
limgen.c, and limutil.c.

◆ 
LIMPAR_MAX_LEN_SERIAL

#define LIMPAR_MAX_LEN_SERIAL   24

Max allowable length of serial string

Examples:
limgen.c.

◆ 
LIMPAR_MAX_LEN_USERID

#define LIMPAR_MAX_LEN_USERID   12

Max allowable length of hostid string

Examples:
limgen.c, and limutil.c.

◆ 
LIMPAR_MAX_LEN_UUID

#define LIMPAR_MAX_LEN_UUID   16

The length of UUID

Examples:
limgen.c, and limutil.c.

Error codes

Symbolic Constants


Error codes in LIMAN SDK. See Appendix A for descriptions. More…

Macros

#define LIM_OK   0
#define LIMERR_FIRST_CARD   1
#define LIMERR_MEMORY   2
#define LIMERR_FILE_NOT_FOUND   3
#define LIMERR_INVALID_NULL   4
#define LIMERR_INVALID_LICENSE   5
#define LIMERR_ENVAR_NOT_FOUND   6
#define LIMERR_LICENSE_EXPIRED   7
#define LIMERR_LICENSE_NOT_LOADED   8
#define LIMERR_INVALID_DOMAIN   9
#define LIMERR_INVALID_PRODUCT_CODE   10
#define LIMERR_INVALID_USER   11
#define LIMERR_INVALID_PRODUCT_VERSION   12
#define LIMERR_INVALID_PLATFORM   13
#define LIMERR_INVALID_ENVAR   14
#define LIMERR_INVALID_ENV   15
#define LIMERR_INVALID_INPUT   16
#define LIMERR_UNABLE_TO_OPEN_FILE   17
#define LIMERR_INVALID_LICENSE_FILE_NAME   18
#define LIMERR_OPERATION_FAILED   19
#define LIMERR_PRIVKEY_FILE_NOT_FOUND   20
#define LIMERR_PUBKEY_FILE_NOT_FOUND   21
#define LIMERR_NOT_SUPPORTED   22
#define LIMERR_INVALID_KEYLEN   23
#define LIMERR_NOT_AVAILABLE   24
#define LIMERR_INVALID_KEY   25
#define LIMERR_SHORT_KEY   26
#define LIMERR_BAD_ERRORCODE   27
#define LIMERR_INTERNAL   28
#define LIMERR_ENV_NOT_READY   29
#define LIMERR_ALREADY_LOADED   30
#define LIMERR_SYSTEM   31
#define LIMERR_CLOCK_SETBACK   32
#define LIMERR_INVALID_HOST   33
#define LIMERR_KEYS_NOT_LOADED   34
#define LIMERR_PRIVKEY_FILE_EXISTS   35
#define LIMERR_PUBKEY_FILE_EXISTS   36
#define LIMERR_KEYSIZE_MISMATCH_ENV   37
#define LIMERR_RANGE_TYPE_CODE   38
#define LIMERR_RANGE_PRODUCT_CODE   39
#define LIMERR_RANGE_MAJOR_VERSION   40
#define LIMERR_RANGE_MINOR_VERSION   41
#define LIMERR_RANGE_SIZE_CODE   42
#define LIMERR_RANGE_PLATFORM_CODE   43
#define LIMERR_INVALID_HOSTMASK   44
#define LIMERR_BUFFER_TOO_LONG   45
#define LIMERR_MKDIR_FAILED   46
#define LIMERR_PRIVKEY_NOT_LOADED   47
#define LIMERR_PUBKEY_NOT_LOADED   48
#define LIMERR_FILE_TOO_SMALL   49
#define LIMERR_FILE_IO   50
#define LIMERR_INPUT_TOO_BIG   51
#define LIMERR_LAST_CARD   52

Detailed Description


Error codes in LIMAN SDK. See Appendix A for descriptions.

Macro Definition Documentation


◆ 
LIM_OK

#define LIM_OK   0

No errors

Examples:
ahostid.climgen.climutil.c, and testapp.c.

◆ 
LIMERR_ALREADY_LOADED

#define LIMERR_ALREADY_LOADED   30

Specified object is already loaded

◆ 
LIMERR_BAD_ERRORCODE

#define LIMERR_BAD_ERRORCODE   27

Specified error code is invalid

LIMERR_BUFFER_TOO_LONG

#define LIMERR_BUFFER_TOO_LONG   45

Buffer is too long

◆ 
LIMERR_CLOCK_SETBACK

#define LIMERR_CLOCK_SETBACK   32

Clock setback detected

◆ 
LIMERR_ENV_NOT_READY

#define LIMERR_ENV_NOT_READY   29

LIMAN environment is not ready

◆ 
LIMERR_ENVAR_NOT_FOUND

#define LIMERR_ENVAR_NOT_FOUND   6

Specified environment variable is not found

◆ 
LIMERR_FILE_IO

#define LIMERR_FILE_IO   50

File I/O error

Examples:
limutil.c.

◆ 
LIMERR_FILE_NOT_FOUND

#define LIMERR_FILE_NOT_FOUND   3

Specified file was not found

◆ 
LIMERR_FILE_TOO_SMALL

#define LIMERR_FILE_TOO_SMALL   49

Specified file is too small

◆ 
LIMERR_FIRST_CARD

#define LIMERR_FIRST_CARD   1

Specified file was not found

Examples:
limutil.c.

◆ 
LIMERR_INPUT_TOO_BIG

#define LIMERR_INPUT_TOO_BIG   51

Specified input is too big

◆ 
LIMERR_INTERNAL

#define LIMERR_INTERNAL   28

An internal error has occurred. Contact your vendor

◆ 
LIMERR_INVALID_DOMAIN

#define LIMERR_INVALID_DOMAIN   9

Domain parameters are invalid

◆ 
LIMERR_INVALID_ENV

#define LIMERR_INVALID_ENV   15

Specified environment is invalid

◆ 
LIMERR_INVALID_ENVAR

#define LIMERR_INVALID_ENVAR   14

Specified environment variable is invalid

◆ 
LIMERR_INVALID_HOST

#define LIMERR_INVALID_HOST   33

Host is invalid or hardware has changed

◆ 
LIMERR_INVALID_HOSTMASK

#define LIMERR_INVALID_HOSTMASK   44

Host is invalid or hardware has changed

◆ 
LIMERR_INVALID_INPUT

#define LIMERR_INVALID_INPUT   16

Specified input is invalid

Examples:
limutil.c.

◆ 
LIMERR_INVALID_KEY

#define LIMERR_INVALID_KEY   25

Key under operation is invalid

◆ 
LIMERR_INVALID_KEYLEN

#define LIMERR_INVALID_KEYLEN   23

The key length is invalid

◆ 
LIMERR_INVALID_LICENSE

#define LIMERR_INVALID_LICENSE   5

Specified license is invalid

◆ 
LIMERR_INVALID_LICENSE_FILE_NAME

#define LIMERR_INVALID_LICENSE_FILE_NAME   18

Specified license file is invalid

◆ 
LIMERR_INVALID_NULL

#define LIMERR_INVALID_NULL   4

Specified reference is invalid or null

◆ 
LIMERR_INVALID_PLATFORM

#define LIMERR_INVALID_PLATFORM   13

Specified platform code is invalid for the given license

Examples:
testapp.c.

◆ 
LIMERR_INVALID_PRODUCT_CODE

#define LIMERR_INVALID_PRODUCT_CODE   10

Specified product code is invalid for the given license

Examples:
testapp.c.

◆ 
LIMERR_INVALID_PRODUCT_VERSION

#define LIMERR_INVALID_PRODUCT_VERSION   12

Specified product version is invalid for the given license

◆ 
LIMERR_INVALID_USER

#define LIMERR_INVALID_USER   11

Current user is invalid for the given license

◆ 
LIMERR_KEYS_NOT_LOADED

#define LIMERR_KEYS_NOT_LOADED   34

Private and Public keys are not loaded

◆ 
LIMERR_KEYSIZE_MISMATCH_ENV

#define LIMERR_KEYSIZE_MISMATCH_ENV   37

The size of specified key does not conform the environment

◆ 
LIMERR_LAST_CARD

#define LIMERR_LAST_CARD   52

Placeholder for last error

Examples:
limutil.c.

◆ 
LIMERR_LICENSE_EXPIRED

#define LIMERR_LICENSE_EXPIRED   7

License has expired

◆ 
LIMERR_LICENSE_NOT_LOADED

#define LIMERR_LICENSE_NOT_LOADED   812

License is not loaded

◆ 
LIMERR_MEMORY

#define LIMERR_MEMORY   2

Error in allocating memory

Examples:
limutil.c.

◆ 
LIMERR_MKDIR_FAILED

#define LIMERR_MKDIR_FAILED   46

Cannot create directory

◆ 
LIMERR_NOT_AVAILABLE

#define LIMERR_NOT_AVAILABLE   24

Requested information is not available

Examples:
limutil.c.

◆ 
LIMERR_NOT_SUPPORTED

#define LIMERR_NOT_SUPPORTED   22

Feature is not supported

◆ 
LIMERR_OPERATION_FAILED

#define LIMERR_OPERATION_FAILED   19

An internal crypto-operation has failed

◆ 
LIMERR_PRIVKEY_FILE_EXISTS

#define LIMERR_PRIVKEY_FILE_EXISTS   35

Private key file ‘usr_private.key’ already exists

◆ 
LIMERR_PRIVKEY_FILE_NOT_FOUND

#define LIMERR_PRIVKEY_FILE_NOT_FOUND   20

Private key file is not found

◆ 
LIMERR_PRIVKEY_NOT_LOADED

#define LIMERR_PRIVKEY_NOT_LOADED   47

Private key is not loaded

◆ 
LIMERR_PUBKEY_FILE_EXISTS

#define LIMERR_PUBKEY_FILE_EXISTS   36

Public key file ‘usr_public.key’ already exists

◆ 
LIMERR_PUBKEY_FILE_NOT_FOUND

#define LIMERR_PUBKEY_FILE_NOT_FOUND   21

Public key file is not found

◆ 
LIMERR_PUBKEY_NOT_LOADED

#define LIMERR_PUBKEY_NOT_LOADED   48

Public key is not loaded

◆ 
LIMERR_RANGE_MAJOR_VERSION

#define LIMERR_RANGE_MAJOR_VERSION   40

Specified major-version is out-of-range

◆ 
LIMERR_RANGE_MINOR_VERSION

#define LIMERR_RANGE_MINOR_VERSION   41

Specified minor-version is out-of-range

◆ 
LIMERR_RANGE_PLATFORM_CODE

#define LIMERR_RANGE_PLATFORM_CODE   43

Specified platform code is out-of-range.

◆ 
LIMERR_RANGE_PRODUCT_CODE

#define LIMERR_RANGE_PRODUCT_CODE   39

Specified product-code is out-of-range

◆ 
LIMERR_RANGE_SIZE_CODE

#define LIMERR_RANGE_SIZE_CODE   42

Specified size code is out-of-range

◆ 
LIMERR_RANGE_TYPE_CODE

#define LIMERR_RANGE_TYPE_CODE   38

Specified type-code is out-of-range

◆ 
LIMERR_SHORT_KEY

#define LIMERR_SHORT_KEY   26

Key under operation is too short

◆ 
LIMERR_SYSTEM

#define LIMERR_SYSTEM   31

Platform specific system error

◆ 
LIMERR_UNABLE_TO_OPEN_FILE

#define LIMERR_UNABLE_TO_OPEN_FILE   17

Failed to open specified file


License properties

Symbolic Constants


List of license properties. More…

Macros

#define LIMPAR_PLATFORM   101
#define LIMPAR_CODE   102
#define LIMPAR_MAJORVER   103
#define LIMPAR_MINORVER   104
#define LIMPAR_SIZE   105
#define LIMPAR_TYPE   106
#define LIMPAR_SEATS   107
#define LIMPAR_EXPIRY   108
#define LIMPAR_RESERVED   109
#define LIMPAR_FEATURE0   110
#define LIMPAR_FEATURE1   111
#define LIMPAR_FEATURE2   112
#define LIMPAR_FEATURE3   113
#define LIMPAR_SERIAL   114
#define LIMPAR_USERINFO   115
#define LIMPAR_HOSTID   116

Detailed Description


List of license properties.

Macro Definition Documentation


◆ 
LIMPAR_CODE

#define LIMPAR_CODE   102

Reserved

◆ 
LIMPAR_EXPIRY

#define LIMPAR_EXPIRY   108

License expiry date in YYYYMMDD format

◆ 
LIMPAR_FEATURE0

#define LIMPAR_FEATURE0   110

License feature-0 bitmask

◆ 
LIMPAR_FEATURE1

#define LIMPAR_FEATURE1   111

License feature-1 bitmask

◆ 
LIMPAR_FEATURE2

#define LIMPAR_FEATURE2   112

License feature-2 bitmask

LIMPAR_FEATURE3

#define LIMPAR_FEATURE3   113

License feature-3 bitmask

◆ 
LIMERR_UNABLE_TO_OPEN_FILE

#define LIMERR_UNABLE_TO_OPEN_FILE   17

Failed to open specified file

◆ 
LIMPAR_HOSTID

#define LIMPAR_HOSTID   116

License hostid

◆ 
LIMPAR_MAJORVER

#define LIMPAR_MAJORVER   103

License Major version

◆ 
LIMPAR_MINORVER

#define LIMPAR_MINORVER   104

License Minor version

◆ 
LIMPAR_PLATFORM

#define LIMPAR_PLATFORM   101

License Platform identifier

◆ 
LIMPAR_RESERVED

#define LIMPAR_RESERVED   109

Reserved

◆ 
LIMPAR_SEATS

#define LIMPAR_SEATS   107

License max-seats

◆ 
LIMPAR_SERIAL

#define LIMPAR_SERIAL   114

License serial string

◆ 
LIMPAR_SIZE

#define LIMPAR_SIZE   105

License Size identifier

◆ 
LIMPAR_TYPE

#define LIMPAR_TYPE   106

License Type identifier

◆ 
LIMPAR_USERINFO

#define LIMPAR_USERINFO   115

License user identifier

Sample symbolic constants to set up a license

Symbolic Constants


This is a list of symbolic constants provided in includeliman.h for grouping the input required to set up a license into sensible sets. The symbols and their values can be modified as the user sees fit or they could be ignored altogether because LIMAN SDK does not use them internally. These constants are intended to be used mainly with lim_load_lic() or when checking license properties (lim_platform_id()lim_product_id(), etc..) More…

Modules

Version constants

Version tags can be integer values in 0-255 range.

Platform constants

Platform identifiers can be integer values in 0-255 range.

License-size constants

Size constant can be integer values in 0-255 range.

License-type constants

License type can be integer values in 0-255 range.

Feature bitmasks

Each feature slot can take integer values in 0-255 range enabling/disabling a subset of 8 features.

Detailed Description


List of license properties.

This is a list of symbolic constants provided in includeliman.h for grouping the input required to set up a license into sensible sets. The symbols and their values can be modified as the user sees fit or they could be ignored altogether because LIMAN SDK does not use them internally. These constants are intended to be used mainly with lim_load_lic() or when checking license properties (lim_platform_id()lim_product_id(), etc..)


Version constants

Symbolic ConstantsSymbolic Constants » | Sample symbolic constants to set up a license


Version tags can be integer values in 0-255 range. More…

Macros

#define LIMPROD_MAJOR_VER   1
#define LIMPROD_MINOR_VER   0

Detailed Description


Version tags can be integer values in 0-255 range.

Macro Definition Documentation


◆ 
LIMPROD_MAJOR_VER

#define LIMPROD_MAJOR_VER   1

Placeholder reserved for optional product version

◆ 
LIMPROD_MINOR_VER

#define LIMPROD_MINOR_VER   0

Placeholder reserved for optional product version

Platform constants

Symbolic Constants » Sample symbolic constants to set up a license


Platform identifiers can be integer values in 0-255 range. More…

Macros

#define LIMPLAT_WIN32X86   1
#define LIMPLAT_LNX32X86   2
#define LIMPLAT_OSX32X86   3
#define LIMPLAT_SOL32X86   4
#define LIMPLAT_SSPARK32   5
#define LIMPLAT_WIN64X86   6
#define LIMPLAT_LNX64X86   7
#define LIMPLAT_OSX64X86   8
#define LIMPLAT_SOL64X86   9
#define LIMPLAT_SSPARK64   10
#define LIMPLAT_MINGW32   11
#define LIMPLAT_MINGW64   12

Detailed Description


Platform identifiers can be integer values in 0-255 range.

Macro Definition Documentation


◆ 
LIMPLAT_LNX32X86

#define LIMPLAT_LNX32X86   2

Identifies 32-bit Linux operating system on x86 architecture

◆ 
LIMPLAT_LNX64X86

#define LIMPLAT_LNX64X86   7

Identifies 64-bit Linux operating system on x86_64 architecture

◆ 
LIMPLAT_MINGW32

#define LIMPLAT_MINGW32   11

Identifies 32-bit MinGW toolchain for x86 architecture

◆ 
LIMPLAT_MINGW64

#define LIMPLAT_MINGW64   12

Identifies 64-bit MinGW toolchain for x64 architecture

◆ 
LIMPLAT_OSX32X86

#define LIMPLAT_OSX32X86   3

Identifies 32-bit OSX operating system on x86 architecture

◆ 
LIMPLAT_OSX64X86

#define LIMPLAT_OSX64X86   8

Identifies 64-bit OSX operating system on x86_64 architecture

◆ 
LIMPLAT_SOL32X86

#define LIMPLAT_SOL32X86   4

Identifies 32-bit Solaris operating system on x86 architecture

◆ 
LIMPLAT_SOL64X86

#define LIMPLAT_SOL64X86   9

Identifies 64-bit Solaris operating system on x86_64 architecture

◆ 
LIMPLAT_SSPARK32

#define LIMPLAT_SSPARK32   5

Identifies 32-bit Solaris operating system on sparc architecture

◆ 
LIMPLAT_SSPARK64

#define LIMPLAT_SSPARK64   10

Identifies 64-bit Solaris operating system on sparc architecture

◆ 
LIMPLAT_WIN32X86

#define LIMPLAT_WIN32X86   1

Identifies 32-bit Windows operating system on x86 architecture

Example:

limgen.c, and testapp.c.

◆ 
LIMPLAT_WIN64X86

#define LIMPLAT_WIN64X86   6

Identifies 64-bit Window operating system on x86_64 architecture

License-size constants

Symbolic Constants » Sample symbolic constants to set up a license


Size constant can be integer values in 0-255 range. More…

Macros

#define LIMSIZE_DEMO   101
#define LIMSIZE_STANDARD   102
#define LIMSIZE_EXTENDED   103

Detailed Description


Size constant can be integer values in 0-255 range.

Macro Definition Documentation


◆ 
LIMSIZE_DEMO

#define LIMSIZE_DEMO   101

Identifies a demo/trial license

Example:

testapp.c.

◆ 
LIMSIZE_EXTENDED

#define LIMSIZE_EXTENDED   103

Identifies a extended license

◆ 
LIMSIZE_STANDARD

#define LIMSIZE_STANDARD   102

Identifies a standard license

Example:

limgen.c.


License-type constants

Symbolic Constants » Sample symbolic constants to set up a license


License type can be integer values in 0-255 range. More…

Macros

#define LIMTYPE_EDUCATIONAL   111
#define LIMTYPE_COMMERCIAL   112
#define LIMTYPE_DEVELOPMENT   113

Detailed Description


License type can be integer values in 0-255 range.

Macro Definition Documentation


◆ 
LIMTYPE_COMMERCIAL

#define LIMTYPE_COMMERCIAL   112

Identifies an commercial license

◆ 
LIMTYPE_DEVELOPMENT

#define LIMTYPE_DEVELOPMENT   113

Identifies an development license

Example:

limgen.c.

◆ 
LIMTYPE_EDUCATIONAL

#define LIMTYPE_EDUCATIONAL   111

Identifies an educational license

Example:

testapp.c.


Feature bitmasks

Symbolic Constants » Sample symbolic constants to set up a license


Each feature slot can take integer values in 0-255 range enabling/disabling a subset of 8 features. More…

Macros

#define LIMOPT_FEATURE_0   1
#define LIMOPT_FEATURE_1   2
#define LIMOPT_FEATURE_2   4
#define LIMOPT_FEATURE_3   8
#define LIMOPT_FEATURE_4   16
#define LIMOPT_FEATURE_5   32
#define LIMOPT_FEATURE_6   64
#define LIMOPT_FEATURE_7   128

Detailed Description


Each feature slot can take integer values in 0-255 range enabling/disabling a subset of 8 features.

Macro Definition Documentation


◆ 
LIMOPT_FEATURE_0

#define LIMOPT_FEATURE_0   1

Bitmask value associated with feature 0 (1’st bit)

Example:

limgen.c, and testapp.c.

◆ 
LIMOPT_FEATURE_1

#define LIMOPT_FEATURE_1   2

Bitmask value associated with feature 1 (2’nd bit)

Example:

limgen.c, and testapp.c.

◆ 
LIMOPT_FEATURE_2

#define LIMOPT_FEATURE_2   4

Bitmask value associated with feature 2 (3’rd bit)

Example:

limgen.c, and testapp.c.

◆ 
LIMOPT_FEATURE_3

#define LIMOPT_FEATURE_3   8

Bitmask value associated with feature 3 (4’th bit)

Example:

testapp.c.

◆ 
LIMOPT_FEATURE_4

#define LIMOPT_FEATURE_4   16

Bitmask value associated with feature 4 (5’th bit)

Example:

testapp.c.

◆ 
LIMOPT_FEATURE_5

#define LIMOPT_FEATURE_5   32

Bitmask value associated with feature 5 (6’th bit)

Example:

limgen.c, and testapp.c.

◆ 
LIMOPT_FEATURE_6

#define LIMOPT_FEATURE_6   64

Bitmask value associated with feature 6 (7’th bit)

Example:

limgen.c, and testapp.c.

◆ 
LIMOPT_FEATURE_7

#define LIMOPT_FEATURE_7   128

Bitmask value associated with feature 7 (8’th bit)

Example:

limgen.c, and testapp.c.

Examples


Here is a list of all examples:

ahostid.c


This is a utility application to compute the hostid of current host based on specified hardware identifiers.

Copy to Clipboard

limgen.c


This is a utility application to generate and verify license keys with specified options and features.

Copy to Clipboard

limutil.c


This is a utility application to perform various tasks with LIMAN SDK:

  • Generate keypairs
  • Determine hardware and users features (macid,userid,cpuid,etc..)
  • Calculate hash of input data (files or strings)
  • Hide small data in BMP (bitmap) files.
  • UUID generation
Copy to Clipboard

testapp.c


This is a test application illustrating how to integrate LIMAN SDK to your software to protect it with license keys you generate with ‘limgen’ or a derivative of it.It is also illustrated how license-features can be used to let you impose license-based restrictions on certain capabilities of your software.

Copy to Clipboard

testapp.java


This is a test application illustrating how to integrate LIMAN SDK to your software to protect it with license keys you generate with ‘limgen’ or a derivative of it.It is also illustrated how license-features can be used to let you impose license-based restrictions on certain capabilities of your software.

Copy to Clipboard

limgen.lua


Copy to Clipboard

limutil.lua


Copy to Clipboard