Getting Started
Start by downloading the LIMAN SDK installation file specific to your platform from ourdownload site.
The names of LIMAN SDK installation files are tagged with platform and version identifiers. For example, the download file for LIMAN SDK 1.2 for linux64x86
platform is named liman_core-1.2-linux64x86.tar.gz
.
The installation file is a compressed tarball containing the core LIMAN library lib/<platform>/libliman_core.a
, C/C++ headers, makefiles, utility apps and various examples for different programming languages.
Before LIMAN SDK could be used for license protection, the core library should be elevated by adding two specific components.
-
an RSA public key, which has to be generated for each product (and typically for each version)
-
a LIMAN SDK license key, which could be obtained via
Try or Buy links
We consider a dummy product called TESTAPP
, which we would like to add license protection. Follow these steps to build the product-specific LIMAN SDK library for it. It is assumed that you already obtained your LIMAN SDK license key
Note
In this illustration, a 64-bit Linux installation is considered. For other platforms, the steps would be identical except that the name of the installation file will be different.-
Locate
liman_core-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:$ cp liman_core-x.y-linux64x86.tar.gz /opt
-
Change working directory to
/opt
and decompressliman_core-x.y-linux64x86.tar.gz
usingtar -xzvf
command. This will create the root LIMAN SDK directoryliman_core-x.y
under/opt
.$ tar -xzvf liman_core-x.y-linux64x86.tar.gz
-
Set the environment variable LIMAN_ROOT to point to the installation directory and update system path
$ export LIMAN_ROOT=/opt/liman_core-x.y $ export PATH=$PATH:$LIMAN_ROOT/bin:$LIMAN_ROOT/lib/linux64x86
Note
To execute these lines automatically at logon, append them to the end of your startup script (.bashrc
or.bash_profile
for bash shell). Alternatively, update$LIMAN_ROOT/bin/limsetenv.sh
script with these lines and have your startup script (.bashrc
or.bash_profile
) source from that file with the following linesource $LIMAN_ROOT/bin/limsetenv.sh
-
Save the license file you obtained from
baroks.com
as$LIMAN_ROOT/license/usr_liman_lic.c
$ cp ~/Downloads/usr_XXXXXXXX_lic.c $LIMAN_ROOT/license/usr_liman_lic.c
-
Change working directory to
$LIMAN_ROOT/lib/linux64x86
.$ cd $LIMAN_ROOT/lib/linux64x86
-
Build LIMAN SDK framework with the following command
$ make
This step will link the core library
lib/linux64x86/libliman_core.a
against your license-file$LIMAN_ROOT/license/usr_liman_lic.c
and create a licensed version LIMAN SDK. This library will be namedlib/linux64x86/libliman_sdk.a
.At a minimal, this is the library your app will link against to be license protected. In this minimal setting, the public RSA key will have to be hardcoded to your application as a constant hexadecimal string. See the discussion on
<product>_public.key
below.Note
The preferred way to incorporate the public RSA key is through compiling<product>_public.c
and linking it againstlib/linux64x86/libliman_sdk.a
thereby creating a product-specific versionlib/linux64x86/libliman_<product>sdk.a
. This is shown in the following.Another output of the
make
step is the command line utilitylimutil
. Its purpose is to generate and manage product-license-bases. A product-license-base is a set of files and attributes associated with the product you want to protect with LIMAN SDK. 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 public-key (asymmetric) cryptography method to be used. Default is RSA encryption.
- A private and public keypair of specified size associated with the product. Default key size is 2048.
To see its usage, type
$ limutil --help
to display the list of available command-line options.
Liman Version 1.1.1.156 (Linux64x86 Release Build) Usage: limutil [options] -H, --host=MASK Display host id w.r.t specified mask (MASK & 1) - cpuid (MASK & 2) - diskid (MASK & 4) - hostname (MASK & 8) - userid (MASK & 16) - dmi/wmic (Linux only) (MASK & 32) - MACid (1st) (MASK & 64) - MACid_2 (2st) (MASK & 128) - MACid_3 (3rd) (MASK & 256) - MACid_4 (4th) -M, --mac=INDEX Display the id of the INDEX'th mac adapter. INDEX=0..N -u, --user Display user id for current user -k, --keysize=KEYSIZE Specify keysize -s, --seed=SEED Specify seed if reproducibility of keys is required -C, --cpu Display cpu id -g, --genkey Generate a random product-id and a keypair -P, --product=PRODUCT Designate a product-id for the generated keypair -a, --hashkey=HASHKEY Hash value of key -U, --pubkeyfile=PUBKEYF Public key file -I, --privkeyfile=PRIVKEYF Private key file -S, --sysinfo=SYSINFO Generate encrypted system info to be sent to vendor -e, --errlist Error list -h, --help Usage instrucations Example: $ limutil --genkey --keysize=2048 --seed=911 Generates a random product-id using seed value 911 and generates a keypair of size 2048-bits associated with this product. $ limutil --genkey --keysize=1024 --product=ABCDEF01 Creates a product-id 'ABCDEF01' and generates a keypair of size 1024-bits associated with this product. Remark: Generated keys are written into the folder specified by the 'product-id'
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 secure by US-NIST until the year 2030.
$ limutil --genkey --keysize=2048 --product=TESTAPP Product-id is 'TESTAPP'. Written private key in TESTAPP/TESTAPP_private.key. Written public key in TESTAPP/TESTAPP_public.key. Written private key as C/C++ code in TESTAPP/TESTAPP_private_key.c. Written public key as C/C++ code in TESTAPP/TESTAPP_public_key.c.
This command will create a product-license-base named
TESTAPP
and put its keypair within subfolderTESTAPP
. This folder will contain four key files in it.$ ls -la ./TESTAPP -rw-r--r-- 1 mka None 516 Jul 20 02:02 TESTAPP_private.key -rw-r--r-- 1 mka None 3.0K Jul 20 02:02 TESTAPP_private_key.c -rw-r--r-- 1 mka None 514 Jul 20 02:02 TESTAPP_public.key -rw-r--r-- 1 mka None 2.8K Jul 20 02:02 TESTAPP_public_key.c
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 the component to be embedded in the product-specific LIMAN library. This is the preferred alternative to hardcoding its hexadecimal counterpart as a string into your app.The file
TESTAPP_private*.*
files will continue to live outsideTESTAPP
application and will be used by only the license generator (See License Generation section). - A string of at most 12 characters that uniquely identifies a product. This could be specified by the user or be generated randomly by
-
The final step is to build product-specific LIMAN SDK
libliman_TESTAPP_sdk.a
and linkTESTAPP
against it.$ make library PRODUCT=TESTAPP
Note
For housekeeping purposes,
libliman_<
is placed inproduct>_sdk.a
lib/<
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 rebuildplatform>/<
product>
libliman_<
with a new keypair. It is recommended to use different keypairs for different products or different versions of the same product.product>_sdk.a