Xlt

  • Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
XLight Library Documentation

This is the documentation of the APIs for the communication between the host computer and the XLight device.

At present XLight offers API only for Windows operating system. No driver installation is needed.

The libraries are supplied in dll and obj format.

  • Dlls (oxyxlt.dll, 32 and 64 bit) are usable by any application which can be interfaced with DLLs.
  • OBJs (oxyxlt.obj, 32 and 64 bit) can be integrated into "Microsoft Visual Studio 2008" C, C++ projects.

The interfaces supplied by the libraries (both dll and obj) are declered inside the file xlt.h and this documentation describes such interfaces.

Advanced topics

Read the following topics on Advanced XLight protection

  • Locked Memory
  • Asymmetric cryptography on XLight (RSA)
  • AES Session Keys
  • XLight SD
  • Timer and Counters
  • Date based licensing


  • Data Structures
  • Files
Related Pages
Here is a list of all related documentation pages:
  • Locked Memory
  • Asymmetric cryptography on XLight (RSA)
  • AES Session Keys
  • XLight SD
  • Timer and Counters
  • Date based licensing
  • Deprecated List


Locked Memory

Introduction

The locking mechanism is an advanced feature of XLight, hence it is not necessary to use it in order to protect applications, it just offers some features for remote read\write operation mainly useful for license management.

From XLight release 1.01 a second locking function was introduced, it is named Lock2 and it offers a security improvement of the original feature. If it is necessary to manage XLight devices also of version 1.0 its better to continue to use the original locking mechanism, otherwise Lock2 is to be preferred.

For the user point of view the two locking features work in the same way, hence in the following presentation it will be discussed only the original one, just keep in mind that Lock2 requires the usage of following functions:

  • xlt_bank_lock2() instead of xlt_bank_lock(),
  • xlt_set_write_locked2_serial_check() instead of xlt_set_write_locked_serial_check(),
  • xlt_set_write_locked2_group_check() instead of xlt_set_write_locked_group_check(),
  • xlt_decrypt_locked2_data() instead of xlt_decrypt_locked_data().

XLight APIs gives the developer the chance to set some memory banks to be writable only using encrypted command. Such memory banks are defined locked banks. A locked bank can be written only following a procedure involving the Dongle Key (set up with xlt_setup()). Though a locked bank can be written only with the special command xlt_write_locked() and no longer writable with the xlt_write(), it is still possible read its content in the usual way with xlt_read(). Using the function xlt_read_locked() it is also possible to read the memory in an encrypted form.

In order to explain how it works let's introduce the two parties involved in locked bank management: the supplier, that is the person or company furnishing the application protected with XLight, and the client, the final user of the application. The supplier own the right to access and work on the device, while the client just has to plug the XLight device into the PC to gain access to the protected application and nothing else he is allowed to do with the device.

The aim of locked banks is to give the supplier a way to manage the memory of a device owned by his client, simply exchanging data. Such data are encrypted and have no meaning for the client.

Remarks:
in other way the locked bank functions establish a secure and encrypted channel between the device owned by the client and the supplier who programmed it.

The remote memory management of locked banks allows the supplier to manage some sort of license info modifying the content of data that are normally used by the protected application. The protected application may have different behaviors depending on what it reads on the device: for example allowing the usage of certain modules or not.

Note:
there is a fundamental difference between usual access to data by the protected application and by remote communication: the access to the data by the protected application sooner or later will put in some clear form the information from the dongle because some procedure needs them. A hacker with could get such information with due effort (even if it could be not enough to crack the protection). Using the remote communication the data in clear form will be present only at supplier side. For this reason the program to manage remote read\write can be very easy because no secret is contained in it. This fact makes the remote memory access a safe procedure.

Clearly such remote memory management requires some sort of collaboration by the client on which we can't rely on. That's why the remote update must be designed to compel such collaboration: for instance, it is always possible to force an update at the next software release if the protected program checks a new release number inside a locked bank. If the release is absent or not up to date the program quits. In this way the update becomes compulsory.

Remarks:
we want to stress the fact that the license management mechanism is not ready to use, but it must be managed by the supplier using the locked memory functions, which gives a general purpose remote memory management.

Locked and frozen memory

A frozen memory bank can be read in the usual way, but it can be written at all. The content is frozen for ever, while, as we have seen, locked memory is still writable following a given procedure.

It is possible to freeze a normal bank and a locked bank as well. After the freeze a locked bank can't be updated any longer, but it is still possible perform a remote read operation.

A frozen memory bank can't be locked, and of course, it can't return to the normal bank read\write state.

Locking a memory bank

As we said remote read\write can be applied only to locked banks. In order to lock a bank the function xlt_bank_lock() must be used. The xlt_bank_lock() function requires the password (set during the setup of the device with xlt_setup()) and the group number.

The group number is a number assigned by the supplier to groups of devices. Such groups may reflect any sort o logical subdivision of the clients, for instance: geographical placement, purchased product, kind of assistance to be granted and so on.

Note:
if there is no need to group the customers it is strongly recommended to set a unique value, say '0', for all.

Separating clients in groups allows the supplier to issue a single write command that can be applied on every device sharing the same group number. If all the devices were set up with the same group number it will be possible update all the devices creating a single encrypted string.

On the other hand it is possible to issue a command addressed to a single device regardless its group number using its serial number.

These are the two different techniques for remote update and will be shown later.

Example of the locking of the memory bank number 0 assigning the group number 618.
#include <stdio.h>
#include "xlt.h"

...
        int status = 0;
        unsigned int device = 0;
        unsigned char password[XLT_PASSWORD_SIZE];

        //dummy value, don't use values like this!
        strcpy((char*)password, "My password");
        memset(password + strlen("My password"), 0x00, sizeof(password) - strlen("My password"));

        // the group assigned to the bank 0 of the device is 618
        status = xlt_bank_lock(0, password, 0, 618);
        if (status != XLT_ERROR_SUCCESS)
                printf("An error has occurred during the lock procedure of the bank 0\n");
...

Locked Memory usage

Herein it is shown an example containing all the functions related to locked memory management (except xlt_bank_lock() previously shown): this example performs a remote read, then compute the new value for the bank, issues data instructing the remote update, and finally makes the memory update.

The example is divided in three steps:

  1. On client side, it reads a locked memory bank of the plugged device and sends the collected data to the supplier.
  2. On supplier side, decrypts data and gets the memory content, computes the new value for the bank, encrypts and sends it to the client.
  3. On client side writes the encrypted data onto the plugged device. The data will be decrypted by the device itself.

This three steps procedure requires the use of at least two software modules: the client side that physically reads and writes on the device, and the server side, used by the supplier, that computes the encrypted commands that the client must run, but for simplicity the example is run by a single function acting as client and server.

The remote update can be issued for a specific device (using xlt_set_write_locked_serial_check()) or for a set of devices sharing the same group number using the (xlt_set_write_locked_group_check())

Note:
both xlt_set_write_locked_serial_check() and xlt_set_write_locked_group_check() require the new_counter entry. The memory can be updated only if the passed counter is higher than the current value. In case of updating of a single device this requirement can be easily accomplished by passing the current retrieved counter plus 1, 2 or more. It's a bit harder issuing a command for a group of devices, because the counter must be greater of all the counters of the devices.

It is up to the supplier manage this point, but there is at least one case that can be easily managed when the counter represent a release of the protected software. When a new version is distributed it is impossible that some device contains a number (i.e. a release) greater than the latest release number, hence using the release as the counter the update will work on all devices.

Before the code of the example we want to remind two additional points that may help when dealing with remote update:

  • on server side no use of XLight devices are requested.
  • after the remote update is applied it is impossible to apply the same update command again, and an error is returned.
Example of the remote update of a locked bank.
#include <stdio.h>
#include <string.h>
#include "xlt.h"

static int remote_read_locked_data(unsigned char* transfer_locked_data, unsigned int transfer_locked_data_size);
static int remote_update(const unsigned char* transfer_locked_data, unsigned int transfer_locked_data_size);
static int ServerManageLockedMemory(const unsigned char* transfer_locked_data_in, unsigned int transfer_locked_data_in_length, int use_sn,
                                                         unsigned char* transfer_locked_data_out, unsigned int transfer_locked_data_out_size);

//Sketch of a possible secure read write operation performed onto an XLight device plugged in a remote PC.
//The operation is driven by an endpoint, that we call server, instructing a remote PC that has a XLight device plugged in it.
//for simplicity here there is no server client tasks, we just introduce comment saying what should run at server and client side in a real application.
//The procedure can be considered secure for the following reasons:
//1) the task can be performed only if the server side decide to write into the memory.
//2) The operation is instructed by an encrypted buffer and can be run only once.
//3) If the buffer is not used to write the memory it can't be re-used after a successive write operation.
//4) The read and write operations use and return encrypted data that can be understood only by the server.
// In addition:
//The server can do this remote update only onto locked banks.
//This operation is based on the cryptographic key <i>Dongle Key</i>.
//This key should never appear into the code protected by XLight, encryption and decryption of data can be done without restriction but it's not
//a good idea using this crypto key directly into the code.
//As we show in other examples the cryptographic key <i>Challenge Response Key</i> is suggested to be used inside the protected code.

// use_sn set to 1 makes the update for the device with a given serial number (retrieved when reading the memory bank of the remote device)
// use_sn set to 0 makes the update for the devices sharing the same group number.
//return 0 on success, a negative value on error
int test_update_locked_bank(int use_sn)
{

        unsigned char transfer_locked_data_from_device[XLT_LOCKED_TRANSFER_DATA];
        unsigned char transfer_locked_data_to_device[XLT_LOCKED_TRANSFER_DATA];
        int status;

        //THE FOLLOWING FUNCTION MUST BE RUN ONTO THE REMOTE PC (client side)
        status = remote_read_locked_data(transfer_locked_data_from_device, sizeof(transfer_locked_data_from_device));
        if (status != 0){
                printf("ERROR running remote_read_locked_data()\n");
                return -1;
        }

        // send transfer_locked_data_from_device to the server
        //...

        //THE FOLLOWING CODE MUST BE RUN ONTO THE SERVER SIDE (it uses the secret key 'Dongle Key', and no XLight device is accessed)
        if ( ServerManageLockedMemory(transfer_locked_data_from_device, sizeof(transfer_locked_data_from_device), use_sn,
                                                         transfer_locked_data_to_device, sizeof(transfer_locked_data_to_device)) != 0)
                return -1;

        // send transfer_locked_data_to_device to the client
        //...

        //THE FOLLOWING FUNCTION MUST BE RUN ONTO THE REMOTE PC (client side)
        status = remote_update(transfer_locked_data_to_device, sizeof(transfer_locked_data_to_device));
        if (status == 0)
                printf("Remote locked memory update correctly done!\n");
        else {
                printf("ERROR running remote_update()\n");
                return -1;
        }
        return 0;
}

// return 0 on success, -1 on error
// function to be run onto the PC where the device is plugged in.
// note that neither label nor password is requested.
// keep in mind that the returned data is encrypted with the 'Dongle Key' that in general is not contained by any protected program.
static int remote_read_locked_data(unsigned char* transfer_locked_data, unsigned int transfer_locked_data_size)
{
        if (transfer_locked_data_size != XLT_LOCKED_TRANSFER_DATA)
                return -1;//

        // the device is inserted into logic port 0, and the bank 0 is supposed to be locked, if this is not the case
        // the function will fail
        if( xlt_read_locked(0, 0, transfer_locked_data) != XLT_ERROR_SUCCESS)
                return -1;
        return 0;
}

// return 0 on success, -1 on error
// function to be run onto the PC where the device is plugged in.
// note that neither label nor password is requested.
static int remote_update(const unsigned char* transfer_locked_data, unsigned int transfer_locked_data_size)
{
        int status;
        if (transfer_locked_data_size !=  XLT_LOCKED_TRANSFER_DATA)
                return -1;
        status = xlt_write_locked(0, 0, transfer_locked_data);
        if (status != XLT_ERROR_SUCCESS){
                if (status == XLT_ERROR_LOCKED_BAD_COUNTER){
                        printf("ERROR: probably you have already applied this memory remote update to the locked bank!\n");
                }
                return -1;
        }
        return 0;
}

#define BANK_0 0
// return 0 on success, -1 on error.
//receive as input the data romotely read from the device, and returns the data to be sent for the remote update
// use_sn set to 1 makes the update for the device with a given serial number (retrieved when reading the memory bank of the remote device)
// use_sn set to 0 makes the update for the devices sharing the same group number.
static int ServerManageLockedMemory(const unsigned char* transfer_locked_data_in, unsigned int transfer_locked_data_in_length, int use_sn,
                                                         unsigned char* transfer_locked_data_out, unsigned int transfer_locked_data_out_size)
{
        unsigned char dongle_key[XLT_KEY_SIZE];
        unsigned char data[XLT_BANK_SIZE];
        unsigned char locked_data[XLT_LOCKED_BANK_DATA_LENGTH];
        int status;
        int i;
        unsigned int bank, serial_number, group_number, counter;

        if (transfer_locked_data_in_length != XLT_LOCKED_TRANSFER_DATA ||
                transfer_locked_data_out_size != XLT_LOCKED_TRANSFER_DATA){
                        printf("ERROR: invalid arguments\n");
                return -1;
        }

        for(i = 0; i < XLT_KEY_SIZE; i++){
                dongle_key[i]=(unsigned char)i;
        }

        status = xlt_decrypt_locked_data(transfer_locked_data_in, dongle_key, data);
        if (status != XLT_ERROR_SUCCESS){
                printf("ERROR: Corrupted data (very likely)\n");
                return -1;//it can be corrupted
        }

        // the first 48 bytes in decrypted_data is the data you can modify
        //from the rest of the buffer get some necessary information

        xlt_get_info_from_locked_bank(data, &bank, &counter, &serial_number, &group_number);
        // check that the returned data really comes from bank '0'
        if (bank != BANK_0){
                printf("ERROR: data from a bank that is not the expected one!\n");
                return -1;
        }

        memcpy(locked_data, data, XLT_LOCKED_BANK_DATA_LENGTH);

        // now transfer_locked_data contains the data of the bank 0 of the remote device.
        //change its value, for instance:
        for(i = 0; i < sizeof(locked_data); i++){
                locked_data[i] = (locked_data[i] == 0) ? 0: ~locked_data[i];
        }

        //the remote update can be done ONLY setting a new and greater value for the counter value.
        //Once arrived to 0xFFFFFFFF the locked bank can't be updated any longer.
        counter++; // are acceptable also "counter+=10" , "counter+=65000" ...

        // - The remote update may be done constructing a sort of "command" that works only for a device specifying its serial number inside the command
        // - The remote update may also be done addressing a group, that is a number that (usually) is shared by a group of devices.
        // - The serial number is set by the manufacturer, the group is decided during the execution of the device locking.
        if (use_sn)
                status = xlt_set_write_locked_serial_check(locked_data, BANK_0, counter, serial_number, dongle_key , transfer_locked_data_out);
        else
                status = xlt_set_write_locked_group_check(locked_data, BANK_0, counter, group_number, dongle_key , transfer_locked_data_out);

        if (status != XLT_ERROR_SUCCESS){
                printf("ERROR running prepare data for remote update...\n");
                return -1;
        }
        return 0;
}


Asymmetric cryptography on XLight (RSA)
Note:
This feature is available only on XLight devices of version 2.0 or later

Introduction

The XLight protection based on RSA is used as a system based on RSA 1024 or 512 bits encryption to test the presence of a specific XLight dongle. To better understand how it works it is good to have a clear idea of public-key cryptography, and possibly even some rudiments of RSA: searching in the Internet is easy to find documentation about them using as keywords RSA and Public Key Cryptography. In this document we merely refer to the main characteristic of the public-key encryption: that is the operation of encryption and decryption require different keys and possession of the encryption key is not sufficient to reconstruct the decryption key. This allows to freely expose the encryption key (called the public key) to the vision of anyone, putting everybody to be able to build encrypted messages which, nevertheless, remain understandable (i.e. decryptable) only by the holder of the decryption key (the private key) .

Protection with RSA

Below it is provided a way by which you can make a protection using RSA on XLight.

  1. The protected program generates a random buffer that we identify with bufRnd
  2. The protected program, that owns the RSA public key, denoted by pubKey, encrypts bufRnd using RSA encryption with pubKey key. We denote the result with encBufRnd
  3. The program sends encBufRnd to the XLight device
  4. The device performs the RSA decryption of the data encBufRnd using the private key privKey corresponding to the public key pubKey. Let decBufRnd be the result of this operation
  5. The XLight device returns decBufRnd the protected program
  6. The protected program compares decBufRnd and bufRnd, if they are different the protected program must consider that the connected device is not the expected XLight dongle and therefore it should take an appropriate action, for instance to terminate the execution.

Note that in step 2. an encryption operation is performed that does not require the use of XLight but uses RSA encryption libraries that must be integrated within the protected program.

Emulation attack

The software emulation of hardware protection systems written by hackers (and crackers) constitutes a serious threat to the protected applications and for the protection of licenses. The use of RSA encryption makes this type of attack extremely difficult or even impossible.

In order to emulate the XLight device there is no other option than using the RSA private key to decrypt the randomly generated data sent to the dongle by the application.

In the example described in the previous paragraph, the RSA private key never appears in the application and, because of the characteristic of the public key cryptography, it is not possible to reconstruct it in a simple way.

Getting RSA private key means to crack the RSA algorithm. For small keys (100 - 200 bits), this process is fairly easy, for 512-bit key are required power of calculus that not everyone may afford, while the 1024 bit key will be presumably unbreakable for years.

The hacker is consequently forced to intervene on binary code by inserting jumps on the test or changing the RSA public key to be able to emulate XLight using a known private key (and this task is not manageable by everybody).

Use of 1024 bits or 512 bits keys

The use of a 1024-bit RSA key provides the best guarantees of integrity. However, the calculation of 1024-bit RSA decryption of XLight requires little more than two seconds, while the 512-bit just three tenths of a second: it may therefore be more convenient to use RSA 512 bits.

A further possibility is to use the 1024 bit occasionally and with greater frequency the 512-bit key(note that a XLight device can store and simultaneously use two keys: a 1024-bit and a 512-bit).

What not to do

The phase 2. in paragraph Protection with RSA is the hardest point for the integration of this XLight protection system: difficulties arise from the fact that the RSA encryption requires specific software that may not be of immediate comprehension and ease of use.

Inside XLight APIs it can be found all the necessary functions, including the encryption one, nevertheless the use of this function is strongly discouraged (also its name suggests not to use it). This feature was introduced exclusively for testing purpose and comparisons with the implemented code.

A good reason not to use RSA encryption exported APIs XLight is that the access to the dll open a security gap that can frustrate the efforts made by introducing RSA: in fact, it would be enough to insert a false dll to replace the RSA encryption operation with any invertible function (for instance the identity function). For this reason, you must be sure that the operation of RSA encryption is performed correctly: the only way to have such certainty is to use a function inside the protected program, that is implement RSA directly in your code.

On the Internet there are various libraries for RSA encryption or to perform arithmetic on very large integers available (up from 32 and 64 bit supported by the language used). OxySec provides an example with source code containing an implementation of RSA in C and C# languages.

For users of the .obj format libraries the problem is less compromising, the hacker would still be forced to tamper with the protected executable binary code (which is still the minimum aim of the RSA protection). However, to obtain further guarantees even in this case we still discourage the use of the RSA cipher function taken from the XLight APIs.

Format of numbers and RSA key

Using a different implementation from those offered by OxySec you must keep consider the format of numbers and encryption keys used by the device. Below it will be illustrated the format of RSA keys and numbers that constitute the input and output of the encryption.

A number is defined by a byte array and its length:

  • the least significant value of a number is contained in the leftmost byte (little endian)
  • only positive numbers are encoded

The mathematical representation is shown below.

Let x0, x1, x2, x3, ..., xk-1 be k bytes that make up an ordered array (x0 in position 0, x1 in position 1, etc.).
The number they represent will be:

x0* 2560 + x1* 2561 + x2* 2562 + x3* 2563 +...+ Xk-1* 256k-1

Since the input and output of the RSA cryptographic functions are numbers, to encrypt (or decrypt) an array you must first convert it to a number. Then It will be performed the calculation and the result converted back to an array. The conversion process must keep the correspondence between arrays and numbers as indicated by the formula above.

The RSA public key is composed by two numbers: by a module (normally indicated with n) and an exponent (indicated by e):

  • n is a number represented by an array of 128 bytes for a 1024 bit RSA key, while it is represented by an array of 64 bytes for a 512-bit RSA key
  • e is always represented by an array of 4 bytes

Let n0, n1, n2, ..., nk-1 be the representation of n and e0, e1, e2, e3 be the representation of e.

In the XLight APIs the RSA public key is represented by an array with the following values:

  • n0, n1, n2, ..., nk-1, e0, e1, e2, e3

The length of this array is 132 bytes (128 + 4) for a 1024-bit public key and 68 bytes (64 + 4) for a 512-bit public key.

The RSA private key is composed of two values as well: the modulus n of the public key and an exponent d that allows the computation of the inverse of what is computed with the exponent e. However there is a technique that allows faster calculations based on CRT (Chinese Remainder Theorem) that uses the five following numbers:

  • p, q, dP, dQ, dInv

where p and q are prime numbers such that n = p * q

The values dP and dQ are calculated in the following way:

dP = d (mod(p)-1)
dQ = d (mod(q)-1)

XLight uses this technique but without storing qInv and instead adding e (the exponent of the public key).
XLight uses p, q, dP, dQ and e. These values allow to recalculate qInv and n (so it will be possible to get the public key from the private key).

In the XLight APIs the RSA private key is represented by an array with the following values:

  • p0, p1, ..., pk-1, dP0, dP1, ..., dPk-1, q0, q1, ..., qk-1, dQ0, dQ1, ..., dQk-1, e0, e1, e2, e3

with k equal to 64 for 1024-bit RSA keys and k equal to 32 for the 512-bit RSA keys.

The order in which the numbers are placed to form a private key is evidently [p, dP, q, dQ, e].

The overall length of an array representing a 1024-bit RSA private key is 260 bytes, while for a 512-bit private key of is 132.

Input Vector

The input of an RSA cryptographic operation (both encryption and decryption) with 1024-bit key length must be an array of 128 bytes, while for a 512-bit key the input array must be 64 bytes long. If the input data is shorter then needed, its containing array must be zero padded on the right up to the specified size (128 or 256 bytes).

The requests above must necessarily be respected to carry out results without errors; however this is not sufficient to obtain correct calculations.

Because of the nature of the RSA algorithm, the number related to the input of each operation is transformed into its corresponding residue modulo n (for example, 43 corresponds to 1 module 7, that is it is the remainder of the division of 43 by 7).

This can cause that after encryption and the subsequent decryption the returned value does not match the starting value, and instead the residue modulo n of the input will be equal to the final value of the decryption.

An easy way to avoid this problem is to verify that the input value is less than the value of the modulus n. It will be enough that in the generation of each number to be encrypted in step 1. of the paragraph Protection with RSA is to set to zero the most significant byte of the array, that is the byte in the highest position: the 128-th byte in case of RSA 1024-bit and 64-th in case of 512-bit RSA.

RSA XLight functions

The XLight functions dedicated to the management of RSA keys can be divided into two groups: protection and service functions. The first are those that can be used within the protected program, while service functions should only be used for the preparation and testing of the instruments used by the protection scheme.

Protection functions

Protection functions should be the only ones used by the protected program:

  • xlt_rsa_set_privkey(): this function inserts a private key inside the XLight device. The device can hold two keys: a 1024-bit and 512-bit one. The function can be called up at any time and an already present key will be overriden by the one sent.
  • xlt_rsa_decrypt() : this is the main function of the RSA protection system. It runs the decryption of the input data (this action represents the points 3. 4. And 5. paragraph Protection with RSA).

Example of (RSA) Protection functions usage (C code):
        int status;
        unsigned int device = _device;
        unsigned char buf_rnd[XLT_RSA_1024_PLAINTEXT_SIZE];
        unsigned char enc_buf_rnd[XLT_RSA_1024_PLAINTEXT_SIZE];
        unsigned char dec_buf_rnd[XLT_RSA_1024_PLAINTEXT_SIZE];
        ...
        //this code can run into the XLight protected code

        //NOTE: YOU DON'T NEED TO CALL THIS THIS FUNCTION EVERY TIME BUT ONLY WHEN YOU CHANGE A PRIVATE KEY.
        //the dongle maintain two RSA keys (a 1024-bit and a 512-bit) in non volatile memory
        //(when you replug the device the keys are still there!)
        status = xlt_rsa_set_privkey(device, wrapped_priv_key, XLT_RSA_1024_WRAPPED_KEY_SIZE);
        if (status != XLT_ERROR_SUCCESS){
                //an error has occurred
                return status;
        }

        //do something ...

        //step 1 of the RSA protection scheme
        if (CryptoRandomGenerate(buf_rnd, XLT_RSA_1024_PLAINTEXT_SIZE) != 0){
                //return an XLight error even if the problem has nothing to do with XLight, let's say this is just an error!
                status = XLT_ERROR_RESOURCE;
                //terminate application
                return status;
        }
        //the (easier) solution to the residue module 'm' problem
        buf_rnd[XLT_RSA_1024_PLAINTEXT_SIZE - 1] = 0;

        //do something ...

        //step 2 of the RSA protection scheme
        //B E W A R E : uncomment and use xlt_never_use_this_rsa_encrypt() just for testing purpose
        //you must use your own source code
        //xlt_never_use_this_rsa_encrypt(pub_key, pub_key_len, buf_rnd, sizeof(buf_rnd), enc_buf_rnd);
        do_rsa_encryption(pub_key, pub_key_len, buf_rnd, sizeof(buf_rnd), enc_buf_rnd);

        //do something ...

        status = xlt_rsa_decrypt(device, enc_buf_rnd, sizeof(enc_buf_rnd), dec_buf_rnd);
        if (status != XLT_ERROR_SUCCESS){
                //an error has occurred
                return status;
        }

        //do something ...

        //step 6 of the RSA protection scheme
        if (memcmp(dec_buf_rnd, buf_rnd, sizeof(buf_rnd)) != 0){
                //ERROR: the device has not computed what we expected
                status = XLT_ERROR_INVALID_ARGUMENT;//set a generic error
                //terminate application
                return status;
        }

        //the RSA check has completed correctly...

        //your application continue to work...
        ...

Service Functions

Service functions should only be used in configuration or test programs not distributed to the end user and managed only by trusted personnel.

  • xlt_rsa_generate_key(): this function generates an RSA key returning both the private and the public key in the XLight format specified above. Do not include this function in the protected program.
  • xlt_rsa_wrap_privkey(): this function encrypts an RSA private key with a procedure based on AES and dependent by Dongle Key. The data generated allows xlt_rsa_set_privkey() to enter the RSA key inside the XLight device. Do not include this function in the protected program.
  • xlt_never_use_this_rsa_encrypt(): this is the function that allows you to perform RSA encryption test. Do not include this function in the protected program.
  • xlt_never_use_this_rsa_sw_decrypt(): this is the function that allows you to perform RSA decryption test: run the decryption in software mode performing the same calculations carried out by xlt_rsa_decrypt(). Do not include this function in the protected program.

Example of (RSA) Service functions usage (C code):
        int status;
        unsigned char pub_key[XLT_RSA_1024_PUB_KEY_SIZE];
        unsigned char priv_key[XLT_RSA_1024_PRIV_KEY_SIZE];
        unsigned char wrapped_priv_key[XLT_RSA_1024_WRAPPED_KEY_SIZE];
        unsigned int priv_key_len;
        unsigned int pub_key_len;
        unsigned char dongle_key[XLT_KEY_SIZE];
        ...
        //this code MUST never be inserted into the XLight protected code, but used only in safe environment by trusted personnel

        //generate public and private 1024-bit RSA keys
        //you can use any RSA library provided that the keys are converted into the XLight format
        status = xlt_rsa_generate_key(XLT_RSA_1024_BIT_SIZE, priv_key, sizeof(priv_key), &priv_key_len,
                                                                                pub_key, sizeof(pub_key), &pub_key_len);
        if (status != XLT_ERROR_SUCCESS){
                //an error has occurred
                return status;
        }

        //get the 'Dongle Key' value (needed for wrapping the RSA private key)
        RetrieveDongleKeyValue(dongle_key);

        //wrap the private key with 'Dongle Key'
        status = xlt_rsa_wrap_privkey(priv_key, priv_key_len, dongle_key, wrapped_priv_key, sizeof(wrapped_priv_key));
        if (status != XLT_ERROR_SUCCESS){
                //an error has occurred
                return status;
        }

        //now wrapped_priv_key contains the RSA private key in an encrypted form,
        //then it is safe to use wrapped_priv_key also in the protected software
        ...


AES Session Keys
Note:
This feature is available only on XLight devices of version 2.0 or later

Introduction

The idea behind the use of AES Session Keys (also referred as Session Key(s)) is to provide a method to allow the protected program to be able to distinguish a XLight device from an emulator (intent also pursued by the protection with RSA), this technique is more simple to implement than that based on RSA, on the other hand it does not guarantee the same levels of security.

Security is assured as long as an AES key used by the protected program, that is the Session Key, remains secret. You can use various tricks in order to make hard getting it, but facing a good and sufficiently determined hacker it is impossible to keep this secret for a long time. Nevertheless, the offered protection is not trivial especially if some of the AES session keys are used occasionally and/or only from a certain date on: in case of attempted XLight emulation such keys usage policy may cause unexpected errors after a long time, making the use a cracked version of the software frustrating.

The discovery of one or all of the Session Keys can make cracked only a particular version of the application: in future release it is possible to introduce new Session Keys (perhaps hidden in a more accurate way) which in fact make absolutely unusable all previous emulation.

Finally it must be considered that changing the AES session keys does not require any update to the XLight device: Session Keys are not permanently stored inside the device, but are sent from the protected program and are kept in RAM, that is into the volatile memory of the device.

XLight allows simultaneous use of eight Session Keys, if a greater number of keys has to be used, you need to set new values for the Session Keys (this is still very fast) and restore the original ones when they must be used again.

AES Session Keys usage

The use of AES keys to verify the presence of a specific XLight device connected to the USB port is based on the following steps:

  1. the protected program owns an AES Session Key which we denote by k, which is shared with the device XLight
  2. the protected program generates a random byte array: let c (challenge) be such value
  3. the protected program sends the array c to the device XLight
  4. the XLight device encrypt the value c using the AES algorithm and key k, let r (response) the result of the encryption
  5. the XLight device returns r to the protected program
  6. the protected program receives r and run AES passing c as input and k as the key
  7. if the result of the encryption performed by the protected program differs from r, it must be assumed that the connected XLight device is not the expected one, and therefore take the appropriate action, such as, terminate the execution.

Each time the protected program performs the steps described above it is generated a transaction that cannot be emulated as long as the key k is kept secret.

In the proposed algorithm the key k is within the program and thus potentially always be discovered. In that case it is still important that the XLight device does not lose its effectiveness due to the fact that a data that should have remained secret has been discovered.

The Session Key eliminates this risk, in the sense that even after the (possible) discovery of the key k it is always possible to set and use new Session Keys securely at any time.

Session Keys are not permanently stored within XLight, but with each insertion of the device they must be sent to it before using them. The sending of Session Keys kn is an operation that does not compromise the secrecy because everything is sent in encrypted form.

Protection using Session Keys

The Session Key protection consists of two phases: the first is the generation of the Session Key itself, and it is done in a secure environment outside the program to be protected, while the second phase is run within the program protected.

Preliminary phase

  1. the developer randomly generates the Session Key k
  2. using an encryption key derived from the Dongle Key owned by the XLight device it is performed an encryption of k; let w (Wrapped Key) be the result of this operation
  3. the developer inserts the Session Key k into the protected program, taking care to hide and reassemble it only when used
  4. the developer inserts w in the program too, but in this case, no special precautions are required

Protection

To the seven points listed in paragraph AES Session Keys usage it must be added a new starting point:

  1. the protected program sends the Wrapped Key w to the XLight device, which from its decryption gets k, the key to use for subsequent calculations

Note that this operation may be performed only once at the beginning of the execution or whenever you need to send a new value that contains a new Session Key.

AES Session Key functions

Preliminary phase functions:

  • xlt_session_wrap_key() this function should never be used inside the protected program, but only in a configuration program performed by authorized personnel (who generally implements XLight protection): this is a function to be used in the preliminary phase described above.

Example of preliminary function usage (C code):
        ...
        //this code MUST never be inserted into the XLight protected code, but used only in safe environment by trusted personnel

        int status;
        unsigned char dongle_key[XLT_KEY_SIZE];//dongle_key MUST never be used in your protected application

        //get 'Dongle Key' value
        RetrieveDongleKeyValue(dongle_key);

        //compute the challenge getting crypto random number
        if (CryptoRandomGenerate(session_key, XLT_KEY_SIZE) != 0){
                //return an XLight error even if the problem has nothing to do with XLight, let's say this is just an error!
                return XLT_ERROR_RESOURCE;
        }

        //Wrap Session Key
        status = xlt_session_wrap_key(session_key, dongle_key, wrapped_session_key);
        if (status != XLT_ERROR_SUCCESS){
                //an error occurred
                ...
        }
        //the Session Key is now wrapped into wrapped_session_key
        ...

Protection functions:

  • xlt_session_set_key() this function is used to upload the Session Key using its encrypted form w (Wrapped Key) onto the XLight device.
  • xlt_session_encrypt() this function perform AES encryption using the Session Key set by xlt_session_set_key()
  • xlt_session_decrypt() this function perform AES decryption using the Session Key set by xlt_session_set_key()

Example of (Session Key) Protection function usage (C code):
        int status;
        unsigned int device = 0;
        unsigned char challenge[XLT_CIPHERTEXT_SIZE];
        unsigned char response[XLT_CIPHERTEXT_SIZE];
        unsigned char expected_response[XLT_CIPHERTEXT_SIZE];
        aes_ctx ctx;
        int i;
        ...

        //Very first step of the SessioKey protection scheme (step 0)
        //(you can do this at the beginning of your application or only if you need to change the Session Key)
        //insert the Session Key number 0
        status = xlt_session_set_key(device, 0, wrapped_session_key);
        if (status != XLT_ERROR_SUCCESS){
                //terminate application
                return status;
        }

        //do some tasks of your application
        //Step 1 of the SessioKey protection scheme
        aes_setkey(session_key, XLT_KEY_SIZE, aes_enc, &ctx);

        //Run your tasks
        //...

        //Step 2 of the SessioKey protection scheme
        if (CryptoRandomGenerate(challenge, XLT_CIPHERTEXT_SIZE) != 0){
                //return an XLight error even if the problem has nothing to do with XLight, let's say this is just an error!
                status = XLT_ERROR_RESOURCE;
                //terminate application
                return status;
        }

        //do some tasks of your application
        //...

        //Step 3,4,5 of the SessioKey protection scheme
        status = xlt_session_encrypt(device, 0, challenge, response);
        if (status != XLT_ERROR_SUCCESS){
                //terminate application
                return status;
        }

        //do some tasks of your application
        //...

        //Step 6 of the SessioKey protection scheme
        aes_encrypt(challenge, expected_response, &ctx);

        //do some tasks of your application

        //Step 7 of the SessioKey protection scheme
        if (memcmp(expected_response, response, XLT_CIPHERTEXT_SIZE) != 0){
                        //the device has not computed what we expected
                        printf("Session Key challenge response check failed!\n");
                        //take the due action (halt execution)
                        //...
                        status = XLT_ERROR_INVALID_ARGUMENT;//set a generic error
                        //terminate application
                        return status;
        }

        //your application continue to work...
        ...


XLight SD

Introduction

XLight SD is an XLight model provided with a memory flash disk with encryption features.

The simplest way to use it is the single non encrypted disk configuration: OxySec ships XLight SD in such state, and a single disk can be immediately used plugging the device into the USB port. The disk must be formatted and then can be used as a standard flash memory disk on which it is possible insert applications protected by XLight or any other file.

In addition to this simply usage, XLight SD offers the choice to split the memory in two disks one of which is always present while the other is mounted by calling XLight SD APIs.

Plain disk usage

There is a little bit to add to what is written in the introduction above:

  • The standard disk is always accessible and always rewritable.
  • The user of an XLight SD protected software can execute application on it, but also delete or add files.
  • This disk must be considered as an easy way to bring software or other data together the related XLight device dongle.

More option is available using the encrypted disk.

Encrypted disk usage

It is possible to configure XLight SD to manage two disks: the first is the normal disk mentioned above, the second is usually not mounted, but it can be mounted programmatically: mounting, mounting in read only access and unmounting the encrypted disk is done using functions from XLight APIs.

Note:
when the encrypted disk is mounted every program and user may access (at least in read only mode) the data stored on it in clear form. This fact must be kept in mind to avoid to put secret data onto the encrypted disk. This fact suggests that the most useful use of the encrypted disk is to mount it in read only mode to prevent the user to modify data that must be kept unchanged.

Initialize the encrypted disk

This task can be done only on a configured device using the xlt_storage_set() function and passing the Dongle Key value previously used by xlt_setup(). As we remark in various point of the documentation Dongle Key should (must) never be used inside the protected application, hence the configuration of the disk must be done at configuration step in a safe place by authorized people.

Unlike xlt_setup(), xlt_storage_set() can be run more than once: it will delete the previous content and re-initialize the password associated to the encrypted disk.

In the arguments of xlt_storage_set() there is a disk password that will be used to mount and unmount the disk.

After a xlt_storage_set() execution the non encrypted and encrypted disk must be formatted.

If no encrypted disk is needed it is not necessary use xlt_storage_set() at all, simply format the single disk after the device is plugged-in the first time. If an encrypted disk was already present, to get rid of it simply call xlt_storage_set() setting the argument locked_mem_size_in_blocks to zero.

Note:
after xlt_storage_set() is successfully completed, the XLight SD device is detached and re-enumerated by the USB host controller and the device will be accessible after a few seconds.

Access the encrypted disk

In order to mount the encrypted disk it must be called xlt_storage_unlock() passing the disk password set by xlt_storage_set(). To allow only read only access it must be called the xlt_storage_unlock_ro() function.

Note:
it is impossible to change the disk password unless calling xlt_storage_set(), but in this case all the data on the memory are lost.

Unmount the encrypted disk

Call the xlt_storage_lock() passing the disk password used by xlt_storage_set().

Note:
unmount the encrypted disk with care: if a task is writing onto the disk it is possible to damage the file system of the encrypted disk.

An Example of disk setting and usage

        //setup the encrypted disk;
        int status;
        unsigned int locked_mem_size_in_blocks;
        unsigned int mem_size_in_blocks;

        unsigned char dongle_key[XLT_KEY_SIZE];
        unsigned char disk_password[XLT_DISK_PASSWORD_SIZE] = {"a_test_value_123456789012345678"};

        GetDongleKeyValue(dongle_key);

        //get the size of the overall available memory (we ignore the size of the encrypted disk whenever it is present)
        status = xlt_storage_get_mem_size(device, &mem_size_in_blocks, 0);
        if (status != XLT_ERROR_SUCCESS){
                goto error;
        }

        // half memory for the encrypted disk: the other half will be for the plain disk.
        locked_mem_size_in_blocks = mem_size_in_blocks / 2;

        status = xlt_storage_set(device, locked_mem_size_in_blocks, dongle_key, disk_password);
        if (status != XLT_ERROR_SUCCESS){
                goto error;
        }
        // after xlt_storage_set() the device will be detached and reenumerated by the USB stack, so wait for a while before access it again
        Sleep(10000); //wait 10 seconds (usually it doesn't need such a long time!)

        //keep in mind that after xlt_storage_set() both disks (plain and encrypted) are not formatted.

        //mount the encrypted disk
        status = xlt_storage_unlock(device, disk_password);
        if (status != XLT_ERROR_SUCCESS){
                goto error;
        }

        //now the disk is visible (and the fist time it is mounted it should be formatted)
        //...

        //unmount the encrypted disk (use this function with care, if a task is writing onto the disk it is possible to damage the file system of the encrypted disk)
        status = xlt_storage_lock(device, disk_password);
        if (status != XLT_ERROR_SUCCESS){
                goto error;
        }

        //now the disk is no longer accessible (and the fist time it is mounted it should be formatted)
        //...

        //mount the encrypted disk in read only access
        status = xlt_storage_unlock_ro(device, disk_password);
        if (status != XLT_ERROR_SUCCESS){
                goto error;
        }

        //now the disk is visible but with read only access permission
        //...

error:


Timer and Counters

Starting from version 2.10 XLight supports Timer and Counters features in order to manage licensing schema based on time and number of executions of the application.

Introduction

The aim of Timer and Counters management is to give the supplier a way to decide a period of time or a number of times the client is allowed to use a protected software.

These feature can be applied for releasing demo version of software, or to be paid in term of usage time and then to expiring license.

In order to manage these kind of licensing XLight supplies two methods: timer and counters. Both counters and especially the timer don’t need any specific implementation: you can use utilities supplied by OxySec for configuring them and get the device locked if needed (see the online documentation of XLight). Nevertheless such utilities uses functions exported by the APIs, so if you need more integration in your environment you can directly manage the low level functions: hereunder these features will be described and examples regarding their usage are shown.

The protected program run into lock when one or more used XLight API functions locks; a function is locked when it stops working and returns value XLT_ERROR_STOPPED.

Warning:
Timer and counters may lock the same function: if the timer and a counter is locking a function, say RSA 1024 decryption, and it is desired to get it back to work, it is not enough restart just one of them, they must both be adjusted. This holds also for counters, if more than one counters locks RSA encryption, all the locking counters must be set to allow RSA encryption to be still usable. Later it will be shown what this mean.
Note:
as all functions in XLight the implementation of these features is done by the firmware running inside the device. The APIs are just the way to communicate and set how the device has to behave.

Timer

XLight has a timer that can lock a set of functions when it expires, that is when it reaches the value 0. The functions to be locked are established by the developer using a mask of bits; the lockable functions are a subset of the available APIs, but they are enough to lock the normal running of an application: it is possible to lock read and write operation, normal encryption, session encryption and RSA functions. On the other hand xlt_getinfo(), the locked memory functions, freezing and the counters and timer management functions cannot be locked.

The timer is not a clock (there is no way to instruct the device to work until a given date), but it performs a countdown starting from the configured value expressed in minutes and counting down until the time is elapsed, that is exactly what a timer does. When the device is unplugged the countdown is suspended, but it restart the first time the dongle is plugged and accessed again. The countdown is also suspended if for a certain period the dongle is not accessed. This behavior was introduced to get a good measure of the real period of usage of the protected application. The period of dongle inactivity before stopping the device is called idle time and may take every value from 2 minutes to billion of minutes.

Note:
Pay attention to the times the dongle is accessed: an application that performs very few communication is not only protected in a bad way, but it also makes useless the timer. For instance if an application tests the presence of the dongle only when started and then forget to use it, the timer will stop after a while letting the user working for free. So the developer must use the XLight dongle at least every idle time minutes, but it is also better to access it more often.

The easiest way to lock a dongle with the timer is to set a timer duration, say 100 hours, and then locks all the lockable functions when the 100 hours elapses.

After this period every attempt to read or write the memory and encrypt will fail, so avoid "protecting" your application just querying the device with xlt_getinfo() calls, as we pointed out this function is never locked and the protected application would result not to be under timer control.

At this point it is possible to restore the normal working by setting a new value for the counter or disabling it, but this restore task cannot be decided by the client: it is required to call a function with encrypted argument that the client cannot build up by his own and that will be furnished by the supplier.

Note:
In order to avoid undesired XLight locks for authorized clients it should a good thing to monitor the current value of the timer value using xlt_get_timer(). If the value is too close to zero the application should inform the user to contact the supplier to extend the period. This can be done before timer expiration at any moment, and it is also possible add extra time to the current value of the timer (this will be shown later).

Timer not initialized

If an already shipped XLight device has no timer setting active the dongle will (of course) never locks by its own. If the supplier decides to start using timer on these devices he must intervene through the protected application using the function xlt_get_timer(): the developer writes code that whenever the returned timer value is zero the execution stops. At this point the client must apply some setting configuring the timer to a nonzero value, and this can be done only applying commands controlled by the supplier.

Clearly this simply call may be found by good hackers, so if possible, ship devices with the timer already configured.

Remove timer protection

To remove timer protection it is enough to set the locking bit mask to 0. How to deal with bits mask will be shown in the following examples.

Set Timer example

Below it is shown sorce code to gather data from the device, set the configuration values and apply that settings to the timer. The central part of this task must be run in a safe place in supplier's offices, while gathering data and applying settings steps can be done remotely, on the customer PC. The example shows these three action in a single program just to show the logical sequence, but on a real application these steps must be kept separated unless these tasks are entirely run by the supplier of the application in a safe place.

Note:
Remember to never run software on client side that explicitely uses Dongle Key, so never run the central part of this example on client side:

The source code of the functions called in this example are shown below.

        ...
        int status = 0;
        unsigned char dongle_key[XLT_KEY_SIZE];
        unsigned char enc_data_from_device[XLT_ENC_READ_TIMER_DATA_SIZE];
        unsigned char enc_timer_cmd[XLT_GENERATE_TIMER_SETTINGS_CMD_ENC_SIZE];
        unsigned int len;

        //THE FOLLOWING TASK MUST BE RUN ON CLIENT SIDE

        status = RetrieveTimerDataFromDevice(device, enc_data_from_device, sizeof(enc_data_from_device), &len);
        if (status != XLT_ERROR_SUCCESS){
                //manage the error!
                //...
                goto end;
        }

        //THE FOLLOWING TASK MUST BE RUN IN YOUR OFFICE, IN A SAFE ENVIRONMENT BY PEOPLE YOU TRUST
        //I.E. NEVER PUT THE FOLLOWING CODE IN YOUR PROTECTED APPLICATION
        //This task must be done when you prepare your new release of your protected software

        //get the dongle key value
        GetDongleKeyValue(dongle_key);

        //build the timer command using data retrieved by the device at client side
        status = SetTimerConfiguration(dongle_key, enc_data_from_device, len, enc_timer_cmd, sizeof(enc_timer_cmd), &len);
        if (status != XLT_ERROR_SUCCESS){
                //manage the error!
                //...
                goto end;
        }

        // End of the code to not deliver

        //THE FOLLOWING TASK MUST BE RUN ON CLIENT SIDE

        status = ApplyCmdOnDevice(device, enc_timer_cmd, len);
        if (status != XLT_ERROR_SUCCESS){
                //manage the error!
                //...
                goto end;
        }

        ...
end:
        ...

The functions running on client side:

#include "xlt.h"

int RetrieveTimerDataFromDevice(unsigned int device, unsigned char* enc_data_from_device, unsigned int enc_data_from_device_size, unsigned int* p_timer_enc_data_len)
{
        int status;
        //this function read timer data from the device, the returning data are in encrypted form
        status = xlt_enc_read_timer(device, enc_data_from_device, enc_data_from_device_size, p_timer_enc_data_len);
        if (status != XLT_ERROR_SUCCESS){
                //an error occurred and must be managed
                //...
        }
        return status;
}

int ApplyCmdOnDevice(unsigned int device, const unsigned char* enc_cmd, unsigned int enc_cmd_len)
{
        int status;

        //enc_cmd is an encrypted command, only the XLight device can understand it
        status = xlt_enc_apply_timer_counter(device, enc_cmd, enc_cmd_len);
        if (status != XLT_ERROR_SUCCESS){
                //an error occurred and must be managed
                //...
        }
        return status;
}

The function running on server (supplier) side:

#include "xlt.h"

int SetTimerConfiguration(const unsigned char* dongle_key, const unsigned char* enc_data_from_device, unsigned int enc_data_from_device_len,
                                                  unsigned char* enc_timer_cmd, unsigned int enc_timer_cmd_size, unsigned int* p_enc_timer_cmd_len)
{
        int status;
        XLT_TIMER_COUNTER_INFO info;
        XLT_TIMER_CMD timer_cmd;
        status = xlt_timer_counters_retrieve(enc_data_from_device, enc_data_from_device_len, dongle_key, &info);
        if (status != XLT_ERROR_SUCCESS){
                //an error occurred and must be managed
                //...
                goto end;
        }

        switch(info.type){
                case XLT_TC_WRITE_COUNTER_CMD:
                        //enc_data_from_device contains a command that was previously built: the xlt_timer_counters_retrieve() allow you to read again
                        //all encrypted data or commands produced by the timer and counter functions.
                        //Given that this is a command there is nothing to do!
                        //this is a set counter command
                        status = -1000; //set some error
                        goto end;
                        break;
                case XLT_TC_WRITE_TIMER_CMD:
                        //see the comments above (this is a set timer command)
                        status = -1000; //set some error
                        goto end;
                        break;
                case XLT_TC_ADD_TIMER_VALUE_CMD:
                        //see the comments above (this is an add timer command)
                        status = -1000; //set some error
                        goto end;
                        break;
                case XLT_TC_READ_COUNTERS_DATA:
                        //this is counters data, we need data for timer
                        status = -1000; //set some error
                        goto end;
                        break;
                case XLT_TC_READ_TIMER_DATA:
                        //OK
                        break;
        }

        //the command counter must be higher than the current value, otherwise the command will fail!
        timer_cmd.cmd_counter = info.tc.timer_data.cmd_counter + 1;

        //set the mask of the function that must be locked at timer expiration.
        //To lock all the lockable functions simply write: timer_cmd.functions_to_lock_mask = XLT_LOCK_ALL;
        //To unlock all the lockable functions simply write: timer_cmd.functions_to_lock_mask = 0;
        timer_cmd.functions_to_lock_mask = XLT_LOCK_WRITE_DATA_B0 | XLT_LOCK_WRITE_DATA_B1 | XLT_LOCK_WRITE_DATA_B2 | XLT_LOCK_WRITE_DATA_B3 | XLT_LOCK_WRITE_DATA_B4
                | XLT_LOCK_WRITE_DATA_B5 | XLT_LOCK_WRITE_DATA_B6 | XLT_LOCK_RSA_CRT_DECRYPT_512 | XLT_LOCK_RSA_CRT_DECRYPT_1024;

        //period of dongle inactivity that must be wait before halting the timer
        timer_cmd.idle_time_minutes = 2;

        //set the serial number of the XLight device to configure, in this case the value retrieved from the queried device.
        timer_cmd.serial_number = info.tc.timer_data.serial_number;

        //set the timer to 168 hours
        timer_cmd.timer_value_minutes = 168 * 60;

        //NOTE: in order to set the timer command it is necessary to know the serial number of the device and the current "command counter", if you can get these
        //value without make a query of the device you can build the timer command directly.
        //The command counter could be set using the "unix time", if you follow this method you are almost sure to use a value greater then the previous one as required.

        //now build the encrypted command
        status = xlt_generate_timer_settings(&timer_cmd, dongle_key, enc_timer_cmd, enc_timer_cmd_size, p_enc_timer_cmd_len);
        if (status != XLT_ERROR_SUCCESS){
                //an error occurred and must be managed, probably you chose a too small buffer
                //...
                goto end;
        }
end:
        return status;
}

Example for adding minutes to the timer

It is also possible to add minutes to an already running timer, in this case the developer doesn't have to worry about idle time and the masked function, but he has only to decide the increment of the timer value. If a timer on a XLight device is running and it has a current value of, let's say 100, with the add timer command it is possible to instruct the device to add extra time to the current value, for example if 1440 is added the overall running time will be 1540 minutes. The adding function will work also if the current counter value is 0 and masked functions are locked: the new counter value will be 1440 and the masked functions return to work.

Below an exemple of code for adding timer with the main body quite similar to the previous example:

        ...
        int status = 0;
        unsigned char dongle_key[XLT_KEY_SIZE];
        unsigned char enc_data_from_device[XLT_ENC_READ_TIMER_DATA_SIZE];
        unsigned char enc_timer_cmd[XLT_GENERATE_TIMER_SETTINGS_CMD_ENC_SIZE];
        unsigned int len;

        //THE FOLLOWING TASK MUST BE RUN ON CLIENT SIDE

        status = RetrieveTimerDataFromDevice(device, enc_data_from_device, sizeof(enc_data_from_device), &len);
        if (status != XLT_ERROR_SUCCESS){
                //manage the error!
                //...
                goto end;
        }

        //THE FOLLOWING TASK MUST BE RUN IN YOUR OFFICE, IN A SAFE ENVIRONMENT BY PEOPLE YOU TRUST
        //I.E. NEVER PUT THE FOLLOWING CODE IN YOUR PROTECTED APPLICATION
        //This task must be done when you prepare your new release of your protected software

        //get the dongle key value
        GetDongleKeyValue(dongle_key);

        //build the timer command using data retrieved by the device at client side
        status = AddTimerConfiguration(dongle_key, enc_data_from_device, len, enc_timer_cmd, sizeof(enc_timer_cmd), &len);
        if (status != XLT_ERROR_SUCCESS){
                //manage the error!
                //...
                goto end;
        }

        // End of the code to not deliver

        //THE FOLLOWING TASK MUST BE RUN ON CLIENT SIDE

        status = ApplyCmdOnDevice(device, enc_timer_cmd, len);
        if (status != XLT_ERROR_SUCCESS){
                //manage the error!
                //...
                goto end;
        }

        ...

end:
        ...

And here the function to be run on supplier side:

#include "xlt.h"

int AddTimerConfiguration(const unsigned char* dongle_key, const unsigned char* enc_data_from_device, unsigned int enc_data_from_device_len,
                                                  unsigned char* enc_timer_cmd, unsigned int enc_timer_cmd_size, unsigned int* p_enc_timer_cmd_len)
{
        int status;
        XLT_TIMER_COUNTER_INFO info;
        XLT_TIMER_ADD_CMD timer_add_cmd;
        status = xlt_timer_counters_retrieve(enc_data_from_device, enc_data_from_device_len, dongle_key, &info);
        if (status != XLT_ERROR_SUCCESS){
                //an error occurred and must be managed
                //...
                goto end;
        }

        switch(info.type){
                case XLT_TC_WRITE_COUNTER_CMD:
                        //enc_data_from_device contains a command that was previously built: the xlt_timer_counters_retrieve() allow you to read again
                        //all encrypted data or commands produced by the timer and counter functions.
                        //Given that this is a command there is nothing to do!
                        //this is a set counter command
                        status = -1000; //set some error
                        goto end;
                        break;
                case XLT_TC_WRITE_TIMER_CMD:
                        //see the comments above (this is a set timer command)
                        status = -1000; //set some error
                        goto end;
                        break;
                case XLT_TC_ADD_TIMER_VALUE_CMD:
                        //see the comments above (this is an add timer command)
                        status = -1000; //set some error
                        goto end;
                        break;
                case XLT_TC_READ_COUNTERS_DATA:
                        //this is counters data, we need data for timer
                        status = -1000; //set some error
                        goto end;
                        break;
                case XLT_TC_READ_TIMER_DATA:
                        //OK
                        break;
        }

        //the command counter must be higher than the current value, otherwise the command will fail!
        timer_add_cmd.cmd_counter = info.tc.timer_data.cmd_counter + 1;

        //set the serial number of the XLight device to configure, in this case the value retrieved from the queried device.
        timer_add_cmd.serial_number = info.tc.timer_data.serial_number;

        //add 100 hours
        timer_add_cmd.timer_value_minutes_to_add = 100 * 60;

        //NOTE: in order to set the timer command it is necessary to know the serial number of the device and the current "command counter", if you can get these
        //value without make a query of the device you can build the timer command directly.
        //The command counter could be set using the "unix time", if you follow this method you are almost sure to use a value greater then the previous one as required.

        //now build the encrypted command
        status = xlt_generate_timer_add_settings(&timer_add_cmd, dongle_key, enc_timer_cmd, enc_timer_cmd_size, p_enc_timer_cmd_len);
        if (status != XLT_ERROR_SUCCESS){
                //an error occurred and must be managed, probably you chose a too small buffer
                //...
                goto end;
        }
end:
        return status;
}

Counters

In addition to the timer there is also the possibility to manage four counters. Before continue (if not already done) read Timer section because it contains concepts that apply also to counters.

A counter is initialized to a starting value and each time one or more functions belonging to a specific set are called the counter value is decremented of one unit. When it reach the 0 value it behaves as a timer, that is it locks a set of function specified by a mask of bits. So here it is defined two sets of functions:

  • the first set enclose the functions that cause the counter to decremented;
  • the second set is the set of the function to be locked once the counter reaches 0.

Both sets are defined with their own mask of bits: we call the first of them trigger mask, while the second is called the locking mask. Using counters it is possible to establish the number of times a function can be called.

Warning:
If two distinct counters share some functions in their locking mask the first of which becomes zero locks those functions. In addition if one of these counters are set again to a value different from zero the function could still be locked if the other counter keeps the function locked (that is the counter is still 0).

If the locking mask is zero the counter is inactive: it will still be decremented but when it becomes zero no action is taken. On the other hand if the trigger mask is empty the counter is never decremented and the locking mask will never be applied (unless the starting value of the counter is already set to 0).

Note:
regardless to the trigger mask, if the starting counter value is 0 the locking mask is immediately applied.

Remove counters protection

To remove counters protection it is enough to set the locking bit mask of the desired counter to 0. How to deal with counters bits mask will be shown in the following examples.

Counter example

Below it is shown sorce code to gather data from the device, set the configuration values and apply that settings to the counter (here the counter 0 is used). The central part of this task must be run in a safe place in supplier's offices, while gathering data and settings applying steps can be done remotely, on the customer PC. The example shows these three action in a single program just to show the logical sequence, but on a real application these steps must be kept separated unless these tasks are entirely run by the supplier of the application in a safe place.

The source code of the functions called in this example are shown below.

        ...
        int status = 0;
        unsigned char dongle_key[XLT_KEY_SIZE];
        unsigned char enc_data_from_device[XLT_ENC_READ_COUNTERS_DATA_SIZE];
        unsigned char enc_counter_cmd[XLT_GENERATE_COUNTER_SETTINGS_CMD_ENC_SIZE];
        unsigned int len;

        //THE FOLLOWING TASK MUST BE RUN ON CLIENT SIDE

        status = RetrieveCounterDataFromDevice(device, enc_data_from_device, sizeof(enc_data_from_device), &len);
        if (status != XLT_ERROR_SUCCESS){
                //manage the error!
                //...
                goto end;
        }

        //THE FOLLOWING TASK MUST BE RUN IN YOUR OFFICE, IN A SAFE ENVIRONMENT BY PEOPLE YOU TRUST
        //I.E. NEVER PUT THE FOLLOWING CODE IN YOUR PROTECTED APPLICATION
        //This task must be done when you prepare your new release of your protected software

        //get the dongle key value
        GetDongleKeyValue(dongle_key);

        //build the timer command using data retrieved by the device at client side
        status = SetCounterConfiguration(dongle_key, enc_data_from_device, len, enc_counter_cmd, sizeof(enc_counter_cmd), &len);
        if (status != XLT_ERROR_SUCCESS){
                //manage the error!
                //...
                goto end;
        }

        // End of the code to not deliver

        //THE FOLLOWING TASK MUST BE RUN ON CLIENT SIDE

        status = ApplyCmdOnDevice(device, enc_counter_cmd, len);
        if (status != XLT_ERROR_SUCCESS){
                //manage the error!
                //...
                goto end;
        }

        ...

end:
        ...

The function ApplyCmdOnDevice() is the same used for the timer, while the function for collecting data is:

#include "xlt.h"

int RetrieveCounterDataFromDevice(unsigned int device, unsigned char* enc_data_from_device, unsigned int enc_data_from_device_size, unsigned int* p_timer_enc_data_len)
{
        int status;
        //this function read counters data from the device, the returning data are in encrypted form
        status = xlt_enc_read_counters(device, enc_data_from_device, enc_data_from_device_size, p_timer_enc_data_len);
        if (status != XLT_ERROR_SUCCESS){
                //an error occurred and must be managed
                //...
        }
        return status;
}

And the function to be run on supplier side is:

int SetCounterConfiguration(const unsigned char* dongle_key, const unsigned char* enc_data_from_device, unsigned int enc_data_from_device_len,
                                                  unsigned char* enc_counter_cmd, unsigned int enc_counter_cmd_size, unsigned int* p_enc_counter_cmd_len)
{
        int status;
        XLT_TIMER_COUNTER_INFO info;
        XLT_COUNTER_CMD counter_cmd;
        status = xlt_timer_counters_retrieve(enc_data_from_device, enc_data_from_device_len, dongle_key, &info);
        if (status != XLT_ERROR_SUCCESS){
                //an error occurred and must be managed
                //...
                goto end;
        }

        switch(info.type){
                case XLT_TC_WRITE_COUNTER_CMD:
                        //enc_data_from_device contains a command that was previously built: the xlt_timer_counters_retrieve() allow you to read again
                        //all encrypted data or commands produced by the timer and counter functions.
                        //Given that this is a command there is nothing to do!
                        //this is a set counter command
                        status = -1000; //set some error
                        goto end;
                        break;
                case XLT_TC_WRITE_TIMER_CMD:
                        //see the comments above (this is a set timer command)
                        status = -1000; //set some error
                        goto end;
                        break;
                case XLT_TC_ADD_TIMER_VALUE_CMD:
                        //see the comments above (this is an add timer command)
                        status = -1000; //set some error
                        goto end;
                        break;
                case XLT_TC_READ_COUNTERS_DATA:
                        //OK
                        break;
                case XLT_TC_READ_TIMER_DATA:
                        //this is timer data, we need data for timer
                        status = -1000; //set some error
                        goto end;
                        break;
        }

        //the command counter must be higher than the current value, otherwise the command will fail!
        //the counters are four, this example work on the first one
        counter_cmd.cmd_counter = info.tc.counter_data[0].cmd_counter + 1;

        //set the mask of the function that must be locked when counter reach 0 value.
        //To lock all the lockable functions simply write: counter_cmd.functions_to_lock_mask = XLT_LOCK_ALL;
        //To unlock all the lockable functions simply write: counter_cmd.functions_to_lock_mask = 0;
        counter_cmd.functions_to_lock_mask = XLT_LOCK_WRITE_DATA_B0 | XLT_LOCK_WRITE_DATA_B1 | XLT_LOCK_WRITE_DATA_B2 | XLT_LOCK_WRITE_DATA_B3 | XLT_LOCK_WRITE_DATA_B4
                | XLT_LOCK_WRITE_DATA_B5 | XLT_LOCK_WRITE_DATA_B6 | XLT_LOCK_RSA_CRT_DECRYPT_512 | XLT_LOCK_RSA_CRT_DECRYPT_1024;

        //set the mask of the functions that make the counter to be decremented each time one of them is performed
        //(to trigger all the triggerable functions simply write: counter_cmd.trigger_functions_mask = XLT_TRIGGER_ALL;
        counter_cmd.trigger_functions_mask = XLT_TRIGGER_READ_DATA_B0 | XLT_TRIGGER_READ_DATA_B1 | XLT_TRIGGER_READ_DATA_B2 | XLT_TRIGGER_READ_DATA_B3 |
                XLT_TRIGGER_READ_DATA_B4 | XLT_TRIGGER_READ_DATA_B5 | XLT_TRIGGER_READ_DATA_B6 | XLT_TRIGGER_WRITE_DATA_B0 | XLT_TRIGGER_WRITE_DATA_B1 |
                XLT_TRIGGER_WRITE_DATA_B2 | XLT_TRIGGER_WRITE_DATA_B3 | XLT_TRIGGER_WRITE_DATA_B4 |
                XLT_TRIGGER_WRITE_DATA_B5 | XLT_TRIGGER_WRITE_DATA_B6 | XLT_TRIGGER_RSA_CRT_DECRYPT_512 | XLT_TRIGGER_RSA_CRT_DECRYPT_1024;

        //set the serial number of the XLight device to configure, in this case the value retrieved from the queried device.
        counter_cmd.serial_number = info.tc.counter_data[0].serial_number;

        //in this case the counter 0 is set, the available counters are 4 and indexed with 0, 1, 2 and 3.
        counter_cmd.counter_id = 0;

        //set the starting value of the counter to 1000
        counter_cmd.counter_value = 1000;

        //NOTE: in order to set the timer command it is necessary to know the serial number of the device and the current "command counter", if you can get these
        //value without make a query of the device you can build the timer command directly.
        //The command counter could be set using the "unix time", if you follow this method you are almost sure to use a value greater then the previous one as required.

        //now build the encrypted command
        status = xlt_generate_counter_settings(&counter_cmd, dongle_key, enc_counter_cmd, enc_counter_cmd_size, p_enc_counter_cmd_len);
        if (status != XLT_ERROR_SUCCESS){
                //an error occurred and must be managed, probably you chose a too small buffer
                //...
                goto end;
        }
end:
        return status;
}

Timer and counters used inside the protected application

The code shown above can be run outside the protected application and serves just for configuration or license activation. As we already pointed out when the timer elapses or a counter reaches zero some functions may be locked and this directly affects the behavior of the protected program. Clearly to make the lock effective the locked functions must be used and must be relevant for the protected application. Nevertheless there is the chance to explicitly use the timer and counters inside the protected application: it is possible to read the current value of the timer and counters, and also decrement counters.

Below two example of access to timer and counter values from inside the protected application:

Timer usage example:

        ...
        int status;
        unsigned int value;

        status = xlt_get_timer(device, &value);
        if (status != XLT_ERROR_SUCCESS){
                //error communicating with the device keep the due action
                //...
                goto end;
        }
        if (value <= 24*60){
                //still 24 hours to work (about three working days) and probably
                //it is the case to inform the user that his license is about to expire.

                //Remember to display request related to the device far from calls to XLight APIs: this make the work of an hacker harder.

                //take the proper action...
        }
        else if (value == 0){
                //the license is PROBABLY expired. Is it the case to do something?
                //maybe no if you already locked relevant functions!

                //take the proper action...
        }
        else {
                //take the proper action...
        }

        ...

Counter usage example:

        ...
        int status;
        unsigned int decrement = 1;
        unsigned int value;

        //here the value of the 'counter 0' is decremented, but it is also possible to let it unchanged by passing zero value.
        status = xlt_update_get_counter(device, 0, decrement, &value);
        if (status != XLT_ERROR_SUCCESS){
                //error communicating with the device keep the due action
                //...
                goto end;
        }
        if (value <= 10 && value > 0){
                //probably the counter will reach zero soon, it is the case to inform the user that his license is about to expire.
                //Remember to display request related to the device far from calls to XLight APIs: this make the work of an hacker harder.
                //take the proper action...
        }
        else if (value == 0){
                //the license is PROBABLY expired. Is it the case to do something?
                //maybe no if you already locked relevant functions!

                //take the proper action...
        }
        else {
                //take the proper action...
        }
        ...
Warning:
In the examples above when counter and timer is zero the program may “think” that the license is expired, but this is not necessarily true because the default value for timer and counters is zero (zero minutes to go, zero number to decrement) but the locking mask is zero and no functions will be locked at all. To discover if there are functions in locked state there is no other way to call one of the possibly locked functions, if the return value is XLT_ERROR_STOPPED the timer or counter is really locking that function. Nevertheless a well management of the locking mechanism should be self evident to the user, that is he can’t continue to use relevant XLight API call, and then the program is entirely locked.


Date based licensing

Starting from version 2.20 XLight supports the date features in order to manage licensing schema based on the date.

Introduction

The aim of the XLight Date management is to give the supplier a way to establish an expiring date of the license use of his protected software. Once passed that date the user won't be able to use the software unless an extension to the license is granted by the supplier.

In order to manage date licensing the protected program doesn't need a big effort: you can use utilities supplied by OxySec for configuring expiration date and its settings and get the device locked if needed. Nevertheless such utilities uses functions exported by the APIs, so if you need more integration in your environment you can directly manage the low level functions: hereunder these features will be described and examples regarding their usage are shown.

The protected program run into lock when one or more used XLight API functions locks; a function is locked when it stops working and returns the value XLT_ERROR_STOPPED.

Warning:
Date licesing may lock the same function on which timer and counters (Timer and Counters) works: if the timer and-or a counter is locking a function, say RSA 1024 decryption, and it is desired to get it back to work, it is not enough restart just one of them, they must all be adjusted (date, timer and counter).
Note:
as all functions in XLight the implementation of these features is done by the firmware running inside the device. The APIs are just the way to communicate and set how the device has to behave.

How it works

XLight doesn't contain an RTC (real time clock) in order to maintain its own date and time but it uses its internal timer in conjuction to externally provided time. At a glance this looks less safe than using a real clock, but using the XLight date management features you can be quite sure that the license mechanism will work fine with a reasonable effort in the integration of the XLight date functions inside the protected application.

After the license setting

The license expiration setting command has numerous arguments among wich the starting time (that is the current date and time). If the XLight device wasn't unplugged and the computer was kept always on the device could keep track of the correct time untill license expiration, but of course this isn't a realistic scenario.

When the device is unplugged or the computer powered off the internal clock is suspended and restarted when powered on, if this was the only way to keep track of the elapsing time there would be a chance to use the protected program for a period twice, three time or more longer than desired by the supplier. Luckily there are two mechanism that help in keeping the right time inside the XLight device.

Date update constraint

During the expiration license date setting there is the possibility to set the frequency that the time must be passed to the device. For instance, suppose that this parameter is set to ten minutes (600 seconds): in this case the XLight device needs to receive the current time (time means date and time) from the computer. If the time has not been sent the device consider this as an error and may lock (with stop reason field set to XLT_DATE_STOP_FOR_NORMAL_UPDATE_TIME_OUT_MAX_ERROR). Consider that the ten minutes are waited by the internal firmware, not by the APIs, so the only possibility to avoid errors is that the computer regularly sends the date to the device.

If the time received by the PC is five minutes back than the expected one an error occurs. Summing up one or more of these errors make the device lock with stop reason field set to XLT_DATE_STOP_FOR_UPDATE_MAX_ERROR.

Note:
if the passed date is forward the time is accepted.

When the device is not used, and this happens when the protected programmed is not used, the ten minutes update timer stops and it will be restarted only when the device is accessed again. Note that this is the timer to calculate when the next update must occur, not the internal time: the internal clock, as said above, stops only when the device is not powered.

There is an automatic date managemement supplied by the APIs (xlt_date_manage()) that run a thread that takes care to send the current time to the device avoiding the locks described above. This date management is quite easy to maintain and the only piece of advice to the user is to keep the time of the computer adjusted.

For stealing license time with the setting above you should keep track of the time of the last access to the device (or unplug the device and keep track of the time when such removal was done) and then set that time again to the PC when the protected program must be used again. Even if someone may accept to use a computer with a wrong time this way to work probably would be considered not acceptable by everyone.

Note:
We suggest to set this constraint from ten to half hour. Setting this paramenter to zero the time update is not required by the device, but we suggest not to use this setting.
if the automatic management is used it must be called xlt_date_manage() at the startup of the protected program with the command argument set to XLT_DATE_MANAGE_AUTO_START and the option field containing the bit value XLT_DATE_OPT_USE_LOCAL_TIME: it is important to call it before every other access to the device.

In case of manual management it is adviceable to directly set the time with xlt_set_date() before or at the same time (or at least after few seconds) of the first XLight API call.

If this method is not considered enough there is also the following strengthening.

Signed date update constraint

There is another constraint related to the time update of the XLight device: during the expiration license date setting it is possible to set the frequency that a timestamp must be passed to the device.

Suppose that this parameter is set to one month (2592000 seconds): in this case the XLight device needs to receive a timestamped date every month. If this timestamp has not been sent the device consider this as an error and may get locked (with stop reason field set to XLT_DATE_STOP_FOR_SIGNED_UPDATE_TIME_OUT_MAX_ERROR). Also for this time update all the calculus is done by the firmware, hence thare is no way to avoid errors other than to periodically give the device the desired value.

The process to update the timestamped date (that we call signed time or signed date) consists of the following steps:

  1. the XLight device generate a random value (challenge) and pass it to the protected application or the utility program XltRCli.exe
  2. the protected application or the utility program XltRCli.exe returns the user the challenge value in an encoded form.
  3. the user of the protected application sends the code to the supplier
  4. the supplier computes an encrypted command string containing a signed new date and time using the program XltDMan.exe
  5. the encrypted command string is sent to the user
  6. the user send the encrypted command to the XLight device using the protected application or the utility program XltRCli.exe
Note:
the challenge string and then the encrypted command has a limited active period, after this period the encrypted command is rejected. This period is set during the expiration license date setup and should be set from one hour up to one day.

There is also the chance to avoid to directly manage this signed time update delegating it to the automatic management, but to do so an internet connection is required. Such connection is not needed to be always active but, in our example, it would be sufficient one time a week (or two weeks, that is the half time of the desired period) while the protected program is running.

In order to use this automatic signed date update it is necessary call xlt_date_manage() at the startup phase of the protected program with the command argument set to XLT_DATE_MANAGE_AUTO_START and the option field containing the bit value XLT_DATE_OPT_USE_INTERNET_SIGNED_TIME plus the argument string containing the URL of the OxySec service.

Note:
the OxySec service for the signed time update can generate the command for every XLight device. There is a web address that can be used for testing purpose, but we strongly recommend not to use it in the released protected application, but ask OxySec to receive a customer URL, so that each OxySec customer can use his own address.

The signed date is of course precise, so, the efforts done to steal time (as shown here) are frustrates every time the signed time is issued.

If the users of the program is supposed to be connected to internet it is possible shrink this period to one week (or less, but this should be done with care).

Note:
We suggest to set this constraint from one week to one or two months. Setting this paramenter to zero the time update is not required.
unlike the non signed date update, the timer of the signed date update is never suspended (unless unplugging the device or turning off the computer).

The evaluation of the time to update the signed date is based on the current time (and the last update time) of the device, so, following the stealing time technique described in Date update constraint it is possible to delay the signed time update and gain license time: for instance if the signed update is needed every month it should be possible, at the cost of a painful management, lengthen the license for two, three or four month beyond the fixed date. If the signed update is forced every week it's difficult to gain more than one month (unless the protected program is used one hour a day).

What to do if the device locked

The device could lock for the following reasons:

  1. License expiration.
  2. Passing a wrong date, or not passing a date at all may cause a lock of the device, but they should never happen if the time of the computer are reasonably correct.
  3. It would be more awkward to avoid the lock due to the missing of signed update if the automatic procedure is used and an internet connection is absent.

In case 1 the only possibility to unlock the device is that the supplier sets a new date license, remember that it is not necessary wait the expiration of the license to set a new expiration date.

In case 2 and 3 it is possible to unlock the device as in case 1, but it is more proper to perform a signed date update procedure: it cleans up every error (except license expiration) end the license management restarts.

How to set the dongle to tollerate some errors

It could be useful to loosen the date management allowing some errors without locking the device, this choice is done setting the expiration date parameters, precisely the fields max_update_date_error, max_missing_update_date_error and max_missing_update_signed_date_error of the structure XLT_DATE_SET_EXPIRATION_CMD.

These settings may be useful because the xlt_read_date() (but also xlt_enc_read_date()) returns the number of occurred errors, and then it is possible to warn the user that he should put the protected application in a condition to facilitate the date update (for instance open an internet connection to allow automatic signed update) without reaching the complete block of the application.

Note:
if you allow the occurrence of errors keep in mind that the period for date update or signed date update become double or more of the original: for instance if a date update must be done every ten minutes and a signed update every one week, if the entries max_missing_update_date_error and max_missing_update_signed_date_error are set both to "1" the update times may be delayed to respectively twenty minutes and two weeks, so pay attention in setting these values.

Pros and Cons

Pros

  • This feature comes with the standard XLight dongle and the price of the device is the same (usually devices with RTC are quite expensive).
  • The RTC needs a battery and then has limited lifetime (3-4 years at most). XLight has no battery, its lifetime is much and much longer.
  • XLight needs no additional hardware: less hardware, more reliability.

Cons

  • Its usage is less straightforward then a device with RTC.
  • Compared to a device with an RTC it is less accurate in computing the time for the license expiration. However we consider this as a negligible drawback.

Code examples

Setting the expiration date

Note:
it is possible (locally or remotely) initialize an XLight dongle without writing code by using the program XltDMan.exe programming the device locally before shipping the device to the final user, or by using XltDMan.exe and XltRCli.exe to setup a date license remotely.

Below it is shown how to manage a remote initialization for the expiration date of the license using the XLight APIs. The procedure is shown in a whole code showing the flow to be followed, but the real implementation needs to be splitted in code running at client and server (supplier)side.

The source code of the functions called in this example are shown below.

        ...
        int status = 0;
        unsigned char dongle_key[XLT_KEY_SIZE];
        unsigned char enc_data_from_device[XLT_DATE_READ_ENC_DATA_SIZE];
        unsigned char enc_date_cmd[XLT_DATE_ENC_EXP_CMD_SIZE];
        unsigned int len;

        //THE FOLLOWING TASK MUST BE RUN ON CLIENT SIDE

        status = RetrieveDateDataFromDevice(device, enc_data_from_device, sizeof(enc_data_from_device), &len);
        if (status != XLT_ERROR_SUCCESS){
                //manage the error!
                //...
                goto end;
        }

        //THE FOLLOWING TASK MUST BE RUN IN YOUR OFFICE, IN A SAFE ENVIRONMENT BY PEOPLE YOU TRUST
        //I.E. NEVER PUT THE FOLLOWING CODE IN YOUR PROTECTED APPLICATION
        //This task must be done when you prepare your new release of your protected software

        //get the dongle key value
        GetDongleKeyValue(dongle_key);

        //build the expiration date command using data retrieved by the device at client side
        status = SetDateExpiration(dongle_key, enc_data_from_device, len, enc_date_cmd, sizeof(enc_date_cmd), &len);
        if (status != XLT_ERROR_SUCCESS){
                //manage the error!
                //...
                goto end;
        }

        // End of the code to not deliver

        //THE FOLLOWING TASK MUST BE RUN ON CLIENT SIDE

        status = ApplyDateCmdOnDevice(device, enc_date_cmd, len);
        if (status != XLT_ERROR_SUCCESS){
                //manage the error!
                //...
                goto end;
        }

        //...

end:
        ...

The functions running on client side:

#include "xlt.h"

int RetrieveDateDataFromDevice(unsigned int device, unsigned char* enc_data_from_device, unsigned int enc_data_from_device_size, unsigned int* p_date_enc_data_len)
{
        int status;
        //this function read date data from the device, the returning data are in encrypted form
        status = xlt_enc_read_date(device, enc_data_from_device, enc_data_from_device_size, p_date_enc_data_len);
        if (status != XLT_ERROR_SUCCESS){
                //an error occurred and must be managed
                //...
        }
        return status;
}

This function running on client side is used also by other examples.

#include "xlt.h"

int ApplyDateCmdOnDevice(unsigned int device, const unsigned char* enc_cmd, unsigned int enc_cmd_len)
{
        int status;

        //enc_cmd is an encrypted command, only the XLight device can understand it
        status = xlt_apply_date_enc_cmd(device, enc_cmd, enc_cmd_len);
        if (status != XLT_ERROR_SUCCESS){
                //an error occurred and must be managed
                //...
        }
        return status;
}

The function running on server (supplier) side generating the command for setting the license expiration date:

#include <time.h>
#include "xlt.h"

int SetDateExpiration(const unsigned char* dongle_key, const unsigned char* enc_data_from_device, unsigned int enc_data_from_device_len,
                                                  unsigned char* enc_date_cmd, unsigned int enc_date_cmd_size, unsigned int* p_enc_date_cmd_len)
{
        int status;
        XLT_DATE_INFO info;
        XLT_DATE_SET_EXPIRATION_CMD exp_cmd;
        status = xlt_date_enc_retrieve(enc_data_from_device, enc_data_from_device_len, dongle_key, &info);
        if (status != XLT_ERROR_SUCCESS){
                //an error occurred and must be managed
                //...
                goto end;
        }

        switch(info.type){
                case XLT_DATE_TYPE_SET_EXPIRATION_CMD:
                        //enc_data_from_device contains a command that was previously built: the xlt_date_enc_retrieve() allow you to read again
                        //all encrypted data or commands produced by the date functions.
                        //Given that this is a command there is nothing to do!
                        //this is a set expiration command
                        status = -1000; //set some error
                        goto end;
                        break;
                case XLT_DATE_TYPE_SIGNED_DATE_CMD:
                        //see the comments above (this is a signed time update command)
                        status = -1000; //set some error
                        goto end;
                        break;
                case XLT_DATE_TYPE_DATA:
                        //OK
                        break;
                case XLT_DATE_TYPE_CHALLENGE:
                        //this is the challenge for the signed time update command
                        status = -1000; //set some error
                        goto end;
                        break;
        }

        exp_cmd.challenge_expiration_time = 3600 * 24; //24 hours

        //the command counter must be higher than the current value, otherwise the command will fail!
        exp_cmd.cmd_counter = info.d.date_data.cmd_counter + 1;

        exp_cmd.current_time = (unsigned int)time(0);
        exp_cmd.expiration_time = exp_cmd.current_time + (3600 * 24 * (365 + 30)); // a license for one year and a month starting from NOW!

        //set the mask of the function that must be locked when the date license expires.
        //To lock all the lockable functions simply write: exp_cmd.functions_to_lock_mask = XLT_LOCK_ALL;
        exp_cmd.functions_to_lock_mask = XLT_LOCK_WRITE_DATA_B0 | XLT_LOCK_WRITE_DATA_B1 | XLT_LOCK_WRITE_DATA_B2 | XLT_LOCK_WRITE_DATA_B3 | XLT_LOCK_WRITE_DATA_B4
                | XLT_LOCK_WRITE_DATA_B5 | XLT_LOCK_WRITE_DATA_B6 | XLT_LOCK_RSA_CRT_DECRYPT_512 | XLT_LOCK_RSA_CRT_DECRYPT_1024;

        exp_cmd.max_missing_update_date_error = 1;
        exp_cmd.max_missing_update_signed_date_error = 1;
        exp_cmd.max_time_between_signed_updates = 3600 * 24 * 30;//one months
        exp_cmd.max_time_between_updates = 3600; //update the time every hour
        exp_cmd.max_update_date_error = 1;

        //set the serial number of the XLight device to configure, in this case the value retrieved from the queried device.
        exp_cmd.serial_number = info.d.date_data.serial_number;

        //NOTE: in order to set the date command it is necessary to know the serial number of the device and the current "command counter", if you can get these
        //value without make a query of the device you can build the date command directly.
        //The command counter could be set using the "unix time", if you follow this method you are almost sure to use a value greater then the previous one as required.

        //now build the encrypted command
        status = xlt_generate_date_expiration_cmd(&exp_cmd, dongle_key, enc_date_cmd, enc_date_cmd_size, p_enc_date_cmd_len);
        if (status != XLT_ERROR_SUCCESS){
                //an error occurred and must be managed, probably you chose a too small buffer
                //...
                goto end;
        }
end:
        return status;
}

Signed date update example

Note:
it is possible remotely update the signed time without writing code by using XltDMan.exe and XltRCli.exe.

Below it is shown how to manage the signed date update using the XLight APIs. The procedure is shown in a whole code showing the flow to be followed, but the real implementation needs to be splitted in code running at client side and server (supplier)side.

The source code of the functions called in this example are shown below.

        ...

        int status = 0;
        unsigned char dongle_key[XLT_KEY_SIZE];
        unsigned char enc_data_from_device[XLT_DATE_ENC_CHALLENGE_SIZE];
        unsigned char enc_date_cmd[XLT_DATE_SIG_UPD_CMD_SIZE];
        unsigned int len;

        //THE FOLLOWING TASK MUST BE RUN ON CLIENT SIDE

        status = RetrieveDateChallenge(device, enc_data_from_device, sizeof(enc_data_from_device), &len);
        if (status != XLT_ERROR_SUCCESS){
                //manage the error!
                //...
                goto end;
        }

        //THE FOLLOWING TASK MUST BE RUN IN YOUR OFFICE, IN A SAFE ENVIRONMENT BY PEOPLE YOU TRUST
        //I.E. NEVER PUT THE FOLLOWING CODE IN YOUR PROTECTED APPLICATION
        //This task must be done when you prepare your new release of your protected software

        //get the dongle key value
        GetDongleKeyValue(dongle_key);

        //build the signed update time command using data retrieved by the device at client side
        status = GenerateSignedDateCmd(dongle_key, enc_data_from_device, len, enc_date_cmd, sizeof(enc_date_cmd), &len);
        if (status != XLT_ERROR_SUCCESS){
                //manage the error!
                //...
                goto end;
        }

        // End of the code to not deliver

        //THE FOLLOWING TASK MUST BE RUN ON CLIENT SIDE

        status = ApplyDateCmdOnDevice(device, enc_date_cmd, len);
        if (status != XLT_ERROR_SUCCESS){
                //manage the error!
                //...
                goto end;
        }

        //...

end:

        ...

The functions running on client side: ApplyDateCmdOnDevice and

int RetrieveDateChallenge(unsigned int device, unsigned char* enc_challenge, unsigned int enc_challenge_size, unsigned int* p_enc_challenge_len)
{
        int status;
        //this function get the date challenge in encrypted form
        status = xlt_date_get_challenge(device, enc_challenge, enc_challenge_size, p_enc_challenge_len);
        if (status != XLT_ERROR_SUCCESS){
                //an error occurred and must be managed
                //...
        }
        return status;
}

The function running on server (supplier) side:

int GenerateSignedDateCmd(const unsigned char* dongle_key, const unsigned char* enc_data_from_device, unsigned int enc_data_from_device_len,
                                                  unsigned char* enc_date_cmd, unsigned int enc_date_cmd_size, unsigned int* p_enc_date_cmd_len)
{
        int status;
        XLT_DATE_INFO info;
        status = xlt_date_enc_retrieve(enc_data_from_device, enc_data_from_device_len, dongle_key, &info);
        if (status != XLT_ERROR_SUCCESS){
                //an error occurred and must be managed
                //...
                goto end;
        }

        switch(info.type){
                case XLT_DATE_TYPE_SET_EXPIRATION_CMD:
                        //enc_data_from_device contains a command that was previously built: the xlt_date_enc_retrieve() allow you to read again
                        //all encrypted data or commands produced by the date functions.
                        //Given that this is a command there is nothing to do!
                        //this is a set expiration command
                        status = -1000; //set some error
                        goto end;
                        break;
                case XLT_DATE_TYPE_SIGNED_DATE_CMD:
                        //see the comments above (this is a signed time update command)
                        status = -1000; //set some error
                        goto end;
                        break;
                case XLT_DATE_TYPE_DATA:
                        //see the comments above (this is a date info returned by the device)
                        status = -1000; //set some error
                        goto end;
                        break;
                case XLT_DATE_TYPE_CHALLENGE:
                        //OK
                        break;
        }

        //now build the encrypted command

        status = xlt_generate_signed_date_cmd((unsigned int)time(0), info.d.date_challenge.challenge, sizeof(info.d.date_challenge.challenge), dongle_key, enc_date_cmd, enc_date_cmd_size, p_enc_date_cmd_len);
        if (status != XLT_ERROR_SUCCESS){
                //an error occurred and must be managed, probably you chose a too small buffer
                //...
                goto end;
        }
end:
        return status;

}

Date update management

The following example represents how the date update for a XLight device can be managed. Remember that if the update doesn't take place the dongle may stop working. Redesigning your code to support this workflow may be hard, but you don't need to write this kind of code because you can delegate the date update management to the xlt_date_manage() function. This code is intended to show you how to preceed if you chose to manage this issue directly.

The following code represents the main of your protected application

#include "xlt.h"

        ...
        int status;
        XLT_DATE_DATA date_info;
        unsigned int update_every_x_sec;
        unsigned int signed_update_every_x_sec;
        unsigned int next_signed_update;
        unsigned int next_local_update = 0;
        unsigned int expiration_set = 1;
        unsigned int update_local_time = 1;
        unsigned int update_signed_time = 1;
        unsigned int current_time = (unsigned int) time(0);

        //Be careful! the time and date of the PC MUST be correct (with an error less than five minutes)

        //The following example represents how the date update for a XLight device can be managed.
        //Remember that if the update doesn't take place the dongle may stop working.
        //Redesigning your code to support this workflow may be hard, but you don't need to
        //write this kind of code because you can delegate the date update management to the
        //xlt_date_manage() function. This code is intended to show you how to preceed if you
        //chose to manage this issue directly.

        //When the dongle is not accessed for a while the timer
        //calculating the next time the dongle need to get a time update is suspended.
        //This doesn't apply to the signed time which, however, should be set to get updated with a long time.

        //get date information
        status = xlt_read_date(device, &date_info);
        if (status != XLT_ERROR_SUCCESS){
                //manage the error!
                //...
                goto end;
        }

        if (date_info.expiration_time == 0){
                //this date license expiration time is not set, that is the device will always work
                expiration_set = 0;
        }
        update_every_x_sec = date_info.max_time_between_updates;
        signed_update_every_x_sec = date_info.max_time_between_signed_updates;
        next_signed_update = date_info.next_signed_update_time;

        if (update_every_x_sec != 0){
                status = xlt_set_date(device, current_time);
                if (status != XLT_ERROR_SUCCESS){
                        //manage the error!
                        //...
                        goto end;
                }
                else {
                        next_local_update = current_time + update_every_x_sec;
                }
        }
        else {
                update_local_time = 0;
        }

        if (signed_update_every_x_sec == 0){
                update_signed_time = 0;
        }

        //MAIN LOOP OF THE PROTECTED PROGRAM
        while(Continue_To_Work()){
                current_time = (unsigned int) time(0);

                //LOCAL TIME MANAGEMENT
                if (update_local_time && (int)(next_local_update - current_time) * 2 < (int)update_every_x_sec){
                        status = xlt_set_date(device, current_time);
                        if (status != XLT_ERROR_SUCCESS){
                                //manage the error! you may also decide to quit the program
                                //...
                                goto end;
                        }
                        else {
                                next_local_update = current_time + update_every_x_sec;
                        }
                }

                //SIGNED TIME MANAGEMENT
                if (update_signed_time && (int)(next_signed_update - current_time) * 2 < (int)signed_update_every_x_sec){
                        //Perform signed update or warn the user that he should update the signed time onto the device
                        //using an external procedure
                        //...

                        status = RunSignedDateUpdate(device);
                        if (status != XLT_ERROR_SUCCESS){
                                //manage the error! (probably you don't want to stop the program)
                                //...
                        }
                        else {
                                current_time = (unsigned int) time(0);
                                next_signed_update = current_time + signed_update_every_x_sec;
                        }
                }

                //YOUR PROGRAM ACTIVITY
                //It should access the XLight device for protecting the software
                //and should run for less than "date_info.max_time_between_updates" and "date_info.max_time_between_signed_updates" seconds
                DoThreeMinutesOfYourTasksInWhichYouUseTheXlightDevice();
        }

end:
        ...

Automatic date update management

It is possible to delegate to the function xlt_date_manage() the management of the date update of the device: It is sufficient instruct the library to start a thread that will take care to update the date onto the plugged device.

Before showing the example it worths showing the values to be used for the "args" entry of the xlt_date_manage() function.

To allow xlt_date_manage() to access the OxySec timestamp service or to get the internet time it is necessary passing the addresses of such services. Note that such addresses are used only when the function is called with the following commands (cmd) arguments:

  • XLT_DATE_MANAGE_AUTO_START
  • XLT_DATE_MANAGE_DO_SET_TIME
  • XLT_DATE_MANAGE_DO_SET_TIME_ASYNC

The addresses are passsed in the args entry building up a string containing multiple informations. At this point two different values are recognized, that is the OxySec timestamp service and an NTP address.

To instruct xlt_date_manage() to use the OxySec signed date service you must write: oxyservice= followed by the address (you may also insert spaces, "oxyservice = <address>).<br> To instruct xlt_date_manage() to use the NTP internet time you must write: <i>ntp=</i> followed by the address (you may also insert spaces, "ntp = <address>).
The two addresses must be separated by a semicolon (';').

Regarding the NTP you can always use the string: ntp = pool.ntp.org

A working example of this string containing both addresses is:

oxyservice=script.google.com/macros/s/AKfycbx33zJi_-AxUGceju91SFwR2ML_A24btO_3lMulOQFu_2m4YZeU/exec;ntp=pool.ntp.org

Note:
the OxySec service used here is the test address, remember not to use it for your release application.
if your management doesn't use the signed date, or doesn't require to get internet time you don't need to set one of them or both values.

The following code represents the main of your protected application.
The function CheckAutomaticDatePrograssion() used here is shown below

#include "xlt.h"

#define OXYSERVICE_STRING "oxyservice = script.google.com/macros/s/AKfycbx33zJi_-AxUGceju91SFwR2ML_A24btO_3lMulOQFu_2m4YZeU/exec"
#define NTP_STRING "ntp = pool.ntp.org"
#define OXYSERVICE_STRING_AND_NTP_STRING ( OXYSERVICE_STRING ";" NTP_STRING )

        ...
        int status;

        //ACTIONS TAKEN BY THE PROTECTED PROGRAM BEFORE ACCESSING THE XLIGHT DEVICE

        //start the log management
        xlt_date_manage(XLT_DATE_MANAGE_MAKE_LOGS, 0, 1, 0, 0);

        //N.B. the address "script.google.com..." in OXYSERVICE_STRING_AND_NTP_STRING is the DEMO address
        //don't use it in your release software but ask OxySec team for YOUR personal address
        status = xlt_date_manage(XLT_DATE_MANAGE_AUTO_START, 0,
                XLT_DATE_OPT_USE_LOCAL_TIME | XLT_DATE_OPT_USE_INTERNET_TIME | XLT_DATE_OPT_USE_INTERNET_SIGNED_TIME,
                OXYSERVICE_STRING_AND_NTP_STRING, NULL);
        if (status != XLT_ERROR_SUCCESS){
                //manage the error
                goto end;
        }

        //the XLT_DATE_MANAGE_AUTO_START parameter above starts a thread managing the date update

        //YOUR PROTECTED CODE HERE
        //...

        //Sometimes you can check if all is working fine
        //(optional but advisable to avoid to get the XLight device locked without any worning to the user).
        //
        //If there is no internet connecion or some firewall is blocking the protected program the signed update cannot be done
        CheckAutomaticDatePrograssion(1);

        //YOUR PROTECTED CODE HERE
        //...

        //you can also stop the automatic date management (but it is not mandatory)
        xlt_date_manage(XLT_DATE_MANAGE_AUTO_STOP, 0, 1, 0, 0);

end:
        ...

The function CheckAutomaticDatePrograssion() shows a very basic management of the log generated by the automatic management. If all worked fine there should be no need of a log, but errors may occur. This function search for errors and if occurred takes actions to inform the user that its device may be locked.

static char* log_action[]={"???0", "LOG_ACTION_GET_DATE_INFO", "LOG_ACTION_SIGNED_TIME", "LOG_ACTION_NTP_TIME", "LOG_ACTION_LOCAL_TIME", "???"};

int CheckAutomaticDatePrograssion(int delete_already_checked_logs)
{
        int status;
        unsigned int num_entries = 0;
        unsigned int num_entries_retrieved = 0;
        unsigned int error_setting_signed_time = 0;
        unsigned int error_setting_time = 0;
        unsigned int error_setting_internet_time = 0;
        unsigned int error_acquiring_time_info_from_device = 0;
        unsigned int i;
        XLT_DATE_LOG* log = 0;
        status = xlt_date_manage_get_num_log_records(&num_entries);
        if (status != XLT_ERROR_SUCCESS){
                //manage error
                goto end;
        }

        if (num_entries == 0){
                //nothing to check
                goto end;
        }

        log = malloc(sizeof(XLT_DATE_LOG) * num_entries);
        if (!log){
                //manage error
                status = -1234;//your error!
                goto end;
        }

        status = xlt_date_manage_get_log_records(0, num_entries, log, &num_entries_retrieved);
        if (status != XLT_ERROR_SUCCESS && num_entries_retrieved != num_entries){
                //manage error
                status = -1234;//your error!
                goto end;
        }

        if (delete_already_checked_logs){
                //cleanup log
                xlt_date_manage(XLT_DATE_MANAGE_CLEAN_LOG, 0, 0, 0, 0);
        }

        //check logs
        for (i = 0; i < num_entries; i++){
                if (log[i].status != XLT_ERROR_SUCCESS){
                        //an error occurred inside the date update procedure
                        printf("time %u: running %s - ERROR %d\n", log[i].time, log_action[log[i].action], log[i].status);
                        //take the due action

                        if (log[i].action == LOG_ACTION_GET_DATE_INFO){
                                //printf("Can't acquire date info from the XLighr device\n");
                                error_acquiring_time_info_from_device = 1;
                        }
                        else if (log[i].action == LOG_ACTION_SIGNED_TIME){
                                error_setting_signed_time = 1;
                        }
                        else if (log[i].action == LOG_ACTION_NTP_TIME){
                                error_setting_internet_time = 1;
                        }
                        else if (log[i].action == LOG_ACTION_LOCAL_TIME){
                                error_setting_time = 1;
                        }
                }
        }

        if (error_acquiring_time_info_from_device){
                //take the proper action
                //...
        }

        if (error_setting_internet_time){
                //probably an internet connection is missing
                //take the proper action
                //...
        }

        if (error_setting_signed_time){
                //a failure during signed time update procedure usually depends on missing internet access or firewall rules.
                //It should be convenient to inform the user to allow the program to have internet access.

                //One or more failure during signed date update doesn't mean that the procedure was never done,
                //so before ask the user to connect to internet to allow the update procedure check the rest of the log for
                //a success of LOG_ACTION_SIGNED_TIME, or call xlt_read_date() to see if the next_signed_update_time field is far enough

                //take the proper action
                //...
        }

        if (error_setting_time || error_acquiring_time_info_from_device){
                //this should never happen, unless the device is removed

                //take the proper action (maybe nothing)
                //...
        }

        //...

end:

        if (log){
                free(log);
        }

        return status;
}

Semi-automatic management

Probably this wasn't the right title for this section, but it just wants to point out that it is possible to exploit the features of the automatic management using en explicit call. The interesting features are the internet communication protocol, so you can directly invoke a signed update procedure and set the NTP internet time onto the device.

This is possible setting xlt_date_manage() with the command argument XLT_DATE_MANAGE_DO_SET_TIME or XLT_DATE_MANAGE_DO_SET_TIME_ASYNC.

The first value immediately run the desired operation expressed by the option argument, and when the operation is completed it returns, the second allow you to launch the operation and check the result later on. The signed update procedure or the internet time retrival may take various seconds so this may lock you application, using the asynchronous procedure you can avoid this.

Below it is shown three examples, the first running the signed date update asynchronously, the second synchronously, and the third the NTP time application to the device in synchronous way (clearly it is possible to do this also in asynchronous way).

Asynchronous signed time update

#include "xlt.h"
#define DATE_ASYNC_TIMEOUT_MSEC 10000 //10 seconds
#define OXYSERVICE_STRING "oxyservice = script.google.com/macros/s/AKfycbx33zJi_-AxUGceju91SFwR2ML_A24btO_3lMulOQFu_2m4YZeU/exec"

        ...
        int status;
        unsigned int tick;
        ...

        //your code here ...

        //ASYNCRONOUS SIGNED DATE UPDATE

        tick = GetTickCount();

        //NOTE: you can't call xlt_date_manage() with XLT_DATE_MANAGE_DO_SET_TIME_ASYNC command if you have previously call  xlt_date_manage() with argument XLT_DATE_MANAGE_AUTO_START.
        //You first must call xlt_date_manage() with argument XLT_DATE_MANAGE_AUTO_STOP, than you can proceed
        //uncomment the following line if needed
        //xlt_date_manage(XLT_DATE_MANAGE_AUTO_STOP, device, 0, 0, 0);

        status = xlt_date_manage(XLT_DATE_MANAGE_DO_SET_TIME_ASYNC, device, XLT_DATE_OPT_USE_INTERNET_SIGNED_TIME | XLT_DATE_OPT_IMMEDIATELY_USE_INTERNET_SIGNED_TIME, OXYSERVICE_STRING, 0);
        if(status != XLT_ERROR_SUCCESS){
                //an error occurred
                goto end;
        }
        status = XLT_ERROR_DATEMAN_PENDING;
        while (status == XLT_ERROR_DATEMAN_PENDING && GetTickCount() - tick < DATE_ASYNC_TIMEOUT_MSEC){
                status = xlt_date_manage(XLT_DATE_MANAGE_DO_SET_TIME_RESULT, device, 0, 0, 0);

                //...
                //your protected code here OR if you just want to wait uncomment the following line
                //Sleep(100);

        }
        if (status == XLT_ERROR_DATEMAN_PENDING){
                //interrupt the update procedure
                xlt_date_manage(XLT_DATE_MANAGE_AUTO_STOP, device, 0, 0, 0);
        }
        if(status != XLT_ERROR_SUCCESS){
                //an error occurred
                goto end;
        }

        //END OF ASYNCRONOUS SIGNED DATE UPDATE

        //your code here

        ...
end:

Synchronous signed time update

#include "xlt.h"
#define OXYSERVICE_STRING "oxyservice = script.google.com/macros/s/AKfycbx33zJi_-AxUGceju91SFwR2ML_A24btO_3lMulOQFu_2m4YZeU/exec"

        ...
        int status;
        ...

        //your code here ...

        //SYNCRONOUS SIGNED DATE UPDATE (xlt_date_manage() may takes various seconds to complete)

        //NOTE: you can't call xlt_date_manage() with XLT_DATE_MANAGE_DO_SET_TIME command if you have previously call  xlt_date_manage() with argument XLT_DATE_MANAGE_AUTO_START.
        //You first must call xlt_date_manage() with argument XLT_DATE_MANAGE_AUTO_STOP, than you can proceed
        //uncomment the following line if needed
        //xlt_date_manage(XLT_DATE_MANAGE_AUTO_STOP, device, 0, 0, 0);

        status = xlt_date_manage(XLT_DATE_MANAGE_DO_SET_TIME, device, XLT_DATE_OPT_USE_INTERNET_SIGNED_TIME | XLT_DATE_OPT_IMMEDIATELY_USE_INTERNET_SIGNED_TIME, OXYSERVICE_STRING, 0);
        if(status != XLT_ERROR_SUCCESS){
                //an error occurred
                goto end;
        }

        //your code here ...
end:
        ...

Synchronous NTP time update

#define NTP_STRING "ntp = pool.ntp.org"
#include "xlt.h"
        ...
        int status;
        ...

        //your code here ...

        //SYNCRONOUS NTP DATE UPDATE (xlt_date_manage() may takes various seconds to complete)

        //NOTE: you can't call xlt_date_manage() with XLT_DATE_MANAGE_DO_SET_TIME command if you have previously call  xlt_date_manage() with argument XLT_DATE_MANAGE_AUTO_START.
        //You first must call xlt_date_manage() with argument XLT_DATE_MANAGE_AUTO_STOP, than you can proceed
        //uncomment the following line if needed
        //xlt_date_manage(XLT_DATE_MANAGE_AUTO_STOP, device, 0, 0, 0);

        status = xlt_date_manage(XLT_DATE_MANAGE_DO_SET_TIME, device, XLT_DATE_OPT_USE_INTERNET_TIME | XLT_DATE_OPT_IMMEDIATELY_USE_INTERNET_TIME, NTP_STRING, 0);
        if(status != XLT_ERROR_SUCCESS){
                //an error occurred
                goto end;
        }
        //when using NTP service don't continue to call xlt_date_manage() in a continue loop without wait for some minutes. We suggest this for two reason:
        //1)it's useless,
        //2)if you don't wait at least one second the NTP server may reject your request (it should be a DDOS attack defence).

        //your code here ...

end:
        ...

Device locking management

whenever the device get locked for license date expiration or for errors in its management the user must be informed on what action it should take to solve the problem. Clearly if the license is expired there is no other way to request and pay for a new license.

Here is an example of code finding the lock. The called function NotifyDateError() is shown below

#include "xlt.h"
        ...
        int status;
        unsigned char challenge[XLT_CIPHERTEXT_SIZE];
        unsigned char response[XLT_CIPHERTEXT_SIZE];

        //your protected program code
        //...

        if (CryptoRandomGenerate(challenge, XLT_CIPHERTEXT_SIZE) != 0){
                //return an XLight error even if the problem has nothing to do with XLight, let's say this is just an error!
                status = XLT_ERROR_RESOURCE;
                goto end;
        }

        //...

        //this can be any function that the end license can lock
        status = xlt_session_encrypt(device, 0, challenge, response);
        if (status != XLT_ERROR_SUCCESS){
                //manage error
                if (status == XLT_ERROR_STOPPED){
                        //the session encryption function was locked by the timer, counter or DATE management
                        //if you only set date license managenent this error can only occur if the licese is expired or something
                        //else went wrong. Check what it is to inform the user on the action he must take:
                        NotifyDateError(device);

                        //manage the error
                        //...

                }
        }
        //...

end:
        ...

NotifyDateError() display the occurred error (or errors) this information are useful to the supplier to help the user to come up with this problem and return to use the protected application

void NotifyDateError(unsigned int device)
{
        int status;
        XLT_DATE_DATA date_info;
        status = xlt_read_date(device, &date_info);
        if (status != XLT_ERROR_SUCCESS){
                printf("An errror occurred attempting to get date license information!\n");
                goto end;
        }
        if( date_info.stop_reason == 0){
                printf("The date license isn't expired and no locks are active\n");
        }
        else if (date_info.stop_reason & XLT_DATE_STOP_FOR_DATE_EXPIRATION){
                printf("The license is expired!\n");
        }
        else {
                printf("Contact the supplier of the software to solve the problem.\n\n");
                if (date_info.stop_reason & XLT_DATE_STOP_FOR_UPDATE_MAX_ERROR){
                        printf("Too many errors occurred while updating the date, probably the clock of your PC is not correct.\n");
                }
                if (date_info.stop_reason & XLT_DATE_STOP_FOR_NORMAL_UPDATE_TIME_OUT_MAX_ERROR){
                        //using the automatic mangement with xlt_date_manage() this case should't happen
                        printf("The devices needed to get date and time and it wasn't supplied within the required period (that is %d sec.).\n", date_info.max_time_between_updates);
                }
                if (date_info.stop_reason & XLT_DATE_STOP_FOR_SIGNED_UPDATE_TIME_OUT_MAX_ERROR){
                        //without a long period without internet connection this may occur
                        printf("The devices needed to get a SIGNED date and it wasn't supplied within the required period (that is %d sec.).\n", date_info.max_time_between_signed_updates);
                }
        }

end:;
}


Deprecated List
Global xlt_never_use_this_rsa_encrypt (const unsigned char *public_key, unsigned int public_key_len, const unsigned char *plaintext, unsigned int plaintext_ciphertext_length, unsigned char *ciphertext)
just use for test purpose
Global xlt_never_use_this_rsa_sw_decrypt (const unsigned char *private_key, unsigned int private_key_len, const unsigned char *ciphertext, unsigned int ciphertext_plaintext_length, unsigned char *plaintext)
just use for test purpose


Modules
Here is a list of all modules:
  • Constants
    • Flags
    • Models
    • Sizes
    • Errors
  • Timer and Counters structures
    • XLT_TIMER_COUNTER_INFO structure
      • XLT_TIMER_COUNTER_INFO data types
    • Lock mask values
    • Trigger mask values
  • Date structures
    • XLT_DATE_INFO structure
      • XLT_DATE_INFO data types
    • Date management commands
    • Options update values
    • Log information
      • Log action values
    • Release Features
  • XLight Api


Modules
Constants

Constants used by the XLight Api functions. More...

Modules

Flags

Flag codes.

Models

Model codes.

Sizes

Sizes in bytes of the buffers passed to and retrieved from the XLight APIs, plus other XLight consts.

Errors

Error codes.

Detailed Description

Constants used by the XLight Api functions.


Defines
Flags
Constants

Flag codes. More...

Defines

#define | XLT_FLAG_SETUP 0x10
Set if the device has been initialized.
#define | XLT_FLAG_FROZEN_BANK0 0x0100
Set if the bank 0 is frozen (no longer writable)
#define | XLT_FLAG_FROZEN_BANK1 0x0200
Set if the bank 1 is frozen (no longer writable)
#define | XLT_FLAG_FROZEN_BANK2 0x0400
Set if the bank 2 is frozen (no longer writable)
#define | XLT_FLAG_FROZEN_BANK3 0x0800
Set if the bank 3 is frozen (no longer writable)
#define | XLT_FLAG_FROZEN_BANK4 0x1000
Set if the bank 4 is frozen (no longer writable)
#define | XLT_FLAG_FROZEN_BANK5 0x2000
Set if the bank 5 is frozen (no longer writable)
#define | XLT_FLAG_FROZEN_BANK6 0x4000
Set if the bank 6 is frozen (no longer writable)
#define | XLT_FLAG_LOCKED_BANK0 0x010000
Set if the bank 0 is locked (writable only in encryption form)
#define | XLT_FLAG_LOCKED_BANK1 0x020000
Set if the bank 1 is locked (writable only in encryption form)
#define | XLT_FLAG_LOCKED_BANK2 0x040000
Set if the bank 2 is locked (writable only in encryption form)
#define | XLT_FLAG_LOCKED_BANK3 0x080000
Set if the bank 3 is locked (writable only in encryption form)
#define | XLT_FLAG_LOCKED_BANK4 0x100000
Set if the bank 4 is locked (writable only in encryption form)
#define | XLT_FLAG_LOCKED_BANK5 0x200000
Set if the bank 5 is locked (writable only in encryption form)
#define | XLT_FLAG_LOCKED_BANK6 0x400000
Set if the bank 6 is locked (writable only in encryption form)
#define | XLT_FLAG_TYPE_LOCK 0x800000
Indicate the type of lock applied: if set to 1 the Lock2 is set.

Detailed Description

Flag codes.

Flags returned by the xlt_getinfo() function. They are returned as a mask of bits: for instance the returned value 0x110 means that the XLight device has XLT_FLAG_SETUP and XLT_FLAG_FROZEN_BANK0 set, that is the label is configured (already setup), and the memory bank 0 is frozen (i.e. it can't be rewritten).


Defines
Models
Constants

Model codes. More...

Defines

#define | XLT_MODEL_BASIC_USBHID 0x0
Device using the USB DriverLess protocol (HID). It doesn't require a kernel driver.
#define | XLT_MODEL_USBHID_SD 0x1
Device using the USB DriverLess protocol (HID) supplying also an interface for Micro SD reader.

Detailed Description

Model codes.

These are the possible model codes returned by the xlt_getinfo() function. At present there is only one possible value.


Defines
Sizes
Constants

Sizes in bytes of the buffers passed to and retrieved from the XLight APIs, plus other XLight consts. More...

Defines

#define | XLT_LABEL_SIZE 64
Size of the Label field passed to the xlt_getinfo() and xlt_setup() functions.
#define | XLT_PASSWORD_SIZE 32
Size of the password field.
#define | XLT_KEY_SIZE 32
Size of a cryptographic Key.
#define | XLT_BANK_SIZE 64
Size of each bank of memory of the XLight device.
#define | XLT_NUMBER_OF_BANKS 7
Number of memory banks of the XLight device.
#define | XLT_LOCKED_BANK_DATA_LENGTH 48
Portion of the usable data for a locked bank. The rest of the bank is used for internal purpose.
#define | XLT_LOCKED_TRANSFER_DATA 80
data to be passed or retrieved using xlt_write_locked() and xlt_read_locked()
#define | XLT_CIPHERTEXT_SIZE 16
Size of the plaintext and ciphertext passed or retrieved by the crypto functions (xlt_encrypt(), xlt_decrypt() and xlt_challenge())
#define | XLT_DEVICE_MAX 16
Max number of devices. Useful when scanning all the device with the xlt_getinfo() functions.
#define | XLT_SESSION_NUMBER_OF_KEYS 8
Number of AES Session Keys.
#define | XLT_RSA_512_BIT_SIZE 512
length in bit of the public modulus of a 512 bit RSA key
#define | XLT_RSA_512_WRAPPED_KEY_SIZE 144
dimension of an RSA private key with modulus of 512 bit in its wrapped form
#define | XLT_RSA_512_PUB_KEY_SIZE 68
dimension of an RSA public key with modulus of 512 bit
#define | XLT_RSA_512_PRIV_KEY_SIZE 132
dimension of an RSA private key with modulus of 512 bit
#define | XLT_RSA_512_PLAINTEXT_SIZE 64
dimension of a plaintext for a 512 bit RSA key
#define | XLT_RSA_512_CIPHERTEXT_SIZE XLT_RSA_512_PLAINTEXT_SIZE
dimension of a ciphertext for a 512 bit RSA key
#define | XLT_RSA_1024_BIT_SIZE 1024
length in bit of the public modulus of a 1024 bit RSA key
#define | XLT_RSA_1024_WRAPPED_KEY_SIZE 272
dimension of an RSA private key with modulus of 1024 bit in its wrapped form
#define | XLT_RSA_1024_PUB_KEY_SIZE 132
dimension of an RSA public key with modulus of 1024 bit
#define | XLT_RSA_1024_PRIV_KEY_SIZE 260
dimension of an RSA private key with modulus of 1024 bit
#define | XLT_RSA_1024_PLAINTEXT_SIZE 128
dimension of a plaintext for a 1024 bit RSA key
#define | XLT_RSA_1024_CIPHERTEXT_SIZE XLT_RSA_1024_PLAINTEXT_SIZE
dimension of a ciphertext for a 1024 bit RSA key
#define | XLT_DISK_PASSWORD_SIZE 32
Size of the disk password (used onto to sd devices).
#define | XLT_COUNTERS_NUM 4
number of usable counters in Xlight

Detailed Description

Sizes in bytes of the buffers passed to and retrieved from the XLight APIs, plus other XLight consts.


Defines
Errors
Constants

Error codes. More...

Defines

#define | XLT_ERROR_SUCCESS 0
No error.
#define | XLT_ERROR_NOT_FOUND -1
Device not found.
#define | XLT_ERROR_INVALID_ARGUMENT -2
Function called with an invalid argument.
#define | XLT_ERROR_INVALID_STATE -3
Invalid state of the device for the required operation.
#define | XLT_ERROR_TRANSMIT -4
USB communication error.
#define | XLT_ERROR_RESOURCE -5
Resource error (usually not enough memory).
#define | XLT_ERROR_WRONG_PSWD -6
A wrong password has been used.
#define | XLT_ERROR_MISSING_DATA -7
Missing data (returned by an attempt to read memory from an unwritten bank)
#define | XLT_ERROR_FROZEN -8
Trying to write or freeze a frozen bank.
#define | XLT_ERROR_LOCKED -9
Trying to lock an already locked bank.
#define | XLT_ERROR_LOCKED_BAD_SERIAL -10
Writing in a locked bank passing a wrong serial.
#define | XLT_ERROR_LOCKED_BAD_COUNTER -11
Writing in a locked bank passing a wrong counter.
#define | XLT_ERROR_LOCKED_BAD_GROUP -12
Writing in a locked bank passing a wrong group number.
#define | XLT_ERROR_RSA_MAN -13
An error occurred running an RSA software function.
#define | XLT_ERROR_ENC_DISK_NOT_EXIST -14
Error on XLight SD trying to mount the non existent encrypted disk.
#define | XLT_ERROR_STOPPED -15
The function was stopped by the timer, counter or date protection management.
#define | XLT_ERROR_TC_BAD_SERIAL -16
Attempting to apply a time-counter setting on a device with unexpected serial number.
#define | XLT_ERROR_TC_BAD_FORMAT -17
Bad timer-counter command or data format (for instance a wrong Dongle Key was used)
#define | XLT_ERROR_TC_BAD_CMD_COUNTER -18
The counter of the time-counter command was wrong (probably the command was already been applied)
#define | XLT_ERROR_TC_BAD_VALUE -19
Wrong timer or conter value, it's value exceed the allowed limit.
#define | XLT_ERROR_DATE_BAD_SERIAL -20
Attempting to apply a date setting on a device with unexpected serial number.
#define | XLT_ERROR_DATE_BAD_FORMAT -21
Bad date command or data format (for instance a wrong Dongle Key was used)
#define | XLT_ERROR_DATE_BAD_CMD_COUNTER -22
The counter of the date command was wrong (probably the command was already been applied)
#define | XLT_ERROR_DATE_BAD_VALUE -23
sent a date older than the one extimated by the device
#define | XLT_ERROR_DATE_STOPPED -24
The function was stopped by the date protection management.
#define | XLT_ERROR_DATE_NOT_CONFIGURED -25
Date management not configured.
#define | XLT_ERROR_DATE_BAD_CHALLENGE -26
Bad challenge value (value not expected)
#define | XLT_ERROR_DATE_CHALLENGE_TIME_OUT -27
The signed data was sent after challenge expiration.
#define | XLT_ERROR_DATE_UNUSED_SIGNED_TIME -28
A signed date is not expected by the device.
#define | XLT_ERROR_RSA_INTERNAL_ERROR -29
An internal error occurred running the RSA algorithm (it should never happen)
#define | XLT_ERROR_DATEMAN_EXPIRED -30
date license expired
#define | XLT_ERROR_DATEMAN_TIME_SOURCE_UNAVAILABLE -31
any attempt to get a date (local or form internet) is failed
#define | XLT_ERROR_DATEMAN_INTERRUPTED -32
date management function was abruptly interrupted
#define | XLT_ERROR_DATEMAN_IS_RUNNING -40
the date management thread is (already) running and the called function can't be done
#define | XLT_ERROR_DATEMAN_NOT_RUNNING -41
the date management thread is not running
#define | XLT_ERROR_DATEMAN_NOT_SUPPORTED -42
the XLight device doesn't support date license or date license is not set
#define | XLT_ERROR_DATEMAN_PENDING -43
the date management is pending (that is it is running and the task is not completed yet)
#define | XLT_ERROR_DATEMAN_NTP_UNAVAILABLE -52
the NTP server is not found (the address is wrong or cannot be resolved or the internet connection is down)
#define | XLT_ERROR_DATEMAN_NTP_INCONSISTENT -53
the collected NTP time is wrong
#define | XLT_ERROR_DATEMAN_NTP_INTERNAL_ERROR -54
an error occurred managing the NTP time acquiring process
#define | XLT_ERROR_DATEMAN_NTP_LOW_TIME_QUALITY -55
the quality of the NTP time is not good enough
#define | XLT_ERROR_DATEMAN_HTTP_INTERNAL_ERROR -60
an internal error happened collecting the signed time
#define | XLT_ERROR_DATEMAN_HTTP_GENERIC_ERROR -61
a generic error happened collecting the signed time
#define | XLT_ERROR_DATEMAN_HTTP_INVALID_URL -62
invalid URL of the signed time server
#define | XLT_ERROR_DATEMAN_HTTP_CANNOT_CONNECT -63
impossible to establish a connection with the signed time server
#define | XLT_ERROR_DATEMAN_HTTP_CONNECTION_ERROR -64
the connection to the signed time server failed
#define | XLT_ERROR_DATEMAN_HTTP_TIMEOUT -65
timeout of the connection to the signed time server
#define | XLT_ERROR_DATEMAN_HTTP_MISSING_DATA -66
same expected data was missing during a communication with the signed time server
#define | XLT_ERROR_UNKNOWN -100
an unknown error has occurred

Detailed Description

Error codes.

The XLight functions return the following error codes.


Data Structures | Modules | Defines | Typedefs
Timer and Counters structures

Data structures and defines for the management of the XLight timer and counters. More...

Data Structures

struct | _XLT_TIMER_DATA
The structure contains the data of the XLight timer. More...
struct | _XLT_TIMER_ADD_CMD
The structure contains the command for incrementing the timer. More...
struct | _XLT_COUNTER_DATA
The structure contains the data of a XLight counter. More...
union | _XLT_TC_INFO
Union of all timer and counters command and data, that is: XLT_TIMER_DATA, XLT_TIMER_ADD_CMD, XLT_COUNTER_DATA, XLT_TIMER_CMD and XLT_COUNTER_CMD. More...

Modules

XLT_TIMER_COUNTER_INFO structure

Contains the data retrieved by the function xlt_timer_counters_retrieve() and consist of timer or counter info retrieved from a XLight device or from an encrypted command to be sent to the device.

Lock mask values

Locking mask to instruct the XLight device which function must be locked on timer expiration on or counter reset (reach values '0').

Trigger mask values

Trigger mask to instruct the XLight device to decrement a counter when a specific function is called.

Defines

#define | XLT_GENERATE_COUNTER_SETTINGS_CMD_ENC_SIZE 60
size of the encrypted buffer returned by xlt_generate_counter_settings()
#define | XLT_GENERATE_TIMER_SETTINGS_CMD_ENC_SIZE 44
size of the encrypted buffer returned by xlt_generate_timer_settings()
#define | XLT_GENERATE_TIMER_ADD_SETTINGS_CMD_ENC_SIZE 44
size of the encrypted buffer returned by xlt_generate_timer_add_settings()
#define | XLT_ENC_READ_COUNTERS_DATA_SIZE 156
size of the encrypted buffer returned by xlt_enc_read_counters()
#define | XLT_ENC_READ_TIMER_DATA_SIZE 44
size of the encrypted buffer returned by xlt_enc_read_timer()
#define | XLT_LOCK_ALL
Define for locking all the lockable functions.
#define | XLT_TRIGGER_ALL (XLT_LOCK_ALL | XLT_TRIGGER_GET_INFO)
Define for triggering all the triggerable functions.

Typedefs

typedef struct _XLT_TIMER_DATA | XLT_TIMER_DATA
typedef struct _XLT_TIMER_ADD_CMD | XLT_TIMER_ADD_CMD
typedef struct _XLT_COUNTER_DATA | XLT_COUNTER_DATA
typedef XLT_TIMER_DATA | XLT_TIMER_CMD
Contains the command for setting the timer.
typedef XLT_COUNTER_DATA | XLT_COUNTER_CMD
Contains the command for setting a counter.
typedef union _XLT_TC_INFO | XLT_TC_INFO

Detailed Description

Data structures and defines for the management of the XLight timer and counters.

Define Documentation

#define XLT_LOCK_ALL
Value:
(\
XLT_LOCK_READ_DATA_B0 | XLT_LOCK_READ_DATA_B1 | XLT_LOCK_READ_DATA_B2 | XLT_LOCK_READ_DATA_B3 | XLT_LOCK_READ_DATA_B4 |\
XLT_LOCK_READ_DATA_B5 | XLT_LOCK_READ_DATA_B6 | XLT_LOCK_WRITE_DATA_B0 | XLT_LOCK_WRITE_DATA_B1 | XLT_LOCK_WRITE_DATA_B2 |\
XLT_LOCK_WRITE_DATA_B3 | XLT_LOCK_WRITE_DATA_B4 | XLT_LOCK_WRITE_DATA_B5 | XLT_LOCK_WRITE_DATA_B6 | XLT_LOCK_SESSION_CRYPT_0 |\
XLT_LOCK_SESSION_CRYPT_1 | XLT_LOCK_SESSION_CRYPT_2 | XLT_LOCK_SESSION_CRYPT_3 | XLT_LOCK_SESSION_CRYPT_4 | XLT_LOCK_SESSION_CRYPT_5 |\
XLT_LOCK_SESSION_CRYPT_6 | XLT_LOCK_SESSION_CRYPT_7 | XLT_LOCK_SESSION_DECRYPT_0 | XLT_LOCK_SESSION_DECRYPT_1 | XLT_LOCK_SESSION_DECRYPT_2 |\
XLT_LOCK_SESSION_DECRYPT_3 | XLT_LOCK_SESSION_DECRYPT_4 | XLT_LOCK_SESSION_DECRYPT_5 | XLT_LOCK_SESSION_DECRYPT_6 | XLT_LOCK_SESSION_DECRYPT_7 |\
XLT_LOCK_RSA_CRT_SET_KEY_512 | XLT_LOCK_RSA_CRT_SET_KEY_1024 | XLT_LOCK_RSA_CRT_DECRYPT_512 | XLT_LOCK_RSA_CRT_DECRYPT_1024 |\
XLT_LOCK_CRYPT_ECB | XLT_LOCK_DECRYPT_ECB | XLT_LOCK_CHALLENGE_ECB)

Define for locking all the lockable functions.

Typedef Documentation

XLT_TIMER_DATA
See also:
_XLT_TIMER_DATA
XLT_TIMER_ADD_CMD
See also:
_XLT_TIMER_ADD_CMD
XLT_COUNTER_DATA
See also:
_XLT_COUNTER_DATA
XLT_TC_INFO
See also:
_XLT_TC_INFO


Data Structures | Modules | Typedefs
XLT_TIMER_COUNTER_INFO structure
Timer and Counters structures

Contains the data retrieved by the function xlt_timer_counters_retrieve() and consist of timer or counter info retrieved from a XLight device or from an encrypted command to be sent to the device. More...

Data Structures

struct _XLT_TIMER_COUNTER_INFO
Timer and counters info retrieved from a XLight device. More...

Modules

XLT_TIMER_COUNTER_INFO data types

These are the value types associated to the data contained int the structure XLT_TIMER_COUNTER_INFO.

Typedefs

typedef struct
_XLT_TIMER_COUNTER_INFO 		XLT_TIMER_COUNTER_INFO
Timer and counters info retrieved from a XLight device.

Detailed Description

Contains the data retrieved by the function xlt_timer_counters_retrieve() and consist of timer or counter info retrieved from a XLight device or from an encrypted command to be sent to the device.


Defines
XLT_TIMER_COUNTER_INFO data types
XLT_TIMER_COUNTER_INFO structure

These are the value types associated to the data contained int the structure XLT_TIMER_COUNTER_INFO. More...

Defines

#define | XLT_TC_UNKNOWN 0
Unknown data.
#define | XLT_TC_WRITE_COUNTER_CMD 1
the data in the structure are related to a write counter command (xlt_generate_counter_settings())
#define | XLT_TC_WRITE_TIMER_CMD 2
the data in the structure are related to a write timer command (xlt_generate_timer_settings())
#define | XLT_TC_ADD_TIMER_VALUE_CMD 3
the data in the structure are related to a add timer command (xlt_generate_timer_add_settings())
#define | XLT_TC_READ_COUNTERS_DATA 4
the data in the structure are related to read counters info (xlt_enc_read_counters())
#define | XLT_TC_READ_TIMER_DATA 5
the data in the structure are related to read timer info (xlt_enc_read_timer())

Detailed Description

These are the value types associated to the data contained int the structure XLT_TIMER_COUNTER_INFO.


Defines
Lock mask values
Timer and Counters structures

Locking mask to instruct the XLight device which function must be locked on timer expiration on or counter reset (reach values '0'). More...

Defines

#define | XLT_LOCK_READ_DATA_B0 (((XLT_ULONG_LONG)1) << 0)
Lock the function "Read from bank 0".
#define | XLT_LOCK_READ_DATA_B1 (((XLT_ULONG_LONG)1) << 1)
Lock the function "Read from bank 1".
#define | XLT_LOCK_READ_DATA_B2 (((XLT_ULONG_LONG)1) << 2)
Lock the function "Read from bank 2".
#define | XLT_LOCK_READ_DATA_B3 (((XLT_ULONG_LONG)1) << 3)
Lock the function "Read from bank 3".
#define | XLT_LOCK_READ_DATA_B4 (((XLT_ULONG_LONG)1) << 4)
Lock the function "Read from bank 4".
#define | XLT_LOCK_READ_DATA_B5 (((XLT_ULONG_LONG)1) << 5)
Lock the function "Read from bank 5".
#define | XLT_LOCK_READ_DATA_B6 (((XLT_ULONG_LONG)1) << 6)
Lock the function "Read from bank 6".
#define | XLT_LOCK_RESERVED_7 (((XLT_ULONG_LONG)1) << 7)
RFU.
#define | XLT_LOCK_WRITE_DATA_B0 (((XLT_ULONG_LONG)1) << 8)
Lock the function "Write on bank 0".
#define | XLT_LOCK_WRITE_DATA_B1 (((XLT_ULONG_LONG)1) << 9)
Lock the function "Write on bank 1".
#define | XLT_LOCK_WRITE_DATA_B2 (((XLT_ULONG_LONG)1) << 10)
Lock the function "Write on bank 2".
#define | XLT_LOCK_WRITE_DATA_B3 (((XLT_ULONG_LONG)1) << 11)
Lock the function "Write on bank 3".
#define | XLT_LOCK_WRITE_DATA_B4 (((XLT_ULONG_LONG)1) << 12)
Lock the function "Write on bank 4".
#define | XLT_LOCK_WRITE_DATA_B5 (((XLT_ULONG_LONG)1) << 13)
Lock the function "Write on bank 5".
#define | XLT_LOCK_WRITE_DATA_B6 (((XLT_ULONG_LONG)1) << 14)
Lock the function "Write on bank 6".
#define | XLT_LOCK_RESERVED_15 (((XLT_ULONG_LONG)1) << 15)
RFU.
#define | XLT_LOCK_SESSION_CRYPT_0 (((XLT_ULONG_LONG)1) << 16)
Lock the function "Session Encryption with key of index 0".
#define | XLT_LOCK_SESSION_CRYPT_1 (((XLT_ULONG_LONG)1) << 17)
Lock the function "Session Encryption with key of index 1".
#define | XLT_LOCK_SESSION_CRYPT_2 (((XLT_ULONG_LONG)1) << 18)
Lock the function "Session Encryption with key of index 2".
#define | XLT_LOCK_SESSION_CRYPT_3 (((XLT_ULONG_LONG)1) << 19)
Lock the function "Session Encryption with key of index 3".
#define | XLT_LOCK_SESSION_CRYPT_4 (((XLT_ULONG_LONG)1) << 20)
Lock the function "Session Encryption with key of index 4".
#define | XLT_LOCK_SESSION_CRYPT_5 (((XLT_ULONG_LONG)1) << 21)
Lock the function "Session Encryption with key of index 5".
#define | XLT_LOCK_SESSION_CRYPT_6 (((XLT_ULONG_LONG)1) << 22)
Lock the function "Session Encryption with key of index 6".
#define | XLT_LOCK_SESSION_CRYPT_7 (((XLT_ULONG_LONG)1) << 23)
Lock the function "Session Encryption with key of index 7".
#define | XLT_LOCK_SESSION_DECRYPT_0 (((XLT_ULONG_LONG)1) << 24)
Lock the function "Session Decryption with key of index 0".
#define | XLT_LOCK_SESSION_DECRYPT_1 (((XLT_ULONG_LONG)1) << 25)
Lock the function "Session Decryption with key of index 1".
#define | XLT_LOCK_SESSION_DECRYPT_2 (((XLT_ULONG_LONG)1) << 26)
Lock the function "Session Decryption with key of index 2".
#define | XLT_LOCK_SESSION_DECRYPT_3 (((XLT_ULONG_LONG)1) << 27)
Lock the function "Session Decryption with key of index 3".
#define | XLT_LOCK_SESSION_DECRYPT_4 (((XLT_ULONG_LONG)1) << 28)
Lock the function "Session Decryption with key of index 4".
#define | XLT_LOCK_SESSION_DECRYPT_5 (((XLT_ULONG_LONG)1) << 29)
Lock the function "Session Decryption with key of index 5".
#define | XLT_LOCK_SESSION_DECRYPT_6 (((XLT_ULONG_LONG)1) << 30)
Lock the function "Session Decryption with key of index 6".
#define | XLT_LOCK_SESSION_DECRYPT_7 (((XLT_ULONG_LONG)1) << 31)
Lock the function "Session Decryption with key of index 7".
#define | XLT_LOCK_RSA_CRT_SET_KEY_512 (((XLT_ULONG_LONG)1) << 32)
Lock the function "Set RSA 512 key".
#define | XLT_LOCK_RSA_CRT_SET_KEY_1024 (((XLT_ULONG_LONG)1) << 33)
Lock the function "Set RSA 1024 key".
#define | XLT_LOCK_RSA_CRT_DECRYPT_512 (((XLT_ULONG_LONG)1) << 34)
Lock the function "Decrypt with RSA 512 key".
#define | XLT_LOCK_RSA_CRT_DECRYPT_1024 (((XLT_ULONG_LONG)1) << 35)
Lock the function "Decrypt with RSA 1024 key".
#define | XLT_LOCK_RESERVED_36 (((XLT_ULONG_LONG)1) << 36)
RFU.
#define | XLT_LOCK_RESERVED_37 (((XLT_ULONG_LONG)1) << 37)
RFU.
#define | XLT_LOCK_RESERVED_38 (((XLT_ULONG_LONG)1) << 38)
RFU.
#define | XLT_LOCK_RESERVED_39 (((XLT_ULONG_LONG)1) << 39)
RFU.
#define | XLT_LOCK_CRYPT_ECB (((XLT_ULONG_LONG)1) << 40)
Lock the function xlt_encrypt()
#define | XLT_LOCK_DECRYPT_ECB (((XLT_ULONG_LONG)1) << 41)
Lock the function xlt_decrypt()
#define | XLT_LOCK_CHALLENGE_ECB (((XLT_ULONG_LONG)1) << 42)
Lock the function xlt_challenge()
#define | XLT_LOCK_RESERVED_43 (((XLT_ULONG_LONG)1) << 43)
RFU.
#define | XLT_LOCK_RESERVED_44 (((XLT_ULONG_LONG)1) << 44)
RFU.
#define | XLT_LOCK_RESERVED_45 (((XLT_ULONG_LONG)1) << 45)
RFU.
#define | XLT_LOCK_RESERVED_46 (((XLT_ULONG_LONG)1) << 46)
RFU.
#define | XLT_LOCK_RESERVED_47 (((XLT_ULONG_LONG)1) << 47)
RFU.

Detailed Description

Locking mask to instruct the XLight device which function must be locked on timer expiration on or counter reset (reach values '0').


Defines
Trigger mask values
Timer and Counters structures

Trigger mask to instruct the XLight device to decrement a counter when a specific function is called. More...

Defines

#define | XLT_TRIGGER_READ_DATA_B0 XLT_LOCK_READ_DATA_B0
Decrement a given counter when it is called the function "Read from bank 0".
#define | XLT_TRIGGER_READ_DATA_B1 XLT_LOCK_READ_DATA_B1
Decrement a given counter when it is called the function "Read from bank 1".
#define | XLT_TRIGGER_READ_DATA_B2 XLT_LOCK_READ_DATA_B2
Decrement a given counter when it is called the function "Read from bank 2".
#define | XLT_TRIGGER_READ_DATA_B3 XLT_LOCK_READ_DATA_B3
Decrement a given counter when it is called the function "Read from bank 3".
#define | XLT_TRIGGER_READ_DATA_B4 XLT_LOCK_READ_DATA_B4
Decrement a given counter when it is called the function "Read from bank 4".
#define | XLT_TRIGGER_READ_DATA_B5 XLT_LOCK_READ_DATA_B5
Decrement a given counter when it is called the function "Read from bank 5".
#define | XLT_TRIGGER_READ_DATA_B6 XLT_LOCK_READ_DATA_B6
Decrement a given counter when it is called the function "Read from bank 6".
#define | XLT_TRIGGER_RESERVED_7 XLT_LOCK_RESERVED_7
RFU.
#define | XLT_TRIGGER_WRITE_DATA_B0 XLT_LOCK_WRITE_DATA_B0
Decrement a given counter when it is called the function "Write on bank 0".
#define | XLT_TRIGGER_WRITE_DATA_B1 XLT_LOCK_WRITE_DATA_B1
Decrement a given counter when it is called the function "Write on bank 1".
#define | XLT_TRIGGER_WRITE_DATA_B2 XLT_LOCK_WRITE_DATA_B2
Decrement a given counter when it is called the function "Write on bank 2".
#define | XLT_TRIGGER_WRITE_DATA_B3 XLT_LOCK_WRITE_DATA_B3
Decrement a given counter when it is called the function "Write on bank 3".
#define | XLT_TRIGGER_WRITE_DATA_B4 XLT_LOCK_WRITE_DATA_B4
Decrement a given counter when it is called the function "Write on bank 4".
#define | XLT_TRIGGER_WRITE_DATA_B5 XLT_LOCK_WRITE_DATA_B5
Decrement a given counter when it is called the function "Write on bank 5".
#define | XLT_TRIGGER_WRITE_DATA_B6 XLT_LOCK_WRITE_DATA_B6
Decrement a given counter when it is called the function "Write on bank 6".
#define | XLT_TRIGGER_RESERVED_15 XLT_LOCK_RESERVED_15
RFU.
#define | XLT_TRIGGER_SESSION_CRYPT_0 XLT_LOCK_SESSION_CRYPT_0
Decrement a given counter when it is called the function "Session Encryption with key of index 0".
#define | XLT_TRIGGER_SESSION_CRYPT_1 XLT_LOCK_SESSION_CRYPT_1
Decrement a given counter when it is called the function "Session Encryption with key of index 1".
#define | XLT_TRIGGER_SESSION_CRYPT_2 XLT_LOCK_SESSION_CRYPT_2
Decrement a given counter when it is called the function "Session Encryption with key of index 2".
#define | XLT_TRIGGER_SESSION_CRYPT_3 XLT_LOCK_SESSION_CRYPT_3
Decrement a given counter when it is called the function "Session Encryption with key of index 3".
#define | XLT_TRIGGER_SESSION_CRYPT_4 XLT_LOCK_SESSION_CRYPT_4
Decrement a given counter when it is called the function "Session Encryption with key of index 4".
#define | XLT_TRIGGER_SESSION_CRYPT_5 XLT_LOCK_SESSION_CRYPT_5
Decrement a given counter when it is called the function "Session Encryption with key of index 5".
#define | XLT_TRIGGER_SESSION_CRYPT_6 XLT_LOCK_SESSION_CRYPT_6
Decrement a given counter when it is called the function "Session Encryption with key of index 6".
#define | XLT_TRIGGER_SESSION_CRYPT_7 XLT_LOCK_SESSION_CRYPT_7
Decrement a given counter when it is called the function "Session Encryption with key of index 7".
#define | XLT_TRIGGER_SESSION_DECRYPT_0 XLT_LOCK_SESSION_DECRYPT_0
Decrement a given counter when it is called the function "Session Decryption with key of index 0".
#define | XLT_TRIGGER_SESSION_DECRYPT_1 XLT_LOCK_SESSION_DECRYPT_1
Decrement a given counter when it is called the function "Session Decryption with key of index 1".
#define | XLT_TRIGGER_SESSION_DECRYPT_2 XLT_LOCK_SESSION_DECRYPT_2
Decrement a given counter when it is called the function "Session Decryption with key of index 2".
#define | XLT_TRIGGER_SESSION_DECRYPT_3 XLT_LOCK_SESSION_DECRYPT_3
Decrement a given counter when it is called the function "Session Decryption with key of index 3".
#define | XLT_TRIGGER_SESSION_DECRYPT_4 XLT_LOCK_SESSION_DECRYPT_4
Decrement a given counter when it is called the function "Session Decryption with key of index 4".
#define | XLT_TRIGGER_SESSION_DECRYPT_5 XLT_LOCK_SESSION_DECRYPT_5
Decrement a given counter when it is called the function "Session Decryption with key of index 5".
#define | XLT_TRIGGER_SESSION_DECRYPT_6 XLT_LOCK_SESSION_DECRYPT_6
Decrement a given counter when it is called the function "Session Decryption with key of index 6".
#define | XLT_TRIGGER_SESSION_DECRYPT_7 XLT_LOCK_SESSION_DECRYPT_7
Decrement a given counter when it is called the function "Session Decryption with key of index 7".
#define | XLT_TRIGGER_RSA_CRT_SET_KEY_512 XLT_LOCK_RSA_CRT_SET_KEY_512
Decrement a given counter when it is called the function "Set RSA 512 key".
#define | XLT_TRIGGER_RSA_CRT_SET_KEY_1024 XLT_LOCK_RSA_CRT_SET_KEY_1024
Decrement a given counter when it is called the function "Set RSA 1024 key".
#define | XLT_TRIGGER_RSA_CRT_DECRYPT_512 XLT_LOCK_RSA_CRT_DECRYPT_512
Decrement a given counter when it is called the function "Decrypt with RSA 512 key".
#define | XLT_TRIGGER_RSA_CRT_DECRYPT_1024 XLT_LOCK_RSA_CRT_DECRYPT_1024
Decrement a given counter when it is called the function "Decrypt with RSA 1024 key".
#define | XLT_TRIGGER_RESERVED_36 XLT_LOCK_RESERVED_36
RFU.
#define | XLT_TRIGGER_RESERVED_37 XLT_LOCK_RESERVED_37
RFU.
#define | XLT_TRIGGER_RESERVED_38 XLT_LOCK_RESERVED_38
RFU.
#define | XLT_TRIGGER_RESERVED_39 XLT_LOCK_RESERVED_39
RFU.
#define | XLT_TRIGGER_CRYPT_ECB XLT_LOCK_CRYPT_ECB
Decrement a given counter when it is called the function xlt_encrypt().
#define | XLT_TRIGGER_DECRYPT_ECB XLT_LOCK_DECRYPT_ECB
Decrement a given counter when it is called the function xlt_decrypt().
#define | XLT_TRIGGER_CHALLENGE_ECB XLT_LOCK_CHALLENGE_ECB
Decrement a given counter when it is called the function xlt_challenge().
#define | XLT_TRIGGER_RESERVED_43 XLT_LOCK_RESERVED_43
RFU.
#define | XLT_TRIGGER_RESERVED_44 XLT_LOCK_RESERVED_44
RFU.
#define | XLT_TRIGGER_RESERVED_45 XLT_LOCK_RESERVED_45
RFU.
#define | XLT_TRIGGER_RESERVED_46 XLT_LOCK_RESERVED_46
RFU.
#define | XLT_TRIGGER_RESERVED_47 XLT_LOCK_RESERVED_47
RFU.
#define | XLT_TRIGGER_GET_INFO (((XLT_ULONG_LONG)1) << 48)
Decrement a given counter when it is called the function xlt_getinfo() or xlt_locate().

Detailed Description

Trigger mask to instruct the XLight device to decrement a counter when a specific function is called.


Data Structures | Modules | Defines | Typedefs
Date structures

Data structures and defines for the management of the XLight time based license management. More...

Data Structures

struct | _XLT_DATE_DATA
Date license management data. More...
struct | _XLT_DATE_CHALLENGE
Date license challenge for signed time update. More...
struct | _XLT_DATE_SET_EXPIRATION_CMD
Set expiration date command. More...
struct | _XLT_DATE_SIGNED_DATE_CMD
Signed date command structure. More...
union | _XLT_D_INFO
Union of all date command and data, that is: XLT_DATE_SET_EXPIRATION_CMD, XLT_DATE_SIGNED_DATE_CMD, XLT_DATE_DATA, and XLT_DATE_CHALLENGE. More...

Modules

XLT_DATE_INFO structure

Contains the data retrieved by the function xlt_date_enc_retrieve() and consist of date info retrieved from a XLight device or from an encrypted command to be sent to the device.

Date management commands

Date management commands of the xlt_date_manage() function.

Options update values

These are the options values of the xlt_date_manage() function when called with the following command arguments:

Log information

The function xlt_date_manage_get_log_records() returns log info related to the activity of the automatic thread management (.

Release Features

List of the minimum supporting version for each new feature introduced by the XLight releases.

Defines

#define | XLT_DATE_CHALLENGE_SIZE 16
the size of the challenge buffer for signed
#define | CHALLENGE_EXPIRATION_MAX_TIME (3600 * 24 * 7)
the maximimum time in seconds that challenge_expiration_time can assume (seven days)
#define | XLT_DATE_ENC_EXP_CMD_SIZE 76
the length of the encrypted buffer containing the command for setting the expiration date
#define | XLT_DATE_SIG_UPD_CMD_SIZE 44
the length of the encrypted buffer containing the command for updating the signed date
#define | XLT_DATE_ENC_CHALLENGE_SIZE 44
the length of the get challenge encrypted buffer
#define | XLT_DATE_READ_ENC_DATA_SIZE 76
the length of the encrypted buffer containing encrypted date info

Typedefs

typedef struct _XLT_DATE_DATA | XLT_DATE_DATA
typedef struct
_XLT_DATE_SET_EXPIRATION_CMD 		XLT_DATE_SET_EXPIRATION_CMD
typedef struct
_XLT_DATE_SIGNED_DATE_CMD 		XLT_DATE_SIGNED_DATE_CMD
typedef union _XLT_D_INFO | XLT_D_INFO
#define | XLT_DATE_STOP_FOR_DATE_EXPIRATION 0x01
Date reason for device halting This value is a mask of bits returned by stop_reason field in the structure XLT_DATE_DATA.
#define | XLT_DATE_STOP_FOR_UPDATE_MAX_ERROR 0x02
the number of allowed error during time update was passed.
#define | XLT_DATE_STOP_FOR_NORMAL_UPDATE_TIME_OUT_MAX_ERROR 0x04
the number of missing time update was passed (too long time without date update).
#define | XLT_DATE_STOP_FOR_SIGNED_UPDATE_TIME_OUT_MAX_ERROR 0x08
the number of missing signed time update was passed (too long time without signed date update).
typedef struct _XLT_DATE_CHALLENGE | XLT_DATE_CHALLENGE

Detailed Description

Data structures and defines for the management of the XLight time based license management.

Define Documentation

#define XLT_DATE_STOP_FOR_DATE_EXPIRATION 0x01

Date reason for device halting This value is a mask of bits returned by stop_reason field in the structure XLT_DATE_DATA.

the license time is expired.

Typedef Documentation

XLT_DATE_DATA
See also:
_XLT_DATE_DATA
XLT_DATE_CHALLENGE
See also:
_XLT_DATE_CHALLENGE
XLT_DATE_SET_EXPIRATION_CMD
See also:
_XLT_DATE_SET_EXPIRATION_CMD
XLT_DATE_SIGNED_DATE_CMD
See also:
_XLT_DATE_SIGNED_DATE_CMD
XLT_D_INFO
See also:
_XLT_D_INFO


Data Structures | Modules | Typedefs
XLT_DATE_INFO structure
Date structures

Contains the data retrieved by the function xlt_date_enc_retrieve() and consist of date info retrieved from a XLight device or from an encrypted command to be sent to the device. More...

Data Structures

struct | _XLT_DATE_INFO
Date info retrieved from a XLight device. More...

Modules

XLT_DATE_INFO data types

These are the value types associated to the data contained int the structure XLT_TIMER_COUNTER_INFO.

Typedefs

typedef struct _XLT_DATE_INFO | XLT_DATE_INFO
Date info retrieved from a XLight device.

Detailed Description

Contains the data retrieved by the function xlt_date_enc_retrieve() and consist of date info retrieved from a XLight device or from an encrypted command to be sent to the device.


Defines
XLT_DATE_INFO data types
XLT_DATE_INFO structure

These are the value types associated to the data contained int the structure XLT_TIMER_COUNTER_INFO. More...

Defines

#define | XLT_DATE_TYPE_UNKNOWN 0
Unknown data.
#define | XLT_DATE_TYPE_SET_EXPIRATION_CMD 1
set date expiration command.
#define | XLT_DATE_TYPE_SIGNED_DATE_CMD 2
set signed date command.
#define | XLT_DATE_TYPE_DATA 3
data containing information and settings of a date expiration management.
#define | XLT_DATE_TYPE_CHALLENGE 4
challenge data from Xlight device needed to issue a set signed date command.

Detailed Description

These are the value types associated to the data contained int the structure XLT_TIMER_COUNTER_INFO.


Defines
Date management commands
Date structures

Date management commands of the xlt_date_manage() function. More...

Defines

#define | XLT_DATE_MANAGE_AUTO_START 1
start the automatic date management.
#define | XLT_DATE_MANAGE_AUTO_STOP 2
terminate the automatic date management.
#define | XLT_DATE_MANAGE_DO_SET_TIME 3
immdiately run date update onto the attached devices.
#define | XLT_DATE_MANAGE_DO_SET_TIME_ASYNC 4
immdiately start the date update onto the attached devices but not wait for completion.
#define | XLT_DATE_MANAGE_DO_SET_TIME_RESULT 5
get the status result of the execution xlt_date_manage() called with command argument XLT_DATE_MANAGE_DO_SET_TIME_ASYNC.
#define | XLT_DATE_MANAGE_CLEAN_STATE 6
cleanup the thread management status (that is the value retrieved using XLT_DATE_MANAGE_DO_SET_TIME_RESULT).
#define | XLT_DATE_MANAGE_SET_IDLE_TIME_SEC 7
set the idle timeout for the thread management (better not to choose less than 60 seconds and no more the half of the time refresh neeeded for the device time). Don't change this value if not needed.
#define | XLT_DATE_MANAGE_MAKE_LOGS 8
start or stop the log of the date management thread.
#define | XLT_DATE_MANAGE_CLEAN_LOG 9
cleanup logs.
#define | XLT_DATE_MANAGE_LOG_ONLY_ERROR 10
set or reset the log trace only for failed operation.
#define | XLT_DATE_MANAGE_LOG_SET_QUEUE_LEN 11
set the maximum number of the log records kept in memory (max 10000 records).

Detailed Description

Date management commands of the xlt_date_manage() function.


Defines
Options update values
Date structures

These are the options values of the xlt_date_manage() function when called with the following command arguments: More...

Defines

#define | XLT_DATE_OPT_USE_LOCAL_TIME 0x1
the automatic date management thread (when needed) updates the date of the device using the time of the computer .
#define | XLT_DATE_OPT_USE_INTERNET_TIME 0x2
the automatic date management thread (when needed) updates the date of the device using internet time (NTP: Network Time Protocol).
#define | XLT_DATE_OPT_USE_INTERNET_SIGNED_TIME 0x4
the automatic date management thread (when needed) updates the signed date using the OxySec service.
#define | XLT_DATE_OPT_IMMEDIATELY_USE_LOCAL_TIME 0x40
the automatic date management thread immediately update the date of the device just after being started (also if not strictly necessary).
#define | XLT_DATE_OPT_IMMEDIATELY_USE_INTERNET_TIME 0x80
the automatic date management thread immediately update the date of the device just after being started using NTP (also if not strictly necessary).
#define | XLT_DATE_OPT_IMMEDIATELY_USE_INTERNET_SIGNED_TIME 0x100
the automatic date management thread immediately update the signed date of the device just after being started (also if not strictly necessary).
#define | XLT_DATE_OPT_USE_INTERNET_TIME_FOR_SCHEDULING_TASKS 0x200
this setting doesn't allow to use local time for library scheduling (the local time wont' be used at all).

Detailed Description

These are the options values of the xlt_date_manage() function when called with the following command arguments:

  • XLT_DATE_MANAGE_AUTO_START
  • XLT_DATE_MANAGE_DO_SET_TIME
  • XLT_DATE_MANAGE_DO_SET_TIME_ASYNC

These values can be used together as bitmask.


Data Structures | Modules | Defines | Typedefs
Log information
Date structures

The function xlt_date_manage_get_log_records() returns log info related to the activity of the automatic thread management (. More...

Data Structures

struct | _XLT_DATE_LOG
Log structure This is the structure containing the log info produced by the automatic date management. More...

Modules

Log action values

The entry action of the structure XLT_DATE_LOG assumes the following values describing in which context an event or an error occurred.

Defines

#define | LOG_ACTION_GET_DATE_INFO 1
event or error while getting date info from the device
#define | LOG_ACTION_SIGNED_TIME 2
event or error while attempting to perform the signed date update procedure
#define | LOG_ACTION_NTP_TIME 3
event or error while getting the internet time
#define | LOG_ACTION_LOCAL_TIME 4
event or error while setting the date to the device using local time

Typedefs

typedef struct _XLT_DATE_LOG | XLT_DATE_LOG
Log structure This is the structure containing the log info produced by the automatic date management.

Detailed Description

The function xlt_date_manage_get_log_records() returns log info related to the activity of the automatic thread management (.

See also:
xlt_date_manage()).

Typedef Documentation

typedef struct _XLT_DATE_LOG XLT_DATE_LOG

Log structure This is the structure containing the log info produced by the automatic date management.

The function xlt_date_manage_get_log_records() returns an array of this structure.


Log action values
Log information

The entry action of the structure XLT_DATE_LOG assumes the following values describing in which context an event or an error occurred. More...

The entry action of the structure XLT_DATE_LOG assumes the following values describing in which context an event or an error occurred.


Defines
Release Features
Date structures

List of the minimum supporting version for each new feature introduced by the XLight releases. More...

Defines

#define | LOCK2_AVAILABLE_MIN_VERSION_ON_MODEL_BASIC_USBHID 0x101
minimum XLight version that support the Lock2 feature on basic XLight devices.
#define | RSA_AVAILABLE_MIN_VERSION_ON_MODEL_BASIC_USBHID 0x200
minimum XLight version that support the RSA feature on basic XLight devices.
#define | SESSION_KEY_AVAILABLE_MIN_VERSION_ON_MODEL_BASIC_USBHID 0x200
minimum XLight version that support the AES Session Key feature on basic XLight devices.
#define | SD_MEM_AVAILABLE_MIN_VERSION_ON_MODEL_BASIC_USBHID 0xffff
minimum XLight version that support the SD memory feature on basic XLight devices (no basic XLight device supports this feature).
#define | TIMER_AVAILABLE_MIN_VERSION_ON_MODEL_BASIC_USBHID 0x210
minimum XLight version that support timer and counter management on basic XLight devices.
#define | DATE_AVAILABLE_MIN_VERSION_ON_MODEL_BASIC_USBHID 0x220
minimum XLight version that support timer and counter management on basic XLight devices.
#define | LOCK2_AVAILABLE_MIN_VERSION_ON_MODEL_USBHID_SD 0x100
minimum XLight version that support the Lock2 feature on XLight SD devices.
#define | RSA_AVAILABLE_MIN_VERSION_ON_MODEL_USBHID_SD 0x100
minimum XLight version that support the RSA feature on XLight SD devices.
#define | SESSION_KEY_AVAILABLE_MIN_VERSION_ON_MODEL_USBHID_SD 0x100
minimum XLight version that support the AES Session Key feature on XLight SD devices.
#define | SD_MEM_AVAILABLE_MIN_VERSION_ON_MODEL_USBHID_SD 0x100
minimum XLight version that support the SD memory feature on XLight SD devices.
#define | TIMER_AVAILABLE_MIN_VERSION_ON_MODEL_USBHID_SD 0xffff
minimum XLight version that support timer and counter management on XLight SD devices.
#define | DATE_AVAILABLE_MIN_VERSION_ON_MODEL_USBHID_SD 0xffff
minimum XLight version that support timer and counter management on XLight SD devices.

Detailed Description

List of the minimum supporting version for each new feature introduced by the XLight releases.


Functions
XLight Api

Api functions for the communication between one or more XLight devices and the host PC. More...

Functions

int XLT_API | xlt_getinfo (unsigned int device, unsigned int *pversion, unsigned int *pmodel, unsigned int *pflags, unsigned int *pserial, unsigned char *label)
Return information about the selected device.
int XLT_API | xlt_setup (unsigned int device, const unsigned char *label, const unsigned char *password, const unsigned char *dongle_key, const unsigned char *cr_key)
Set the label, the password and the cryptographic keys of the device.
int XLT_API | xlt_locate (const unsigned char *label)
Find a device with the specified label.
int XLT_API | xlt_write (unsigned int device, const unsigned char *password, unsigned int bank, const unsigned char *data)
Write into a memory bank of the XLight device.
int XLT_API | xlt_read (unsigned int device, const unsigned char *password, unsigned int bank, unsigned char *data)
Read from a memory bank of the XLight device.
int XLT_API | xlt_bank_freeze (unsigned int device, const unsigned char *password, unsigned int bank)
Freeze a given memory bank.
int XLT_API | xlt_encrypt (unsigned int device, const unsigned char *plaintext, unsigned char *ciphertext)
Perform AES-256 encryption.
int XLT_API | xlt_decrypt (unsigned int device, const unsigned char *ciphertext, unsigned char *plaintext)
Perform AES-256 decryption.
int XLT_API | xlt_challenge (unsigned int device, const unsigned char *challenge, unsigned char *response)
Challenge-Response computation based on AES-256.
int XLT_API | xlt_session_set_key (unsigned int device, unsigned int key_index, const unsigned char *wrapped_key)
Load on a XLight device the session AES key to be used for AES session encryption functions.
int XLT_API | xlt_session_encrypt (unsigned int device, unsigned int key_index, const unsigned char *plaintext, unsigned char *ciphertext)
Encrypt data using a Session Key.
int XLT_API | xlt_session_decrypt (unsigned int device, unsigned int key_index, const unsigned char *ciphertext, unsigned char *plaintext)
Decrypt data using a Session Key.
int XLT_API | xlt_session_wrap_key (const unsigned char *session_key, const unsigned char *dongle_key, unsigned char *wrapped_key)
Wraps a Session Key.
int XLT_API | xlt_rsa_generate_key (unsigned int bit_size, unsigned char *private_key, unsigned int private_key_size, unsigned int *p_private_key_len, unsigned char *public_key, unsigned int public_key_size, unsigned int *p_public_key_len)
Generate an RSA key.
int XLT_API | xlt_rsa_wrap_privkey (const unsigned char *private_key, unsigned int private_key_length, const unsigned char *dongle_key, unsigned char *wrapped_key, unsigned int wrapped_key_len)
Wraps an RSA key.
int XLT_API | xlt_rsa_set_privkey (unsigned int device, const unsigned char *wrapped_key, unsigned int wrapped_key_length)
Load an RSA private key onto an XLight device.
int XLT_API | xlt_never_use_this_rsa_encrypt (const unsigned char *public_key, unsigned int public_key_len, const unsigned char *plaintext, unsigned int plaintext_ciphertext_length, unsigned char *ciphertext)
Performs RSA encryption.
int XLT_API | xlt_never_use_this_rsa_sw_decrypt (const unsigned char *private_key, unsigned int private_key_len, const unsigned char *ciphertext, unsigned int ciphertext_plaintext_length, unsigned char *plaintext)
Performs a software RSA decryption.
int XLT_API | xlt_rsa_decrypt (unsigned int device, const unsigned char *ciphertext, unsigned int ciphertext_plaintext_length, unsigned char *plaintext)
Runs an RSA decryption onto an XLight device.
int XLT_API | xlt_bank_lock (unsigned int device, const unsigned char *password, unsigned int bank, unsigned int group_number)
Lock a memory bank.
int XLT_API | xlt_bank_lock2 (unsigned int device, const unsigned char *password, unsigned int bank, unsigned int group_number)
Lock a memory bank in advanced mode (Lock2).
int XLT_API | xlt_write_locked (unsigned int device, unsigned int bank, const unsigned char *transfer_data)
Perform a write operation in a locked bank (both normal and advanced Lock2 mode).
int XLT_API | xlt_read_locked (unsigned int device, unsigned int bank, unsigned char *transfer_data)
Perform a read operation in a locked bank (both normal and advanced Lock2 mode).
int XLT_API | xlt_set_write_locked_serial_check (const unsigned char *data, unsigned int bank, unsigned int new_counter, unsigned int serial, const unsigned char *dongle_key, unsigned char *transfer_data)
Encrypt the buffer to be written into a locked bank of a specific XLight device.
int XLT_API | xlt_set_write_locked2_serial_check (const unsigned char *data, unsigned int bank, unsigned int new_counter, unsigned int serial, const unsigned char *dongle_key, unsigned char *transfer_data)
Encrypt the buffer to be written into a bank locked with Lock2 of a specific XLight device.
int XLT_API | xlt_set_write_locked_group_check (const unsigned char *data, unsigned int bank, unsigned int new_counter, unsigned int group_number, const unsigned char *dongle_key, unsigned char *transfer_data)
Encrypt the buffer to be written into a locked bank belonging to an XLight devices of a given group.
int XLT_API | xlt_set_write_locked2_group_check (const unsigned char *data, unsigned int bank, unsigned int new_counter, unsigned int group_number, const unsigned char *dongle_key, unsigned char *transfer_data)
Encrypt the buffer to be written into a bank locked with Lock2 belonging to an XLight devices of a given group.
int XLT_API | xlt_decrypt_locked_data (const unsigned char *transfer_data, const unsigned char *dongle_key, unsigned char *data)
Retrieve the data in clear form of the content of a locked memory bank.
int XLT_API | xlt_decrypt_locked2_data (const unsigned char *transfer_data, const unsigned char *dongle_key, unsigned char *data)
Retrieve the data in clear form of the content of a locked with Lock2 memory bank.
int XLT_API | xlt_get_info_from_locked_bank (const unsigned char *data, unsigned int *pbank, unsigned int *pcounter, unsigned int *pserial, unsigned int *pgroup_number)
Return information of a locked bank (both normal and advanced Lock2 mode).
int XLT_API | xlt_virg_demo (unsigned int device)
Virginize (reset) a demo XLight device.
void XLT_API | xlt_close ()
Cleanup the allocated memory by the XLight functions.
int XLT_API | xlt_init ()
Initialize the environment for XLight management.
int XLT_API | xlt_storage_get_mem_size (unsigned int device, unsigned int *p_mem_size_in_blocks, unsigned int *p_enc_mem_size_in_blocks)
Get memory size information of the memory flash in XLight SD devices.
int XLT_API | xlt_storage_set (unsigned int device, unsigned int locked_mem_size_in_blocks, const unsigned char *dongle_key, const unsigned char *disk_password)
Initialize the memory flash of an XLight SD device.
int XLT_API | xlt_storage_unlock (unsigned int device, const unsigned char *disk_password)
Mount the encrypted disk of an XLight SD device.
int XLT_API | xlt_storage_unlock_ro (unsigned int device, const unsigned char *disk_password)
Mount the encrypted disk of an XLight SD device with read only access.
int XLT_API | xlt_storage_lock (unsigned int device, const unsigned char *disk_password)
Unmount the encrypted disk of an XLight SD device.
int XLT_API | xlt_update_get_counter (unsigned int device, unsigned int counter, unsigned int sub_value, unsigned int *p_new_value)
Update and get the value of a counter.
int XLT_API | xlt_get_timer (unsigned int device, unsigned int *p_value)
Retrieve the current value of the timer.
int XLT_API | xlt_generate_counter_settings (const XLT_COUNTER_CMD *counter_cmd, const unsigned char *dongle_key, unsigned char *enc_cmd, unsigned int enc_cmd_size, unsigned int *p_enc_cmd_len)
Generate a command buffer to a set a counter.
int XLT_API | xlt_generate_timer_settings (const XLT_TIMER_CMD *timer_cmd, const unsigned char *dongle_key, unsigned char *enc_cmd, unsigned int enc_cmd_size, unsigned int *p_enc_cmd_len)
Generate a command buffer to a set the timer.
int XLT_API | xlt_generate_timer_add_settings (const XLT_TIMER_ADD_CMD *timer_add_cmd, const unsigned char *dongle_key, unsigned char *enc_cmd, unsigned int enc_cmd_size, unsigned int *p_enc_cmd_len)
Generate a command buffer to increase the timer value.
int XLT_API | xlt_enc_apply_timer_counter (unsigned int device, const unsigned char *enc_cmd, unsigned int enc_cmd_len)
Apply a timer or counter command onto the device.
int XLT_API | xlt_enc_read_counters (unsigned int device, unsigned char *enc_data, unsigned int enc_data_size, unsigned int *p_enc_data_len)
Read in encrypted form the current state of all the counters of the device.
int XLT_API | xlt_enc_read_timer (unsigned int device, unsigned char *enc_data, unsigned int enc_data_size, unsigned int *p_enc_data_len)
Read in encrypted form the current state the device timer.
int XLT_API | xlt_timer_counters_retrieve (const unsigned char *enc_data, unsigned int enc_data_len, const unsigned char *dongle_key, XLT_TIMER_COUNTER_INFO *retrieved_data)
Decrypt encrypted data from the device regarding timer or counters.
int XLT_API | xlt_enc_read_date (unsigned int device, unsigned char *enc_data, unsigned int enc_data_size, unsigned int *p_enc_data_len)
Read in encrypted form the current state of the date license management of the device.
int XLT_API | xlt_read_date (unsigned int device, XLT_DATE_DATA *date_info)
Read the current state of the date license management of the device.
int XLT_API | xlt_set_date (unsigned int device, unsigned int time)
Set the current time (date) of the device.
int XLT_API | xlt_date_get_challenge (unsigned int device, unsigned char *enc_challenge, unsigned int enc_challenge_size, unsigned int *p_enc_challenge_len)
Retrieve the challenge buffer generated by the XLight device for update signed update (Signed date update constraint) The challenge buffer need to be used for setting the signed date onto the device See Date based licensing for an introduction to XLight license management based on the date.
int XLT_API | xlt_generate_date_expiration_cmd (const XLT_DATE_SET_EXPIRATION_CMD *cmd, const unsigned char *dongle_key, unsigned char *enc_cmd, unsigned int enc_cmd_size, unsigned int *p_enc_cmd_len)
Generate the license date expiration command See Date based licensing for an introduction to XLight license management based on the date (and the SetDateExpiration for an example of xlt_generate_date_expiration_cmd() usage).
int XLT_API | xlt_generate_signed_date_cmd (unsigned int time, const unsigned char *challenge, unsigned int challenge_len, const unsigned char *dongle_key, unsigned char *enc_cmd, unsigned int enc_cmd_size, unsigned int *p_enc_cmd_len)
Generate the signed date command.
int XLT_API | xlt_apply_date_enc_cmd (unsigned int device, const unsigned char *enc_cmd, unsigned int enc_cmd_len)
Apply both license expiration setting and signed date update to the XLight device.
int XLT_API | xlt_date_enc_retrieve (const unsigned char *enc_data, unsigned int enc_data_len, const unsigned char *dongle_key, XLT_DATE_INFO *retrieved_data)
Decrypt the encrypted data returned by the device regarding the date license settings.
int XLT_API | xlt_date_manage (unsigned int cmd, unsigned int device, unsigned int options, const char *args, const unsigned char *label)
Date management function.
int XLT_API | xlt_date_manage_get_num_log_records (unsigned int *p_num_entries)
Retrieve the number of log records collected by the automatic date management process issued by xlt_date_manage().
int XLT_API | xlt_date_manage_get_log_records (unsigned int starting_index, unsigned int num_entries, XLT_DATE_LOG date_log[], unsigned int *p_num_entries_retrieved)
Retrieve log records collected by the automatic date management process issued by xlt_date_manage().

Detailed Description

Api functions for the communication between one or more XLight devices and the host PC.

Every function is almost thread safe. Here 'almost' means that the functions are thread safe with the following exceptions:

  1. xlt_close() is not thread safe.
  2. The first api call is not thread safe, that is the first call makes the library to run its inner context initialization. This is not a thread safe operation. This operation is done only from the first call, so all subsequent calls may be done concurrently (except xlt_close()) from different threads.
  3. Concurrency is (almost) always technically possible, and the USB communication is queued, but it must be done with care: for instance run concurrently instances of xlt_write_locked() on the same device will lead to an error (the second call will fail). Accessing different devices can be done without any concerns.

The APIs can be used simultaneously also by different processes communicating with the same device and the consideration '3' above holds as well.

Function Documentation

int XLT_API xlt_getinfo | ( | unsigned int | device,
 |  | unsigned int * | pversion,
 |  | unsigned int * | pmodel,
 |  | unsigned int * | pflags,
 |  | unsigned int * | pserial,
 |  | unsigned char * | label
 | ) |  |

Return information about the selected device.

Parameters:
[in] | device | device index for the selection of a specific XLight device. This value runs from 0 to XLT_DEVICE_MAX -1.
[out] | pversion | points to an unsigned int where the version number of the device must be returned. If pversion is NULL this parameter is ignored.
[out] | pmodel | points to an unsigned int where the device model identification code must be returned. If pmodel is NULL this parameter is ignored.
[out] | pflags | points to an unsigned int where the Flags of the device must be returned. If pflags is NULL this parameter is ignored.
[out] | pserial | points to an unsigned int where the serial number of the device must be returned. If pserial is NULL this parameter is ignored.
[out] | label | points to the memory location where the label of the device must be returned. If label is NULL this parameter is ignored.
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
Remarks:
each device is associated to a unique device number and must be used by every function (except xlt_locate()) to address the device. The user must not rely on this number to infer the order of insertion or the physical position of an XLight device in the USB HUB of the host computer.
Example
        #include "xlt.h"
        #include <stdio.h>
        #include <string.h>

    ...
        int status;
        unsigned int version;
        unsigned int model;
        unsigned int flags;
        unsigned int serial;
        unsigned char label_printable[XLT_LABEL_SIZE + 1];
        int i;
        unsigned int device;

        for(device = 0; device < XLT_DEVICE_MAX; device++){
                status = xlt_getinfo(device, &version, &model, &flags, &serial, label_printable);
                if (status == XLT_ERROR_NOT_FOUND)
                        printf("Device not found at index %d!\n", device);
                else if (status != XLT_ERROR_SUCCESS)
                        printf("An error has occurred!\n");
                else {
                        printf("An XLight device was found plugged into the logical port %d", device);
                        printf("Version: %x.%02x\n", version >> 8, version & 0xFF);
                        if (model != XLT_MODEL_BASIC_USBHID)
                                printf("Unrecognized model!\n");
                        if (flags & XLT_FLAG_SETUP){
                                printf("The device is initialized\n");
                                for(i = 0; i < XLT_NUMBER_OF_BANKS; i++){
                                        if (flags & (XLT_FLAG_FROZEN_BANK0 << i))
                                                printf("Bank %d frozen\n", i);
                                }
                        }
                        else
                                printf("The device is NOT initialized\n");

                        printf("The device Serial Number is: 0x%x\n", serial);
                        label_printable[XLT_LABEL_SIZE] = 0;
                        //N.B.: a label may contain not printable character
                        printf("Label: %s\n", (char*) label_printable);
                }
        }
        ...

int XLT_API xlt_setup | ( | unsigned int | device,
 |  | const unsigned char * | label,
 |  | const unsigned char * | password,
 |  | const unsigned char * | dongle_key,
 |  | const unsigned char * | cr_key
 | ) |  |

Set the label, the password and the cryptographic keys of the device.

Warning! This function can be executed only once! All the subsequent calls will fail.

Note:
this function produces an irreversible setting onto the XLight device, hence use it very carefully.
Parameters:
[in] | device | device index for the selection of a specific XLight device. This value runs from 0 to XLT_DEVICE_MAX -1.
[in] | label | points to a buffer of length XLT_LABEL_SIZE. It contains the label, that is the identification name to be assigned to the device.
[in] | password | points to a buffer of length XLT_PASSWORD_SIZE. It contains the password to be assigned to the device.
[in] | dongle_key | points to a buffer of length XLT_KEY_SIZE. It contains Dongle Key: the AES-256 key that will be used, for instance, by the functions xlt_encrypt() and xlt_decrypt().
[in] | cr_key | points to a buffer of length XLT_KEY_SIZE. It contains an AES-256 key (Challenge Key) that will be used by the functions xlt_challenge().
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
Remarks:
password, dongle_key (the Dongle Key) and cr_key (the Challenge Response Key or shortly Challenge Key) are optional arguments and they can be set to 0 (NULL). Whenever one of these entry is null it is considered as if it was an array of bytes filled with the value 0xFF (255 decimal). In other word, passing NULL is equivalent of passing a 0xFF bytes array.
Note:
though password, Dongle Key and Challenge Key are optional, it is strongly recommended to set them with non trivial values to forbid memory access (using password) to unauthorized application, and to allow the protected application to make sure of the presence of the XLight device (using Challenge Key) which constitutes the key point of the software protection.
before calling xlt_setup() a device is in a non initialized state. In this context only the functions xlt_getinfo() and xlt_close() work.
Never put Dongle Key inside the protected application. This is a key on which many security features are based on, inserting it inside the protected application may yield fundamental information to hackers for emulating the XLight device also in its more advanced feaures.
Example
        #include "xlt.h"
        #include <stdio.h>

        ...

        int status;
        unsigned char label[XLT_LABEL_SIZE];
        unsigned char password[XLT_PASSWORD_SIZE];
        unsigned char dongle_key[XLT_KEY_SIZE];
        unsigned char challenge_response_key[XLT_KEY_SIZE];

        ...

        //xlt_setup set label, password, user and challenge response keys (dongle_key and challenge_response_key) once for all.
        //Only label must be specified, but it is strongly recommeded to set password, dongle_key, challenge_response_key as well
        //with non trivial (random) values and keep them secret.

        //BEWARE: label, password, dongle_key and challenge_response_key are not strings but arrays,
        //so fill them up to their entire size

        strcpy((char*)label, "My XLight label");
        memset(label + strlen("My XLight label"), 0x00, sizeof(label) - strlen("My XLight label"));

        ...

        status = xlt_setup(0, label, password, dongle_key, challenge_response_key);
        if (status != XLT_ERROR_SUCCESS){
                printf("An error has occurred");
        }
int XLT_API xlt_locate ( const unsigned char * label )

Find a device with the specified label.

Parameters:
[in] label buffer of length XLT_LABEL_SIZE. Note that the comparison uses the whole size of the label, so the Label must not be considered as a string but as an array of characters of length XLT_LABEL_SIZE.
Returns:
returns a value less than 0 if the label is not found, otherwise its index is returned. This index number must be used by any other function to access the device. This index is passed as the argument named device.
Remarks:
xlt_locate() is useful for easy access to a device, but if more than one device sharing the same label are plugged into the computer it's impossible to use this function for accessing all devices. Consider using a different way as shown in the example of xlt_getinfo(), where all the plugged devices are enumerated.
Example
        int device;
        unsigned char label[XLT_LABEL_SIZE];

        strcpy((char*)label, "My XLight label");
        memset(label + strlen("My XLight label"), 0x00, sizeof(label) - strlen("My XLight label"));

        device = xlt_locate(label);
        if (device >= 0)
                printf("XLight device found at index %d\n", device);
        else
                printf("XLight device NOT found\n");
        ...

int XLT_API xlt_write | ( | unsigned int | device,
 |  | const unsigned char * | password,
 |  | unsigned int | bank,
 |  | const unsigned char * | data
 | ) |  |

Write into a memory bank of the XLight device.

Parameters:
[in] | device | device index for the selection of a specific XLight device. This value runs from 0 to XLT_DEVICE_MAX -1.
[in] | password | points to a buffer of length XLT_PASSWORD_SIZE that contains the password assigned to the device.
[in] | bank | the index of the memory bank that must be written.
[in] | data | points to a buffer of size XLT_BANK_SIZE containing the data to be written into the memory.
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
Remarks:
the password entry must be the same that was used in xlt_setup() call. If it was NULL, it must be NULL also in xlt_write().
Example
        ...
        int status;
        unsigned int device = 0;
        unsigned char password[XLT_PASSWORD_SIZE];
        unsigned char data[XLT_BANK_SIZE];

        //BEWARE: data, is not a  not string but an array,
        //so fill it up to its entire size
        strcpy((char*)data, "Some data");
        memset(data + strlen("Some data"), 0x00, sizeof(data) - strlen("Some data"));

        strcpy((char*)password, "My password");
        memset(password + strlen("My password"), 0x00, sizeof(password) - strlen("My password"));

        //write in bank 0 of an XLight dongle indexed by device = 0
        status = xlt_write(device, password, 0, data);
        if (status != XLT_ERROR_SUCCESS){
                printf("An error has occurred\n");
        }
        ...

int XLT_API xlt_read | ( | unsigned int | device,
 |  | const unsigned char * | password,
 |  | unsigned int | bank,
 |  | unsigned char * | data
 | ) |  |

Read from a memory bank of the XLight device.

Parameters:
[in] | device | device index for the selection of a specific XLight device. This value runs from 0 to XLT_DEVICE_MAX -1.
[in] | password | points to a buffer of length XLT_PASSWORD_SIZE that contains the password assigned to the device.
[in] | bank | the index of the memory bank that must be read.
[out] | data | points to a buffer of size XLT_BANK_SIZE that will receive the data read from the adressed memory bank.
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
Remarks:
the password entry must be the same that was used in xlt_setup() call. If it was NULL, it must be NULL also in xlt_read().
Example
        ...
        int status;
        unsigned int device = 0;
        unsigned char password[XLT_PASSWORD_SIZE];
        unsigned char data[XLT_BANK_SIZE];

        strcpy((char*)password, "My password");
        memset(password + strlen("My password"), 0x00, sizeof(password) - strlen("My password"));

        //read from bank 0 of an XLight dongle
        status = xlt_read(device, password, 0, data);
        if (status != XLT_ERROR_SUCCESS){
                printf("An error has occurred\n");
        }
        else {
                //N.B.: the data banks may contain not printable character
                //(and in general it makes no sense print out memory content, this is just an example)
                printf("Bank 0 data: %s\n", (char*)data);
        }
        ...

int XLT_API xlt_bank_freeze | ( | unsigned int | device,
 |  | const unsigned char * | password,
 |  | unsigned int | bank
 | ) |  |

Freeze a given memory bank.

After freezing it won't be possible write inside the given bank any longer.

Note:
this function produces an irreversible setting onto the XLight device, hence use it very carefully.
Parameters:
[in] | device | device index for the selection of a specific XLight device. This value runs from 0 to XLT_DEVICE_MAX -1.
[in] | password | points to a buffer of length XLT_PASSWORD_SIZE that contains the password assigned to the device.
[in] | bank | the index of the memory bank that must be frozen.
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
Remarks:
the password entry must be the same that was used in xlt_setup() call. If it was NULL, it must be NULL also in xlt_bank_freeze().
Example
        ...
        int status;
        unsigned int device = 0;
        unsigned char password[XLT_PASSWORD_SIZE];

        strcpy((char*)password, "My password");
        memset(password + strlen("My password"), 0x00, sizeof(password) - strlen("My password"));

        //freeze the bank 0 of a XLight dongle
        //BEWARE: after the freeze the memory content of the bank 0 can't be modified any longer
        status = xlt_bank_freeze(device, password, 0);
        if (status != XLT_ERROR_SUCCESS){
                printf("An error has occurred\n");
        }
        ...

int XLT_API xlt_encrypt | ( | unsigned int | device,
 |  | const unsigned char * | plaintext,
 |  | unsigned char * | ciphertext
 | ) |  |

Perform AES-256 encryption.

Parameters:
[in] | device | device index for the selection of a specific XLight device. This value runs from 0 to XLT_DEVICE_MAX -1.
[in] | plaintext | points to the buffer of length XLT_CIPHERTEXT_SIZE containing the plaintext to encrypt.
[out] | ciphertext | points to the buffer of length XLT_CIPHERTEXT_SIZE receiving the encrypted result.
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
Note:
the encryption function uses as cryptographic key the Dongle Key entry set by xlt_setup().
We strongly recommend never to put Dongle Key in the protected application. Use Dongle Key to encrypt data, but not for authentication process like discussed in xlt_challenge() documentation.
Example
        ...
        int status;
        unsigned int device = 0;
        unsigned char plaintext[XLT_CIPHERTEXT_SIZE];
        unsigned char ciphertext[XLT_CIPHERTEXT_SIZE];

        //collect data to be encrypted
        ...
        status = xlt_encrypt(device, plaintext, ciphertext);
        if (status == XLT_ERROR_SUCCESS){
                //ciphertext now contains the encryption of plaintext using AES 256 with key dongle_key passed to xlt_setup()
                ...
        }
        ...
Another example just to show that xlt_decrypt() is the inverse of xlt_encrypt()
        ...
        int status;
        unsigned int device = 0;
        unsigned char plaintext[XLT_CIPHERTEXT_SIZE];
        unsigned char ciphertext[XLT_CIPHERTEXT_SIZE];
        unsigned char retplaintext[XLT_CIPHERTEXT_SIZE];

        //data to be encrypted (you can insert what you prefer)
        plaintext[0] = 0x01; plaintext[1] = 0xa2; plaintext[2] = 0x62; plaintext[3] = 0x31;
        plaintext[4] = 0x20; plaintext[5] = 0x36; plaintext[6] = 0x8b; plaintext[7] = 0x09;
        plaintext[8] = 0x45; plaintext[9] = 0x31; plaintext[10] = 0x7c; plaintext[11] = 0x18;
        plaintext[12] = 0x25; plaintext[13] = 0x81; plaintext[14] = 0x6b; plaintext[15] = 0xaa;

        status = xlt_encrypt(device, plaintext, ciphertext);
        if (status != XLT_ERROR_SUCCESS){
                printf("Encryption failed!\n");
        }
        else {
                //ciphertext now contains the encryption of plaintext using AES 256 with key dongle_key passed to xlt_setup()
                status = xlt_decrypt(device, ciphertext, retplaintext);
                if (status == XLT_ERROR_SUCCESS &&
                        memcmp(plaintext, retplaintext, XLT_CIPHERTEXT_SIZE) == 0){
                                printf("OK: returned the original plaintext\n");
                }
                else {
                        printf("Decryption failed!\n");
                }
        }
    ...

int XLT_API xlt_decrypt | ( | unsigned int | device,
 |  | const unsigned char * | ciphertext,
 |  | unsigned char * | plaintext
 | ) |  |

Perform AES-256 decryption.

Parameters:
[in] | device | device index for the selection of a specific XLight device. This value runs from 0 to XLT_DEVICE_MAX -1.
[in] | ciphertext | points to the buffer of length XLT_CIPHERTEXT_SIZE containing the ciphertext to be decrypted.
[out] | plaintext | points to the buffer of length XLT_CIPHERTEXT_SIZE containing the result of the decryption.
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
Remarks:
this function is the inverse of xlt_encrypt(), that is from ciphertext it returns the original plaintext passed to xlt_encrypt().
Note:
the decryption function uses as cryptographic key the Dongle Key entry set by xlt_setup().
Example
        ...
        int status;
        unsigned int device = 0;
        unsigned char ciphertext[XLT_CIPHERTEXT_SIZE];
        unsigned char ret_plaintext[XLT_CIPHERTEXT_SIZE];

        //collect data to be decrypted
        ...
        status = xlt_decrypt(device, ciphertext, ret_plaintext);
        if (status == XLT_ERROR_SUCCESS){
                //ret_plaintext now contains the decryption of ciphertext using AES 256 with key dongle_key set passed to xlt_setup()
                ...
        }
        ...

int XLT_API xlt_challenge | ( | unsigned int | device,
 |  | const unsigned char * | challenge,
 |  | unsigned char * | response
 | ) |  |

Challenge-Response computation based on AES-256.

The protected software send a value and check that the outcome is as expected.

Parameters:
[in] | device | device index for the selection of a specific XLight device. This value runs from 0 to XLT_DEVICE_MAX -1.
[in] | challenge | points to the buffer of length XLT_CIPHERTEXT_SIZE containing the challenge data.
[out] | response | points to the buffer of length XLT_CIPHERTEXT_SIZE receiving the response.
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
Note:
the Challenge-Response mechanism uses as cryptographic key the cr_key (Challenge Response Key) entry set by xlt_setup().
Remarks:
the challenge response mechanism is a sort of proof of identity without exposing details to eavesdroppers on the USB communication or on the dll interface. It is based onto the AES-256 encryption and the verifier inside the protected program must know the key used by the device. A good hacker debugging the code can come up to the encryption key, so the best policy is to make this task hard trying to hide the key: for instance preparing the challenge and evaluating the response far from the code communicating with the dongle. The example below is not a good example from this point of view and it must be considered just as an example. xlt_challenge() works in the same way of xlt_encrypt() but using a different AES key.
Note:
Another possible and better way is to calculate many pairs challenge-presponse in a safe environment (i.e. not in the protected application) and use such pairs to verify the response of the dongle. This method avoid the exposure of the Challenge Response Key.
Example
        ...
        #include <windows.h>
        #include "aes.h"
        ...
        int status;
        unsigned int device = 0;
        unsigned char challenge[XLT_CIPHERTEXT_SIZE];
        unsigned char response[XLT_CIPHERTEXT_SIZE];
        unsigned char expected_response[XLT_CIPHERTEXT_SIZE];
        unsigned char cr_key[XLT_KEY_SIZE];
        volatile unsigned char* c;
        int i;
        aes_ctx aes_ctx;

        //compute the challenge (if possible always a new value)
        srand(GetTickCount());
        for (i=0; i < XLT_CIPHERTEXT_SIZE; i++)
                //it's better to use a cryptographic safe random generator (rand() is easy but not good)
                challenge[i] = (unsigned char)rand();

        //challenge uses AES 256 encryption algorithm with key cr_key passed to xlt_setup()
        status = xlt_challenge(device, challenge, response);
        if (status != XLT_ERROR_SUCCESS){
                printf("Challenge Response failed!\n");
                //take the due action (halt execution)
        }
        else {
                //check if the response is as expected (if not, the attached device is not what you expect to be!)
                // we strongly recommend to perform the following check far and later from the xlt_challenge() call above,
                //this makes the hacking job harder.
                for(i = 0; i < XLT_KEY_SIZE; i++){
                        cr_key[i]=(unsigned char)i*2;
                }
                //AES encryption key setup
                aes_setkey(cr_key, XLT_KEY_SIZE, aes_enc, &aes_ctx);
                c = cr_key;
                for(i = 0; i < XLT_KEY_SIZE; i++){//cleanup
                        *c++ = 0;
                }

                //AES encryption execution prototype:
                //int aes_encrypt(const unsigned char* plaintext, unsigned char* ciphertext, const aes_ctx* ctx);
                aes_encrypt(challenge, expected_response, &aes_ctx);
                c = (unsigned char*) &aes_ctx;
                for(i = 0; i < sizeof(aes_ctx); i++){//cleanup
                        *c++ = 0;
                }

                if (memcmp(expected_response, response, XLT_CIPHERTEXT_SIZE) != 0){
                        //the device has not computed what we expected
                        printf("Challenge Response failed!\n");
                        //take the due action (halt execution)
                }
        }
        ...

int XLT_API xlt_session_set_key | ( | unsigned int | device,
 |  | unsigned int | key_index,
 |  | const unsigned char * | wrapped_key
 | ) |  |

Load on a XLight device the session AES key to be used for AES session encryption functions.

See AES Session Keys for an introduction on Session Key protection.

Parameters:
[in] | device | device index for the selection of a specific XLight device. This value runs from 0 to XLT_DEVICE_MAX -1.
[in] | key_index | index of the key to be used. This value runs from 0 to XLT_SESSION_NUMBER_OF_KEYS -1.
[in] | wrapped_key | points to the buffer of length XLT_KEY_SIZE containing the Session Key encrypted with Dongle Key.
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.

This function must be used to set the AES key that will be used by xlt_session_encrypt() and xlt_session_decrypt(). This cryptographic key must be passed in encrypted (wrapped) form depending on the Dongle Key. In oreder to produce the wrapped form of the Session Key use xlt_session_wrap_key(). It is possible to set XLT_SESSION_NUMBER_OF_KEYS sessin key simultaneously, with key_index it is possible to refer to one of these keys.

Note:
a Session Key is not permanent, it resides on the device as long as the dongle is plugged and powered, once the dongle is removed the key is deleted. This means that it must be loaded every time it must be used. The default value, that is just after the device is plugged, is a zero buffer. See here for a source code example using this function.

Supported version: this function is available on XLight devices version 2.0 or later.

See also:
xlt_session_encrypt(), xlt_session_decrypt() and xlt_session_wrap_key().

int XLT_API xlt_session_encrypt | ( | unsigned int | device,
 |  | unsigned int | key_index,
 |  | const unsigned char * | plaintext,
 |  | unsigned char * | ciphertext
 | ) |  |

Encrypt data using a Session Key.

See AES Session Keys for an introduction on Session Key protection.

Parameters:
[in] | device | device index for the selection of a specific XLight device. This value runs from 0 to XLT_DEVICE_MAX -1.
[in] | key_index | index of the key to be used. This value runs from 0 to XLT_SESSION_NUMBER_OF_KEYS -1.
[in] | plaintext | points to the buffer of length XLT_CIPHERTEXT_SIZE containing the data to be encrypted
[out] | ciphertext | points to the buffer of length XLT_CIPHERTEXT_SIZE that will receive the encrypted data.
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.

This function performs AES-256 encryption of a plaintext of length XLT_CIPHERTEXT_SIZE and inserts the ciphertext result in a buffer of the same length. The AES key is one of the eight Session Keys specified by the index key_index, and the corrisponding key was previously set by the xlt_session_decrypt() function.

See here for a source code example using this function.

Supported version: this function is available on XLight devices version 2.0 or later.

See also:
xlt_session_decrypt(), xlt_session_decrypt and xlt_session_wrap_key().
int XLT_API xlt_session_decrypt | ( | unsigned int | device,
 |  | unsigned int | key_index,
 |  | const unsigned char * | ciphertext,
 |  | unsigned char * | plaintext
 | ) |  |

Decrypt data using a Session Key.

See AES Session Keys for an introduction on Session Key protection.

Parameters:
[in] | device | device index for the selection of a specific XLight device. This value runs from 0 to XLT_DEVICE_MAX -1.
[in] | key_index | index of the key to be used. This value runs from 0 to XLT_SESSION_NUMBER_OF_KEYS -1.
[in] | ciphertext | points to the buffer of length XLT_CIPHERTEXT_SIZE containing the data to be decrypted.
[out] | plaintext | points to the buffer of length XLT_CIPHERTEXT_SIZE that will receive the decrypted data.
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.

This function performs AES-256 decryption of a ciphertext buffer with length of the block of the AES algorithm, that is a length of XLT_CIPHERTEXT_SIZE. The used key was set by a previous call of xlt_session_set_key().

Supported version: this function is available on XLight devices version 2.0 or later.

See also:
xlt_session_wrap_key().
int XLT_API xlt_session_wrap_key | ( | const unsigned char * | session_key,
 |  | const unsigned char * | dongle_key,
 |  | unsigned char * | wrapped_key
 | ) |  |

Wraps a Session Key.

See AES Session Keys for an introduction on Session Key protection.

Parameters:
[in] | session_key | points to the AES key that will be used by xlt_session_encrypt() and xlt_session_decrypt(). It's length is of XLT_KEY_SIZE bytes.
[in] | dongle_key | points to the value of the Dongle Key set up by xlt_setup() function.
[out] | wrapped_key | points to a memory buffer of length XLT_KEY_SIZE that will receive the wrapped version of key.
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
Note:
never use this function onto the protected software, in particular, never insert the Dongle Key into the protected software. This is an utility software to compute the wrapped version of a Session Key and must be done in an utility software not distributed to the final user. The Wrapped Key must be used onto the protected software and loaded onto the XLight dongle using xlt_session_set_key().
this function doesn't require any XLight device to be plugged in.

See here for a source code example using this function.

Supported version: this function is available on XLight devices version 2.0 or later.

See also:
xlt_session_set_key().
int XLT_API xlt_rsa_generate_key | ( | unsigned int | bit_size,
 |  | unsigned char * | private_key,
 |  | unsigned int | private_key_size,
 |  | unsigned int * | p_private_key_len,
 |  | unsigned char * | public_key,
 |  | unsigned int | public_key_size,
 |  | unsigned int * | p_public_key_len
 | ) |  |

Generate an RSA key.

See Asymmetric cryptography on XLight (RSA) for an introduction on the RSA protection in XLight.

Parameters:
[in] | bit_size | the length in bit of the key to generate. The possible values are XLT_RSA_512_BIT_SIZE and XLT_RSA_1024_BIT_SIZE.
[out] | private_key | points to the buffer that will receive the generated RSA private key formatted with XLight RSA Key format (Format of numbers and RSA key).
[in] | private_key_size | size of the private_key buffer. The size for a 1024 bit key is XLT_RSA_1024_PRIV_KEY_SIZE and the size for a 512 bit key is XLT_RSA_512_PRIV_KEY_SIZE.
[out] | p_private_key_len | points to an unsigned integer that will receive the actual length of the generated formatted private key.
[out] | public_key | points to the buffer that will receive the generated RSA public key formatted in XLight RSA Key format (Format of numbers and RSA key). If this parameter is NULL the public key is not retrieved.
[in] | public_key_size | size of the public_key buffer. The size for a 1024 bit key is XLT_RSA_1024_PUB_KEY_SIZE and the size for a 512 bit key is XLT_RSA_512_PUB_KEY_SIZE.
[out] | p_public_key_len | points to an unsigned integer that will receive the actual length of the generated formatted public key.
Returns:
XLT_ERROR_SUCCESS on success, an error code on failure.
Note:
this is an utility function that must be never used onto the protected software. Its purpose is RSA key generation and may be substituted by other software doing the same task. There are plenty of source code available in internet doing RSA key generation.

Supported version: this function is available on XLight devices version 2.0 or later.

See also:
xlt_rsa_wrap_privkey().
int XLT_API xlt_rsa_wrap_privkey | ( | const unsigned char * | private_key,
 |  | unsigned int | private_key_length,
 |  | const unsigned char * | dongle_key,
 |  | unsigned char * | wrapped_key,
 |  | unsigned int | wrapped_key_len
 | ) |  |

Wraps an RSA key.

See Asymmetric cryptography on XLight (RSA) for an introduction on the RSA protection in XLight.

Parameters:
[in] | private_key | points to a buffer containing a formatted private key
[in] | private_key_length | length of the RSA formatted key (Format of numbers and RSA key).
[in] | dongle_key | points to a buffer containing Dongle Key.
[out] | wrapped_key | points to the buffer that will receive an encryption of the RSA private key (wrapped).
[in] | wrapped_key_len | the length of Wrapped Key pointed by wrapped_key. The length of a Wrapped Key must be XLT_RSA_1024_WRAPPED_KEY_SIZE for a 1024-bit key and XLT_RSA_512_WRAPPED_KEY_SIZE for a 512-bit key.
Returns:
XLT_ERROR_SUCCESS on success, an error code on failure.
Note:
this is an utility function that must be never used onto the protected software. Its purpose is to encrypt an RSA private key for protecting its content. The produced Wrapped Key may reside into a protected software or exposed to the public access without revealing its real content. In order to insert a private key onto the device the Wrapped Key must be passed to the function xlt_rsa_set_privkey().

Supported version: this function is available on XLight devices version 2.0 or later.

See also:
xlt_rsa_set_privkey()
int XLT_API xlt_rsa_set_privkey | ( | unsigned int | device,
 |  | const unsigned char * | wrapped_key,
 |  | unsigned int | wrapped_key_length
 | ) |  |

Load an RSA private key onto an XLight device.

See Asymmetric cryptography on XLight (RSA) for an introduction on the RSA protection in XLight.

Parameters:
[in] | device | device index for the selection of a specific XLight device. This value runs from 0 to XLT_DEVICE_MAX -1.
[in] | wrapped_key | points to the buffer containing the wrapped RSA key to be inserted into ther XLight device.
[in] | wrapped_key_length | the length of the Wrapped Key data.
Returns:
XLT_ERROR_SUCCESS on success, an error code on failure.
Note:
on a XLight device it is possible to store two RSA keys: one 1024 bit key and one 512 bit key. The bit length reppresent the length of its "modulus", not the length of the data containing the key (see Format of numbers and RSA key). The device recognizes the two different key types and write them in their reserved memory place.

The RSA key received from this function is not in clear form, but encrypted by the function xlt_rsa_wrap_privkey(). In this way the RSA private key can be set by the protected program without exposing any relevant data, and hence preventing a hacker to understand the values (which would ruin all the security protocol based on RSA).

Note:
an RSA key is present onto the device also after device removal because it is written in a non volatile memory, nevertheless it can be always overwritten with a new one.

Supported version: this function is available on XLight devices version 2.0 or later.

int XLT_API xlt_never_use_this_rsa_encrypt | ( | const unsigned char * | public_key,
 |  | unsigned int | public_key_len,
 |  | const unsigned char * | plaintext,
 |  | unsigned int | plaintext_ciphertext_length,
 |  | unsigned char * | ciphertext
 | ) |  |

Performs RSA encryption.

Deprecated:
just use for test purpose

See Asymmetric cryptography on XLight (RSA) for an introduction on the RSA protection in XLight.

Parameters:
[in] | public_key | points to the buffer containing the formatted public key used for the encryption.
[in] | public_key_len | length of the formatted public key. The allowed values are XLT_RSA_1024_PUB_KEY_SIZE and XLT_RSA_512_PUB_KEY_SIZE.
[in] | plaintext | points to the buffer containing the data to be encrypted.
[in] | plaintext_ciphertext_length | the length of plaintext and the size of the buffer pointed by ciphertext. The allowed values for this argument are XLT_RSA_1024_PLAINTEXT_SIZE and XLT_RSA_512_PLAINTEXT_SIZE, if the plaintext is shorter it must be copied into a buffer of the proper length and zero padded up to its overall length.
[out] | ciphertext | points to the buffer that will receive the result of the encryption.
Returns:
XLT_ERROR_SUCCESS on success, an error code on failure.
Note:
this function is present for test purpose, never use it in the application protected with XLight.

Supported version: this function is available on XLight devices version 2.0 or later.

int XLT_API xlt_never_use_this_rsa_sw_decrypt | ( | const unsigned char * | private_key,
 |  | unsigned int | private_key_len,
 |  | const unsigned char * | ciphertext,
 |  | unsigned int | ciphertext_plaintext_length,
 |  | unsigned char * | plaintext
 | ) |  |

Performs a software RSA decryption.

Deprecated:
just use for test purpose

See Asymmetric cryptography on XLight (RSA) for an introduction on the RSA protection in XLight.

Parameters:
[in] | private_key | points to a buffer containing the formatted private RSA key to be used.
[in] | private_key_len | length of the formatted private key. The allowed values are XLT_RSA_1024_PRIV_KEY_SIZE and XLT_RSA_512_PRIV_KEY_SIZE.
[in] | ciphertext | points to the buffer containing the data to be decrypted.
[in] | ciphertext_plaintext_length | the length of the data to be decrypted, and the size of the receiving buffer. The allowed values for this argument are XLT_RSA_1024_PLAINTEXT_SIZE and XLT_RSA_512_PLAINTEXT_SIZE, if the plaintext is shorter it must be copied into a buffer of the proper length and zero padded up to its overall length.
[out] | plaintext | points to the buffer that will receive the result of the decryption.
Returns:
XLT_ERROR_SUCCESS on success, an error code on failure.

Supported version: this function is available on XLight devices version 2.0 or later.

int XLT_API xlt_rsa_decrypt | ( | unsigned int | device,
 |  | const unsigned char * | ciphertext,
 |  | unsigned int | ciphertext_plaintext_length,
 |  | unsigned char * | plaintext
 | ) |  |

Runs an RSA decryption onto an XLight device.

See Asymmetric cryptography on XLight (RSA) for an introduction on the RSA protection in XLight.

Parameters:
[in] | device | device index for the selection of a specific XLight device. This value runs from 0 to XLT_DEVICE_MAX -1.
[in] | ciphertext | points to the buffer containing the data to be decrypted.
[in] | ciphertext_plaintext_length | the length of the data to be decrypted, and the size of the receiving buffer. The allowed values for this argument are XLT_RSA_1024_PLAINTEXT_SIZE and XLT_RSA_512_PLAINTEXT_SIZE, if the plaintext is shorter it must be copied into a buffer of the proper length and zero padded up to its overall length (see Format of numbers and RSA key).
[out] | plaintext | points to the buffer that will receive the result of the decryption.
Returns:
XLT_ERROR_SUCCESS on success, an error code on failure.
Note:
the length of the ciphertext buffer must be the same of the plaintext. If the length is XLT_RSA_1024_PLAINTEXT_SIZE the 1024-bit key is used, if the length is XLT_RSA_512_PLAINTEXT_SIZE the 512-bit key is used, for any other value an error is returned.

Supported version: this function is available on XLight devices version 2.0 or later.

int XLT_API xlt_bank_lock | ( | unsigned int | device,
 |  | const unsigned char * | password,
 |  | unsigned int | bank,
 |  | unsigned int | group_number
 | ) |  |

Lock a memory bank.

Note:
this function produces an irreversible setting onto the XLight device, hence use it very carefully.

See Locked Memory.

Parameters:
[in] | device | device index for the selection of a specific XLight device. This value runs from 0 to XLT_DEVICE_MAX -1.
[in] | password | points to a buffer of length XLT_PASSWORD_SIZE. It contains the password assigned to the device with xlt_setup().
[in] | bank | the index of the memory bank that must be locked.
[in] | group_number | the group number to be assigned to the locking bank.
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.

A locked memory bank can be written only using encrypted commands created by xlt_set_write_locked_group_check() or xlt_set_write_locked_serial_check() and performed by xlt_write_locked().

Note:
the group number is intended to define subgroups that must be treated in different ways. If there is no reason to create such differentiation it must be inserted the same number for all devices, say 0. The grouping allows to create a single encrypted command to modify the memory content of locked banks onto a large number of devices.
Remarks:
it is not useful to set a different group number for every device because it is already possible create a command for a single device by using its serial number.
Note:
a locked bank can always be read using the xlt_read() function, but can't be written with xlt_write() any more. A locked memory bank is subject to a restriction in its dimension: only XLT_LOCKED_BANK_DATA_LENGTH will be freely available for reading and writing. The remaining bytes are used by the locking mechanism management.
See also:
xlt_bank_lock2(), xlt_set_write_locked_group_check(), xlt_set_write_locked_serial_check()
int XLT_API xlt_bank_lock2 | ( | unsigned int | device,
 |  | const unsigned char * | password,
 |  | unsigned int | bank,
 |  | unsigned int | group_number
 | ) |  |

Lock a memory bank in advanced mode (Lock2).

Note:
this function produces an irreversible setting onto the XLight device, hence use it very carefully.

See Locked Memory.

Parameters:
[in] | device | device index for the selection of a specific XLight device. This value runs from 0 to XLT_DEVICE_MAX -1.
[in] | password | points to a buffer of length XLT_PASSWORD_SIZE. It contains the password assigned to the device with xlt_setup().
[in] | bank | the index of the memory bank that must be locked.
[in] | group_number | the group number to be assigned to the locking bank.
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.

A locked2 memory bank can be written only using encrypted commands created by xlt_set_write_locked2_group_check() or xlt_set_write_locked2_serial_check() and performed by xlt_write_locked().

Note:
the group number is intended to define subgroups that must be treated in different ways. If there is no reason to create such differentiation it must be inserted the same number for all devices, say 0. The grouping allows to create a single encrypted command to modify the memory content of locked banks onto a large number of devices.
Remarks:
it is not useful to set a different group number for every device because it is already possible create a command for a single device by using its serial number.
Note:
a locked bank can always be read using the xlt_read() function, but can't be written with xlt_write() any more. A locked2 memory bank is subject to a restriction in its dimension: only XLT_LOCKED_BANK_DATA_LENGTH will be freely available for reading and writing. The remaining bytes are used by the locking mechanism management.

Supported version: this function is available on XLight devices version 1.01 or later.

See also:
xlt_set_write_locked2_group_check(), xlt_set_write_locked2_serial_check()
int XLT_API xlt_write_locked | ( | unsigned int | device,
 |  | unsigned int | bank,
 |  | const unsigned char * | transfer_data
 | ) |  |

Perform a write operation in a locked bank (both normal and advanced Lock2 mode).

See Locked Memory.

Parameters:
[in] | device | device index for the selection of a specific XLight device. This value runs from 0 to XLT_DEVICE_MAX -1.
[in] | bank | the index of the memory bank that must be written.
[in] | transfer_data | points to a buffer of size XLT_LOCKED_TRANSFER_DATA containing the values computed by xlt_set_write_locked_serial_check() or xlt_set_write_locked_group_check().
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
See also:
xlt_set_write_locked_serial_check(), xlt_set_write_locked_group_check().
int XLT_API xlt_read_locked | ( | unsigned int | device,
 |  | unsigned int | bank,
 |  | unsigned char * | transfer_data
 | ) |  |

Perform a read operation in a locked bank (both normal and advanced Lock2 mode).

See Locked Memory.

Parameters:
[in] | device | device index for the selection of a specific XLight device. This value runs from 0 to XLT_DEVICE_MAX -1.
[in] | bank | the index of the memory bank that must be read.
[out] | transfer_data | points to a buffer of size XLT_LOCKED_TRANSFER_DATA that will receive the content of the memory bank in encrypted form.
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
Remarks:
in order to get the data in plain form the function xlt_decrypt_locked2_data() must be used.
Note:
a locked bank can always be read using the xlt_read() function, while this function doesn't need the use of password, but its outcome can't be used as is, because it needs decryption.

A locked memory bank is subjected to a restriction in its dimension: only XLT_LOCKED_BANK_DATA_LENGTH will be freely available for reading and writing. The remaining bytes are used by the locking mechanism management.

See also:
xlt_decrypt_locked2_data().
int XLT_API xlt_set_write_locked_serial_check | ( | const unsigned char * | data,
 |  | unsigned int | bank,
 |  | unsigned int | new_counter,
 |  | unsigned int | serial,
 |  | const unsigned char * | dongle_key,
 |  | unsigned char * | transfer_data
 | ) |  |

Encrypt the buffer to be written into a locked bank of a specific XLight device.

This data can be written only once and only in the device with a given serial number, provided that the destination bank is locked (see xlt_bank_lock2()).

See Locked Memory.

Parameters:
[in] | data | points to a buffer of length XLT_LOCKED_BANK_DATA_LENGTH, that contains the value that must be written onto a locked bank.
[in] | bank | specify the index of the memory bank that must written.
[in] | new_counter | new counter value: this value must be greater than the counter value currently contained into the locked bank.
[in] | serial | the serial number of the XLight device target.
[in] | dongle_key | points to a buffer of length XLT_KEY_SIZE. It contains the AES-256 key Dongle Key set during xlt_getinfo() call.
[out] | transfer_data | points to a buffer of size XLT_LOCKED_TRANSFER_DATA that will receive the encrypted write command that will be applied onto the XLight device via the xlt_write_locked() function. to the XLight device with the xlt_write() function in order to write data into a locked bank.
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
Remarks:
this function is to be considered as an utility not to be used diretly by the protected software. It can be used by the vendor of the protected software in order to remotely update the locked memory of a device. In this scenario the Dongle Key key must never be used onto the protected software, but used only to generate update for the device memory. This way it is possible to remotely update the content of a locked bank. A locked bank can be read normally by a protected application using xlt_read(), so this remote update technique can be used, for instance, for license management purposes.
See also:
xlt_set_write_locked_group_check(), xlt_write_locked(), xlt_read_locked(), xlt_decrypt_locked_data().
int XLT_API xlt_set_write_locked2_serial_check | ( | const unsigned char * | data,
 |  | unsigned int | bank,
 |  | unsigned int | new_counter,
 |  | unsigned int | serial,
 |  | const unsigned char * | dongle_key,
 |  | unsigned char * | transfer_data
 | ) |  |

Encrypt the buffer to be written into a bank locked with Lock2 of a specific XLight device.

This data can be written only once and only in the device with a given serial number, provided that the destination bank is locked (see xlt_bank_lock2()).

See Locked Memory.

Parameters:
[in] | data | points to a buffer of length XLT_LOCKED_BANK_DATA_LENGTH, that contains the value that must be written onto a locked bank.
[in] | bank | specify the index of the memory bank that must written.
[in] | new_counter | new counter value: this value must be greater than the counter value currently contained into the locked bank.
[in] | serial | the serial number of the XLight device target.
[in] | dongle_key | points to a buffer of length XLT_KEY_SIZE. It contains the AES-256 key Dongle Key set during xlt_getinfo() call.
[out] | transfer_data | points to a buffer of size XLT_LOCKED_TRANSFER_DATA that will receive the encrypted write command that will be applied onto the XLight device via the xlt_write_locked() function. to the XLight device with the xlt_write() function in order to write data into a locked bank.
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
Remarks:
this function is to be considered as an utility not to be used diretly by the protected software. It can be used by the vendor of the protected software in order to remotely update the locked memory of a device. In this scenario the Dongle Key key must never be used onto the protected software, but used only to generate update for the device memory. This way it is possible to remotely update the content of a locked bank. A locked bank can be read normally by a protected application using xlt_read(), so this remote update technique can be used, for instance, for license management purposes.

Supported version: this function is available on XLight devices version 1.01 or later.

See also:
xlt_set_write_locked2_group_check(), xlt_write_locked(), xlt_read_locked(), xlt_decrypt_locked2_data().
int XLT_API xlt_set_write_locked_group_check | ( | const unsigned char * | data,
 |  | unsigned int | bank,
 |  | unsigned int | new_counter,
 |  | unsigned int | group_number,
 |  | const unsigned char * | dongle_key,
 |  | unsigned char * | transfer_data
 | ) |  |

Encrypt the buffer to be written into a locked bank belonging to an XLight devices of a given group.

This data can be written only once provided that the destination bank is locked (see xlt_bank_lock()).

See Locked Memory.

Parameters:
[in] | data | points to a buffer of length XLT_LOCKED_BANK_DATA_LENGTH, that contains the value that must be written into the locked bank.
[in] | bank | specify the index of the memory bank that must written.
[in] | new_counter | new counter value: this value must be greater than the counter value currently contained into the locked bank.
[in] | group_number | the group number of the XLight devices for which the encrypted buffer is prepared.
[in] | dongle_key | points to a buffer of length XLT_KEY_SIZE. It contains the AES-256 key Dongle Key set during xlt_getinfo() call.
[out] | transfer_data | points to a buffer of size XLT_LOCKED_TRANSFER_DATA that will receive the encrypted write command that will be applied onto the XLight device via the xlt_write_locked() function.
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
Remarks:
the group number correspond to what is set on the dongle by xlt_bank_lock(). It is intended to define subgroups of devices each of them must be treated in the same way. For further notices see the comments of xlt_set_write_locked_serial_check(), they hold also for this function.
int XLT_API xlt_set_write_locked2_group_check | ( | const unsigned char * | data,
 |  | unsigned int | bank,
 |  | unsigned int | new_counter,
 |  | unsigned int | group_number,
 |  | const unsigned char * | dongle_key,
 |  | unsigned char * | transfer_data
 | ) |  |

Encrypt the buffer to be written into a bank locked with Lock2 belonging to an XLight devices of a given group.

This data can be written only once provided that the destination bank is locked (see xlt_bank_lock2()).

See Locked Memory.

Parameters:
[in] | data | points to a buffer of length XLT_LOCKED_BANK_DATA_LENGTH, that contains the value that must be written into the locked bank.
[in] | bank | specify the index of the memory bank that must written.
[in] | new_counter | new counter value: this value must be greater than the counter value currently contained into the locked bank.
[in] | group_number | the group number of the XLight devices for which the encrypted buffer is prepared.
[in] | dongle_key | points to a buffer of length XLT_KEY_SIZE. It contains the AES-256 key Dongle Key set during xlt_getinfo() call.
[out] | transfer_data | points to a buffer of size XLT_LOCKED_TRANSFER_DATA that will receive the encrypted write command that will be applied onto the XLight device via the xlt_write_locked() function.
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
Remarks:
the group number correspond to what is set on the dongle by xlt_bank_lock2(). It is intended to define subgroups of devices each of them must be treated in the same way. For further notices see the comments of xlt_set_write_locked_serial_check(), they hold also for this function.

Supported version: this function is available on XLight devices version 1.01 or later.

int XLT_API xlt_decrypt_locked_data | ( | const unsigned char * | transfer_data,
 |  | const unsigned char * | dongle_key,
 |  | unsigned char * | data
 | ) |  |

Retrieve the data in clear form of the content of a locked memory bank.

See Locked Memory.

Parameters:
[in] | transfer_data | points to a buffer of length XLT_LOCKED_TRANSFER_DATA.
[in] | dongle_key | points to a buffer of length XLT_KEY_SIZE containing the dangle_key key set by xlt_setup().
[out] | data | points to a buffer of length XLT_BANK_SIZE that will receice the decrypted value.
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
Remarks:
xlt_decrypt_locked_data() retrieves the data in clear form of the content of a memory bank collected with a previous xlt_read_locked() call. xlt_decrypt_locked_data() and xlt_read_locked() are used in a server client memory bank read operation. The xlt_read_locked() doesn't need of any password and cryptographic key to be used but produces an encrypted buffer that can be understood only by the holder of the Dongle Key crypto-key. xlt_read_locked() can be executed by non trusted people to collect information. Afterwards xlt_decrypt_locked_data() allows the authorized parts to decrypt and read the content of the memory bank.

The buffer returned by xlt_decrypt_locked_data() is XLT_KEY_SIZE bytes long, but only the first XLT_LOCKED_BANK_DATA_LENGTH bytes are the significant data that can be written and used by the application. The remaining bytes are managed internally by the library and used for the 'locked bank' management. These bytes convey information that may be retrieved using xlt_get_info_from_locked_bank(), such information are necessary for writing inside a locked bank.

See also:
xlt_read_locked(), xlt_get_info_from_locked_bank()
int XLT_API xlt_decrypt_locked2_data | ( | const unsigned char * | transfer_data,
 |  | const unsigned char * | dongle_key,
 |  | unsigned char * | data
 | ) |  |

Retrieve the data in clear form of the content of a locked with Lock2 memory bank.

See Locked Memory.

Parameters:
[in] | transfer_data | points to a buffer of length XLT_LOCKED_TRANSFER_DATA.
[in] | dongle_key | points to a buffer of length XLT_KEY_SIZE containing the dangle_key key set by xlt_setup().
[out] | data | points to a buffer of length XLT_BANK_SIZE that will receice the decrypted value.
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
Remarks:
xlt_decrypt_locked2_data() retrieves the data in clear form of the content of a memory bank collected with a previous xlt_read_locked() call. xlt_decrypt_locked2_data() and xlt_read_locked() are used in a server client memory bank read operation. The xlt_read_locked() doesn't need of any password and cryptographic key to be used but produces an encrypted buffer that can be understood only by the holder of the Dongle Key crypto-key. xlt_read_locked() can be executed by non trusted people to collect information. Afterwards xlt_decrypt_locked2_data() allows the authorized parts to decrypt and read the content of the memory bank.

The buffer returned by xlt_decrypt_locked2_data() is XLT_KEY_SIZE bytes long, but only the first XLT_LOCKED_BANK_DATA_LENGTH bytes are the significant data that can be written and used by the application. The remaining bytes are managed internally by the library and used for the 'locked bank' management. These bytes convey information that may be retrieved using xlt_get_info_from_locked_bank(), such information are necessary for writing inside a locked bank.

Supported version: this function is available on XLight devices version 1.01 or later.

See also:
xlt_read_locked(), xlt_get_info_from_locked_bank()
int XLT_API xlt_get_info_from_locked_bank | ( | const unsigned char * | data,
 |  | unsigned int * | pbank,
 |  | unsigned int * | pcounter,
 |  | unsigned int * | pserial,
 |  | unsigned int * | pgroup_number
 | ) |  |

Return information of a locked bank (both normal and advanced Lock2 mode).

See Locked Memory.

Parameters:
[in] | data | points to a buffer of length XLT_BANK_SIZE, that contains the value retrieved from a locked bank by xlt_read() or xlt_decrypt_locked_data().
[out] | pbank | points to an unsigned int that will contain the bank number to which the data belongs. This parameter is optional and may be set to NULL.
[out] | pcounter | points to an unsigned int that will contain the current counter field of the locked bank. This parameter is optional and may be set to NULL.
[out] | pserial | points to an unsigned int that will contain the serial number of the locked bank. This parameter is optional and may be set to NULL.
[out] | pgroup_number | points to an unsigned int that will contain the group number of the locked bank. This parameter is optional and may be set to NULL.
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
Remarks:
if the data passed to this function comes from a non locked bank the outcome of this function is meaningless.
the 'data' argument may come from a xlt_decrypt_locked_data() or a local xlt_read() call.
int XLT_API xlt_virg_demo ( unsigned int device )

Virginize (reset) a demo XLight device.

Parameters:
[in] device device index for the selection of a specific XLight device. This value runs from 0 to XLT_DEVICE_MAX -1.
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
Remarks:
this function may be useful for testing allowing to completely cleanup a DEMO device, that is it doesn't work onto standard devices. A demo device is distinguished by standard ones by its serial number: it is set to the value '1'. This function may be useful especially while testing xlt_bank_freeze() and xlt_bank_lock2() functions which on normal devices cannot be reverted.
Note:
OxySec supplies DEMO devices only for evaluation purpose and must be used only for testing on the standard devices.
void XLT_API xlt_close ( )

Cleanup the allocated memory by the XLight functions.

Remarks:
in case of dll usage it is not necessary call this function, it is already called when the dll is unloaded. On the other hand it's not harmful to call it explicitly. It is also possible call any other function after the xlt_close() is called, but in this case xlt_close() must be called again.
Note:
this function can't be called concurrently with any other function.
int XLT_API xlt_init ( )

Initialize the environment for XLight management.

Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
Remarks:
It is not necessary to call this function unless the running process is using multi-threading. In this case it is necessary call this (or any other function accessing the device) function before starting using multi-threading.

Every XLight function communicas with the device running xlt_init() if not already done, a problem may arises the first time the communication environment is used if accessed simultaneously, so you must be sure that the first call is not done in concurrent access. After the first call there is no problem in using multi-threading.

int XLT_API xlt_storage_get_mem_size | ( | unsigned int | device,
 |  | unsigned int * | p_mem_size_in_blocks,
 |  | unsigned int * | p_enc_mem_size_in_blocks
 | ) |  |

Get memory size information of the memory flash in XLight SD devices.

Parameters:
[in] | device | device index for the selection of a specific XLight device. This value runs from 0 to XLT_DEVICE_MAX -1.
[out] | p_mem_size_in_blocks | points to an unsigned integer receiving the size in memory blocks (512 bytes) of the overall memory flash.
[out] | p_enc_mem_size_in_blocks | points to an unsigned integer receiving the size in memory blocks of the encrypted disk. If not present the return value is zero.
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
See also:
XLight SD.
int XLT_API xlt_storage_set | ( | unsigned int | device,
 |  | unsigned int | locked_mem_size_in_blocks,
 |  | const unsigned char * | dongle_key,
 |  | const unsigned char * | disk_password
 | ) |  |

Initialize the memory flash of an XLight SD device.

Parameters:
[in] | device | device index for the selection of a specific XLight device. This value runs from 0 to XLT_DEVICE_MAX -1.
[in] | locked_mem_size_in_blocks | the size in blocks of the desired size for the encrypted disk. If no encrypted disk is desired set this value to '0' (zero).
[in] | dongle_key | points to a buffer containing the Dongle Key set by xlt_setup() function.
[in] | disk_password | points to a buffer of length XLT_DISK_PASSWORD_SIZE containing the password that will be used to mount and unmount the encrypted disk.
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
See also:
XLight SD.
int XLT_API xlt_storage_unlock | ( | unsigned int | device,
 |  | const unsigned char * | disk_password
 | ) |  |

Mount the encrypted disk of an XLight SD device.

Parameters:
[in] | device | device index for the selection of a specific XLight device. This value runs from 0 to XLT_DEVICE_MAX -1.
[in] | disk_password | points to a buffer of length XLT_DISK_PASSWORD_SIZE containing the password set by xlt_storage_set() function.
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
See also:
XLight SD.
int XLT_API xlt_storage_unlock_ro | ( | unsigned int | device,
 |  | const unsigned char * | disk_password
 | ) |  |

Mount the encrypted disk of an XLight SD device with read only access.

Parameters:
[in] | device | device index for the selection of a specific XLight device. This value runs from 0 to XLT_DEVICE_MAX -1.
[in] | disk_password | points to a buffer of length XLT_DISK_PASSWORD_SIZE containing the password set by xlt_storage_set() function.
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
See also:
XLight SD.
int XLT_API xlt_storage_lock | ( | unsigned int | device,
 |  | const unsigned char * | disk_password
 | ) |  |

Unmount the encrypted disk of an XLight SD device.

Parameters:
[in] | device | device index for the selection of a specific XLight device. This value runs from 0 to XLT_DEVICE_MAX -1.
[in] | disk_password | points to a buffer of length XLT_DISK_PASSWORD_SIZE containing the password set by xlt_storage_set() function.
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
See also:
XLight SD.
int XLT_API xlt_update_get_counter | ( | unsigned int | device,
 |  | unsigned int | counter,
 |  | unsigned int | sub_value,
 |  | unsigned int * | p_new_value
 | ) |  |

Update and get the value of a counter.

See Timer and Counters for an introduction to timer and counters management.

Parameters:
[in] | device | device index for the selection of a specific XLight device. This value runs from 0 to XLT_DEVICE_MAX -1.
[in] | counter | index of the counter to be used. This entry may take values from 0 to XLT_COUNTERS_NUM - 1.
[in] | sub_value | value to be subtracted to the indexed counter. If this value is 0 (zero) the counter value is read without modifying it.
[out] | p_new_value | point to an unsigned int value that will receive the value of the counter after the subtraction.
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.

If sub_value is greater than the current counter value, its new value will be zero and the function returns XLT_ERROR_SUCCESS. This is still the case also if the counter value is already zero.

See also:
Timer and Counters
int XLT_API xlt_get_timer | ( | unsigned int | device,
 |  | unsigned int * | p_value
 | ) |  |

Retrieve the current value of the timer.

See Timer and Counters for an introduction to timer and counters management.

Parameters:
[in] | device | device index for the selection of a specific XLight device. This value runs from 0 to XLT_DEVICE_MAX -1.
[out] | p_value | point to an unsigned int value that will receive the current value of the timer.
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
See also:
Timer and Counters
int XLT_API xlt_generate_counter_settings | ( | const XLT_COUNTER_CMD * | counter_cmd,
 |  | const unsigned char * | dongle_key,
 |  | unsigned char * | enc_cmd,
 |  | unsigned int | enc_cmd_size,
 |  | unsigned int * | p_enc_cmd_len
 | ) |  |

Generate a command buffer to a set a counter.

See Timer and Counters for an introduction to timer and counters management.

Parameters:
[in] | counter_cmd | points to the structure XLT_COUNTER_CMD containing the settings to be applied to a counter.
[in] | dongle_key | points to the value of the Dongle Key set up by xlt_setup() function.
[out] | enc_cmd | points to a buffer that will receive the encrypted form of the command.
[in] | enc_cmd_size | length of the buffer pointed by enc_cmd.
[out] | p_enc_cmd_len | points to an unsigned integer that will contain the number of bytes copied in enc_cmd. This entry may be set also to 0 (NULL).
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
See also:
Timer and Counters
int XLT_API xlt_generate_timer_settings | ( | const XLT_TIMER_CMD * | timer_cmd,
 |  | const unsigned char * | dongle_key,
 |  | unsigned char * | enc_cmd,
 |  | unsigned int | enc_cmd_size,
 |  | unsigned int * | p_enc_cmd_len
 | ) |  |

Generate a command buffer to a set the timer.

See Timer and Counters for an introduction to timer and counters management.

Parameters:
[in] | timer_cmd | points to the structure XLT_TIMER_CMD containing the settings to be applied to the timer.
[in] | dongle_key | points to the value of the Dongle Key set up by xlt_setup() function.
[out] | enc_cmd | points to a buffer that will receive the encrypted form of the command.
[in] | enc_cmd_size | length of the buffer pointed by enc_cmd.
[out] | p_enc_cmd_len | points to an unsigned integer that will contain the number of bytes copied in enc_cmd. This entry may be set also to 0 (NULL).
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
See also:
Timer and Counters
int XLT_API xlt_generate_timer_add_settings | ( | const XLT_TIMER_ADD_CMD * | timer_add_cmd,
 |  | const unsigned char * | dongle_key,
 |  | unsigned char * | enc_cmd,
 |  | unsigned int | enc_cmd_size,
 |  | unsigned int * | p_enc_cmd_len
 | ) |  |

Generate a command buffer to increase the timer value.

See Timer and Counters for an introduction to timer and counters management.

Parameters:
[in] | timer_add_cmd | points to the structure XLT_TIMER_ADD_CMD containing the add timer settings to be applied.
[in] | dongle_key | points to the value of the Dongle Key set up by xlt_setup() function.
[out] | enc_cmd | points to a buffer that will receive the encrypted form of the command.
[in] | enc_cmd_size | length of the buffer pointed by enc_cmd.
[out] | p_enc_cmd_len | points to an unsigned integer that will contain the number of bytes copied in enc_cmd. This entry may be set also to 0 (NULL).
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
See also:
Timer and Counters
int XLT_API xlt_enc_apply_timer_counter | ( | unsigned int | device,
 |  | const unsigned char * | enc_cmd,
 |  | unsigned int | enc_cmd_len
 | ) |  |

Apply a timer or counter command onto the device.

See Timer and Counters for an introduction to timer and counters management.

Parameters:
[in] | device | device index for the selection of a specific XLight device. This value runs from 0 to XLT_DEVICE_MAX -1.
[in] | enc_cmd | point to a buffer containing the encrypted command to be applied to the device.
[in] | enc_cmd_len | the length of the encrypted command.
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
See also:
Timer and Counters
int XLT_API xlt_enc_read_counters | ( | unsigned int | device,
 |  | unsigned char * | enc_data,
 |  | unsigned int | enc_data_size,
 |  | unsigned int * | p_enc_data_len
 | ) |  |

Read in encrypted form the current state of all the counters of the device.

See Timer and Counters for an introduction to timer and counters management.

Parameters:
[in] | device | device index for the selection of a specific XLight device. This value runs from 0 to XLT_DEVICE_MAX -1.
[out] | enc_data | points to a buffer that will receive the encrypted counters data retrieved from the XLight dongle.
[in] | enc_data_size | length of the buffer pointed by enc_data.
[out] | p_enc_data_len | points to an unsigned integer that will receive the number of bytes copied in enc_data. This entry may be set also to 0 (NULL).
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
See also:
Timer and Counters
int XLT_API xlt_enc_read_timer | ( | unsigned int | device,
 |  | unsigned char * | enc_data,
 |  | unsigned int | enc_data_size,
 |  | unsigned int * | p_enc_data_len
 | ) |  |

Read in encrypted form the current state the device timer.

See Timer and Counters for an introduction to timer and counters management.

Parameters:
[in] | device | device index for the selection of a specific XLight device. This value runs from 0 to XLT_DEVICE_MAX -1.
[out] | enc_data | points to a buffer that will receive the encrypted timer data retrieved from the XLight dongle.
[in] | enc_data_size | length of the buffer pointed by enc_data.
[out] | p_enc_data_len | points to an unsigned integer that will receive the number of bytes copied in enc_data. This entry may be set also to 0 (NULL).
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
See also:
Timer and Counters
int XLT_API xlt_timer_counters_retrieve | ( | const unsigned char * | enc_data,
 |  | unsigned int | enc_data_len,
 |  | const unsigned char * | dongle_key,
 |  | XLT_TIMER_COUNTER_INFO * | retrieved_data
 | ) |  |

Decrypt encrypted data from the device regarding timer or counters.

This function also extract data from encrypted commands. See Timer and Counters for an introduction to timer and counters management.

Parameters:
[in] | enc_data | points to encrypted data retrieved from the device or containing an encrypted command.
[in] | enc_data_len | length of the encrypted buffer.
[in] | dongle_key | points to the value of the Dongle Key set up by xlt_setup() function.
[out] | retrieved_data | points to an instance of structure XLT_TIMER_COUNTER_INFO that will contain the decryption of the data or command passed to this function.
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
See also:
Timer and Counters
int XLT_API xlt_enc_read_date | ( | unsigned int | device,
 |  | unsigned char * | enc_data,
 |  | unsigned int | enc_data_size,
 |  | unsigned int * | p_enc_data_len
 | ) |  |

Read in encrypted form the current state of the date license management of the device.

See Date based licensing for an introduction to XLight license management based on the date.

Parameters:
[in] | device | device index for the selection of a specific XLight device. This value runs from 0 to XLT_DEVICE_MAX -1.
[out] | enc_data | points to a buffer that will receive the encrypted date license data retrieved from the XLight dongle.
[in] | enc_data_size | length of the buffer pointed by enc_data.
[out] | p_enc_data_len | points to an unsigned integer that will receive the number of bytes copied in enc_data. This entry may be set also to 0 (NULL).
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
int XLT_API xlt_read_date | ( | unsigned int | device,
 |  | XLT_DATE_DATA * | date_info
 | ) |  |

Read the current state of the date license management of the device.

See Date based licensing for an introduction to XLight license management based on the date.

Parameters:
[in] | device | device index for the selection of a specific XLight device. This value runs from 0 to XLT_DEVICE_MAX -1.
[out] | date_info | points to a XLT_DATE_DATA struct that will receive the date license data of the connected device.
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
Note:
xlt_read_date() can be run by the protected application to see the current status of the license but some XLT_DATE_DATA entries are set always to zero and can be collected only using remote functions. Such entries are:
  • functions_to_lock_mask,
  • device_time,
  • cmd_counter,
  • max_missing_update_date_error,
  • max_missing_update_signed_date_error and
  • max_update_date_error.
int XLT_API xlt_set_date | ( | unsigned int | device,
 |  | unsigned int | time
 | ) |  |

Set the current time (date) of the device.

See Date based licensing for an introduction to XLight license management based on the date.

Parameters:
[in] | device | device index for the selection of a specific XLight device. This value runs from 0 to XLT_DEVICE_MAX -1.
[in] | time | the current Unix Time.
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
int XLT_API xlt_date_get_challenge | ( | unsigned int | device,
 |  | unsigned char * | enc_challenge,
 |  | unsigned int | enc_challenge_size,
 |  | unsigned int * | p_enc_challenge_len
 | ) |  |

Retrieve the challenge buffer generated by the XLight device for update signed update (Signed date update constraint) The challenge buffer need to be used for setting the signed date onto the device See Date based licensing for an introduction to XLight license management based on the date.

Parameters:
[in] | device | device index for the selection of a specific XLight device. This value runs from 0 to XLT_DEVICE_MAX -1.
[out] | enc_challenge | points to a buffer that will receive an encoded form of the challenge buffer generated by the device. The length of the buffer must be not less than XLT_DATE_ENC_CHALLENGE_SIZE bytes long.
[in] | enc_challenge_size | length of the buffer pointed by challenge.
[out] | p_enc_challenge_len | points to an unsigned integer that will receive the length of the bytes copied in challenge. This entry may be set also to 0 (NULL).
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
int XLT_API xlt_generate_date_expiration_cmd | ( | const XLT_DATE_SET_EXPIRATION_CMD * | cmd,
 |  | const unsigned char * | dongle_key,
 |  | unsigned char * | enc_cmd,
 |  | unsigned int | enc_cmd_size,
 |  | unsigned int * | p_enc_cmd_len
 | ) |  |

Generate the license date expiration command See Date based licensing for an introduction to XLight license management based on the date (and the SetDateExpiration for an example of xlt_generate_date_expiration_cmd() usage).

Parameters:
[in] | cmd | points to the structure containing all the settings for the license expiration command
[in] | dongle_key | points to the value of the Dongle Key set up by xlt_setup() function.
[out] | enc_cmd | points to a buffer that will receive the encrypted form of the command for setting the expiration license date of a Xlight device. The length of the buffer must be not less than XLT_DATE_ENC_EXP_CMD_SIZE bytes long.
[in] | enc_cmd_size | length of the buffer pointed by enc_cmd.
[out] | p_enc_cmd_len | points to an unsigned integer that will receive the length of the bytes copied in enc_cmd. This entry may be set also to 0 (NULL).
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
int XLT_API xlt_generate_signed_date_cmd | ( | unsigned int | time,
 |  | const unsigned char * | challenge,
 |  | unsigned int | challenge_len,
 |  | const unsigned char * | dongle_key,
 |  | unsigned char * | enc_cmd,
 |  | unsigned int | enc_cmd_size,
 |  | unsigned int * | p_enc_cmd_len
 | ) |  |

Generate the signed date command.

This command uses the challenge retrieved by the XLight device using the function xlt_date_get_challenge() and decoded by xlt_date_enc_retrieve(). See Date based licensing for an introduction to XLight license management based on the date.

Parameters:
[in] | time | current Unix Time.
[in] | challenge | the challenge buffer generated by the dongle
[in] | challenge_len | length of the challenge entry
[in] | dongle_key | points to the value of the Dongle Key set up by xlt_setup() function.
[out] | enc_cmd | points to a buffer that will receive the encrypted form of the command for the signed update of the time of the device. The length of the buffer must be not less than XLT_DATE_SIG_UPD_CMD_SIZE bytes long.
[in] | enc_cmd_size | length of the buffer pointed by enc_cmd.
[out] | p_enc_cmd_len | points to an unsigned integer that will receive the length of the bytes copied in enc_cmd. This entry may be set also to 0 (NULL).
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
Note:
the challenge entry is not the enc_challenge argument returned by the function xlt_date_get_challenge(), but this is the challenge buffer of the structure XLT_DATE_CHALLENGE returned by xlt_date_enc_retrieve().
int XLT_API xlt_apply_date_enc_cmd | ( | unsigned int | device,
 |  | const unsigned char * | enc_cmd,
 |  | unsigned int | enc_cmd_len
 | ) |  |

Apply both license expiration setting and signed date update to the XLight device.

See Date based licensing for an introduction to XLight license management based on the date.

Parameters:
[in] | device | device index for the selection of a specific XLight device. This value runs from 0 to XLT_DEVICE_MAX -1.
[in] | enc_cmd | point to a buffer containing the encrypted command to be applied to the device.
[in] | enc_cmd_len | the length of the encrypted command.
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
int XLT_API xlt_date_enc_retrieve | ( | const unsigned char * | enc_data,
 |  | unsigned int | enc_data_len,
 |  | const unsigned char * | dongle_key,
 |  | XLT_DATE_INFO * | retrieved_data
 | ) |  |

Decrypt the encrypted data returned by the device regarding the date license settings.

This function also extract data from encrypted commands for date management. See Date based licensing for an introduction to XLight license management based on the date.

Parameters:
[in] | enc_data | points to encrypted data retrieved from the device or containing an encrypted command.
[in] | enc_data_len | length of the encrypted buffer.
[in] | dongle_key | points to the value of the Dongle Key set up by xlt_setup() function.
[out] | retrieved_data | points to an instance of structure XLT_DATE_INFO that will contain the decryption of the data or command passed to this function.
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
int XLT_API xlt_date_manage | ( | unsigned int | cmd,
 |  | unsigned int | device,
 |  | unsigned int | options,
 |  | const char * | args,
 |  | const unsigned char * | label
 | ) |  |

Date management function.

This function can take care of all the date management for the XLight device. See Date based licensing for an introduction to XLight license management based on the date (and expecially the paragraph Automatic date update management). A XLight device with date based licensing needs to be regularly accessed for setting its signed time and "normal" (non signed) time. The non automatic functions used for such tasks are the xlt_apply_date_enc_cmd() (in conjunction with other vendor side operation) for the signed time and the xlt_set_date() for the non signed time. xlt_date_manage() is able to completely substitute these tasks and regularly update the device also accessing internet services for getting signed update time.

Parameters:
[in] | cmd | one of the Date management commands
[in] | device | device index for the selection of a specific XLight device. This value runs from 0 to XLT_DEVICE_MAX -1.
[in] | options | the options of the command specified by the cmd argument
[in] | args | points to a string containing arguments for addressing internet URL for signed time update or NTP time service
[in] | label | points to a buffer with length of XLT_LABEL_SIZE byte containing the label of the XLight device to be addressed. If this entry is set to NULL, every device is addressed
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
Note:
the device argument is considered only when the cmd argument has values XLT_DATE_MANAGE_DO_SET_TIME and XLT_DATE_MANAGE_DO_SET_TIME_ASYNC.

The entry options and args gets values with different meaning depending on the value of the cmd entry:

when cmd is chosen among

  • XLT_DATE_MANAGE_AUTO_START
  • XLT_DATE_MANAGE_DO_SET_TIME
  • XLT_DATE_MANAGE_DO_SET_TIME_ASYNC

The options entry takes the values shown here: Options update values; while args is a string containing web addresses to reach an NTP service or the OxySec signed date service: see Automatic date update management to see how to build it up.

When cmd is XLT_DATE_MANAGE_SET_IDLE_TIME_SEC the options entry represents the second of tha new idle value (that is the time elapsing from one update test cicle and the other). Usually you don't need to use this command value. The args entry is ignored.

When cmd is XLT_DATE_MANAGE_MAKE_LOGS the options entry is considered as a boolean value: '1' starts the log management, '0' stops it (the default is no log, so you need to activate it to get the log). The args entry is ignored.

When cmd is XLT_DATE_MANAGE_LOG_ONLY_ERROR the options entry is considered as a boolean value: '1' makes the log manager to keep track only of errors, '0' makes the log manager to keep track of every event (the defalut is '0'). The args entry is ignored.

When cmd is XLT_DATE_MANAGE_LOG_SET_QUEUE_LEN the options entry is the value of the desired log buffer, that is the maximum number of the log records that can be taken. When that number is passed the older records are discarded. The default value for this entry is 10000. The args entry is ignored.

For every other value of the cmd entry options and args are ignored.

int XLT_API xlt_date_manage_get_num_log_records ( unsigned int * p_num_entries )

Retrieve the number of log records collected by the automatic date management process issued by xlt_date_manage().

See Date based licensing for an introduction to XLight license management based on the date.

Parameters:
[out] p_num_entries points to an unsigned integer that will receive the number of log record currently collected.
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.
int XLT_API xlt_date_manage_get_log_records | ( | unsigned int | starting_index,
 |  | unsigned int | num_entries,
 |  | XLT_DATE_LOG | date_log[],
 |  | unsigned int * | p_num_entries_retrieved
 | ) |  |

Retrieve log records collected by the automatic date management process issued by xlt_date_manage().

See Date based licensing for an introduction to XLight license management based on the date.

Parameters:
[in] | starting_index | the index of the first record to read from the log
[in] | num_entries | the number of entries to read from the log
[out] | date_log | the array of XLT_DATE_LOG structure that will receive the log records. The array must contain not less then num_entries items
[out] | p_num_entries_retrieved | points to an unsigned integer that will receive the number of entries copied into the date_log array. This entry may be set also to 0 (NULL).
Returns:
returns XLT_ERROR_SUCCESS on success, an error code on failure.


  • Data Fields
Data Structures
Here are the data structures with brief descriptions:
_XLT_COUNTER_DATA | The structure contains the data of a XLight counter
_XLT_D_INFO | Union of all date command and data, that is: XLT_DATE_SET_EXPIRATION_CMD, XLT_DATE_SIGNED_DATE_CMD, XLT_DATE_DATA, and XLT_DATE_CHALLENGE
_XLT_DATE_CHALLENGE | Date license challenge for signed time update
_XLT_DATE_DATA | Date license management data
_XLT_DATE_INFO | Date info retrieved from a XLight device
_XLT_DATE_LOG | Log structure This is the structure containing the log info produced by the automatic date management
_XLT_DATE_SET_EXPIRATION_CMD | Set expiration date command
_XLT_DATE_SIGNED_DATE_CMD | Signed date command structure
_XLT_TC_INFO | Union of all timer and counters command and data, that is: XLT_TIMER_DATA, XLT_TIMER_ADD_CMD, XLT_COUNTER_DATA, XLT_TIMER_CMD and XLT_COUNTER_CMD
_XLT_TIMER_ADD_CMD | The structure contains the command for incrementing the timer
_XLT_TIMER_COUNTER_INFO | Timer and counters info retrieved from a XLight device
_XLT_TIMER_DATA | The structure contains the data of the XLight timer


  • Data Fields
Data Fields
_XLT_COUNTER_DATA Struct Reference
Timer and Counters structures

The structure contains the data of a XLight counter. More...

#include <xlt.h>

Data Fields

XLT_ULONG_LONG | trigger_functions_mask
list of functions that causes the counter to be decremented
XLT_ULONG_LONG | functions_to_lock_mask
functions that won't work after counter expiration (reached 0)
unsigned int | counter_id
address the counter (it may take 0, 1, 2 or 3).
unsigned int | counter_value
starting value for the counter (or current value if retriving data)
unsigned int | cmd_counter
strictly increasing value used to avoid command replication. If the data is retrieved this is the last value used for this field
unsigned int | serial_number
the serial number of the referred XLight device

Detailed Description

The structure contains the data of a XLight counter.


  • Data Fields
Data Fields
_XLT_D_INFO Union Reference
Date structures

Union of all date command and data, that is: XLT_DATE_SET_EXPIRATION_CMD, XLT_DATE_SIGNED_DATE_CMD, XLT_DATE_DATA, and XLT_DATE_CHALLENGE. More...

#include <xlt.h>

Data Fields

XLT_DATE_SET_EXPIRATION_CMD date_exp_cmd
XLT_DATE_SET_EXPIRATION_CMD type: set expiration command.
XLT_DATE_SIGNED_DATE_CMD date_sig_cmd
XLT_DATE_SIGNED_DATE_CMD type: signed date update command.
XLT_DATE_DATA date_data
XLT_DATE_DATA type: date information data.
XLT_DATE_CHALLENGE date_challenge
XLT_DATE_CHALLENGE type: challenge generated by the XLight device for signed date update procedure.

Detailed Description

Union of all date command and data, that is: XLT_DATE_SET_EXPIRATION_CMD, XLT_DATE_SIGNED_DATE_CMD, XLT_DATE_DATA, and XLT_DATE_CHALLENGE.


  • Data Fields
Data Fields
_XLT_DATE_CHALLENGE Struct Reference
Date structures

Date license challenge for signed time update. More...

#include <xlt.h>

Data Fields

unsigned int | serial_number
the serial number of the referred XLight device.
unsigned int | reserved
reserved value managed by XLight functions.
unsigned char | challenge [XLT_DATE_CHALLENGE_SIZE]
challenge data.

Detailed Description

Date license challenge for signed time update.

When running signed time update the XLight device returns the following values to manage the update process


  • Data Fields
Data Fields
_XLT_DATE_DATA Struct Reference
Date structures

Date license management data. More...

#include <xlt.h>

Data Fields

XLT_ULONG_LONG | functions_to_lock_mask
bits mask of the functions that won't work after license expiration date (time update errors may lock the masked functions too).
unsigned int | expiration_time
date of expiration time expressed int Unix Time (defined as the number of seconds that have elapsed since 00:00:00 Coordinated Universal Time (UTC), 1 January 1970).
unsigned int | device_time
the time retrieved by the XLight device. This time is expressed with a precision of five minutes and in Unix Time.
unsigned int | max_time_between_updates
the maximum time in seconds that is allowed to elapse between two successive date update onto the XLight device (when the device is not powered the time count is suspended) .
unsigned int | max_time_between_signed_updates
the maximum time in seconds that is allowed to elapse between two successive 'signed date' update onto the XLight device
unsigned int | next_signed_update_time
the date expressed in Unix Time within which the 'signed time' update must be done to avoid errors.
unsigned int | challenge_expiration_time
maximum allowed time duration expressed in seconds of the challenge-response procedure used for the 'signed time' update on XLight.
unsigned int | max_update_date_error
the maximum number of errors that it is allowed to occur updating the XLight device date (usually caused by passing non acceptable time values). Whenever the number of errors pass this value all the functions specified by the locking mask will fail.
unsigned int | update_date_error
current number of time update errors occurred (usually caused by passing non acceptable time values). Whenever the number of errors pass this value all the functions specified by the locking mask will fail.
unsigned int | max_missing_update_date_error
the maximum number of time that it is accepted a missing (non signed) date update within the expected time. Whenever the number of errors pass this value all the functions specified by the locking mask will fail.
unsigned int | missing_update_date_error
current number of "max_missing_update_date_error" type errors occurred.
unsigned int | max_missing_update_signed_date_error
the maximum number of time that it is accepted a missing 'signed date' update within the expected time.
unsigned int | missing_update_signed_date_error
current number of "max_missing_update_signed_date_error" type errors occurred.
unsigned int | stop_reason
if the functions are locked this value contains the status code for the reason that caused the lock.
unsigned int | cmd_counter
strictly increasing value used to avoid command reuse. This is the last value used for this field.
unsigned int | serial_number
the serial number of the referred XLight device

Detailed Description

Date license management data.

The structure contains the data of the XLight date management.


  • Data Fields
Data Fields
_XLT_DATE_INFO Struct Reference
XLT_DATE_INFO structure

Date info retrieved from a XLight device. More...

#include <xlt.h>

Data Fields

unsigned int | type
type of data contained int the 'tc' argument. It may takes the XLT_TIMER_COUNTER_INFO data types values
unsigned int | rfu
Reserved for future usage.
XLT_D_INFO d
the data retrieved from the XLight device

Detailed Description

Date info retrieved from a XLight device.


  • Data Fields
Data Fields
_XLT_DATE_LOG Struct Reference
Log information

Log structure This is the structure containing the log info produced by the automatic date management. More...

#include <xlt.h>

Data Fields

unsigned int | time
Unix Time at which the log event occurred.
int | action
action performed while the error or event occurred
int | status
status of the operation (error code Errors)
unsigned int | device_index
the index of the device on which the operation was done
unsigned int | log_counter
numeric value assigned to the log entry (every record of the log has a unique increasing value)

Detailed Description

Log structure This is the structure containing the log info produced by the automatic date management.

The function xlt_date_manage_get_log_records() returns an array of this structure.


  • Data Fields
Data Fields
_XLT_DATE_SET_EXPIRATION_CMD Struct Reference
Date structures

Set expiration date command. More...

#include <xlt.h>

Data Fields

XLT_ULONG_LONG | functions_to_lock_mask
bits mask of the functions that won't work after license expiration date (time update errors may lock the masked functions too).
unsigned int | expiration_time
date of expiration time expressed int Unix Time (defined as the number of seconds that have elapsed since 00:00:00 Coordinated Universal Time (UTC), 1 January 1970).
unsigned int | current_time
the current time. This time is expressed in Unix Time.
unsigned int | max_time_between_updates
the maximum time in seconds that is allowed to elapse between two successive normal date (i.e. not certified) update (when the device is not powered the time count is suspended).
unsigned int | max_time_between_signed_updates
the maximum time in seconds that is allowed to elapse between two successive certificated date update (when the device is not powered the time count is suspended).
unsigned int | challenge_expiration_time
maximum allowed time duration expressed in seconds of the challenge-response procedure used for the 'signed time' update on XLight.
unsigned int | max_update_date_error
the maximum number of errors that it is allowed to occur updating the XLight device date (usually caused by passing non acceptable time values). Whenever the number of errors pass this value the all the functions specified by the locking mask will fail
unsigned int | max_missing_update_date_error
the maximum number of time that the XLight device tolerates a missing time update. If this value is '0' no missing update is be accepted. Whenever the number of errors pass this value all the functions specified by the locking mask will fail.
unsigned int | max_missing_update_signed_date_error
the maximum number of time that the XLight device tolerates a missing 'signed time' update. If this value is '0' no missing update is be accepted. Whenever the number of errors pass this value all the functions specified by the locking mask will fail.
unsigned int | cmd_counter
strictly increasing value used to avoid command reuse.
unsigned int | serial_number
the serial number of the referred XLight device.

Detailed Description

Set expiration date command.

Values that must be set to initialize a XLight device for managing the license based on date expiration.


  • Data Fields
Data Fields
_XLT_DATE_SIGNED_DATE_CMD Struct Reference
Date structures

Signed date command structure. More...

#include <xlt.h>

Data Fields

unsigned char | challenge [XLT_DATE_CHALLENGE_SIZE]
the challenge buffer retrieved from the XLight device.
unsigned int | time
the current time. This time is expressed in Unix Time.

Detailed Description

Signed date command structure.


  • Data Fields
Data Fields
_XLT_TC_INFO Union Reference
Timer and Counters structures

Union of all timer and counters command and data, that is: XLT_TIMER_DATA, XLT_TIMER_ADD_CMD, XLT_COUNTER_DATA, XLT_TIMER_CMD and XLT_COUNTER_CMD. More...

#include <xlt.h>

Data Fields

XLT_COUNTER_DATA counter_data [XLT_COUNTERS_NUM]
array of XLT_COUNTER_DATA type containing information of all the counters.
XLT_TIMER_DATA timer_data
XLT_TIMER_DATA type: counter information.
XLT_COUNTER_CMD counter_cmd
XLT_COUNTER_CMD type: counter command.
XLT_TIMER_CMD timer_cmd
XLT_TIMER_CMD type: timer command.
XLT_TIMER_ADD_CMD timer_add_value_cmd
XLT_TIMER_ADD_CMD type: add timer command.

Detailed Description

Union of all timer and counters command and data, that is: XLT_TIMER_DATA, XLT_TIMER_ADD_CMD, XLT_COUNTER_DATA, XLT_TIMER_CMD and XLT_COUNTER_CMD.


  • Data Fields
Data Fields
_XLT_TIMER_ADD_CMD Struct Reference
Timer and Counters structures

The structure contains the command for incrementing the timer. More...

#include <xlt.h>

Data Fields

unsigned int | timer_value_minutes_to_add
minutes to add to the current value of the timer
unsigned int | cmd_counter
strictly increasing value used to avoid command replication. If the data is retrieved this is the last value used for this field
unsigned int | serial_number
the serial number of the referred XLight device

Detailed Description

The structure contains the command for incrementing the timer.


  • Data Fields
Data Fields
_XLT_TIMER_COUNTER_INFO Struct Reference
XLT_TIMER_COUNTER_INFO structure

Timer and counters info retrieved from a XLight device. More...

#include <xlt.h>

Data Fields

unsigned int | type
type of data contained int the 'tc' argument. It may takes the XLT_TIMER_COUNTER_INFO data types values
unsigned int | rfu
Reserved for future usage.
XLT_TC_INFO tc
the data retrieved from the XLight device

Detailed Description

Timer and counters info retrieved from a XLight device.


  • Data Fields
Data Fields
_XLT_TIMER_DATA Struct Reference
Timer and Counters structures

The structure contains the data of the XLight timer. More...

#include <xlt.h>

Data Fields

XLT_ULONG_LONG | functions_to_lock_mask
bits masks of the functions that won't work after timer expiration
unsigned int | timer_value_minutes
current value of the timer expressed in minutes, when this value is used in a command this is the starting value of the timer.
unsigned int | idle_time_minutes
idle time before stopping the timer countdown expressed in minutes. After idle_time_minutes of inactivity of the XLight device the countdown process is suspended. It will be resumed at the first access to the dongle.
unsigned int | cmd_counter
strictly increasing value used to avoid command replication. If the data is retrieved this is the last value used for this field.
unsigned int | serial_number
the serial number of the referred XLight device

Detailed Description

The structure contains the data of the XLight timer.


  • Data Fields
Data Structure Index
_
_
_XLT_D_INFO _XLT_DATE_INFO _XLT_DATE_SIGNED_DATE_CMD _XLT_TIMER_COUNTER_INFO
_XLT_DATE_CHALLENGE _XLT_DATE_LOG _XLT_TC_INFO _XLT_TIMER_DATA
_XLT_COUNTER_DATA _XLT_DATE_DATA _XLT_DATE_SET_EXPIRATION_CMD _XLT_TIMER_ADD_CMD
_


  • Data Fields
  • All
  • Variables
  • a
  • c
  • d
  • e
  • f
  • i
  • l
  • m
  • n
  • r
  • s
  • t
  • u
Here is a list of all documented struct and union fields with links to the struct/union documentation for each field:

- a -

  • action : _XLT_DATE_LOG

- c -

  • challenge : _XLT_DATE_CHALLENGE , _XLT_DATE_SIGNED_DATE_CMD
  • challenge_expiration_time : _XLT_DATE_SET_EXPIRATION_CMD , _XLT_DATE_DATA
  • cmd_counter : _XLT_DATE_DATA , _XLT_DATE_SET_EXPIRATION_CMD , _XLT_TIMER_DATA , _XLT_TIMER_ADD_CMD , _XLT_COUNTER_DATA
  • counter_cmd : _XLT_TC_INFO
  • counter_data : _XLT_TC_INFO
  • counter_id : _XLT_COUNTER_DATA
  • counter_value : _XLT_COUNTER_DATA
  • current_time : _XLT_DATE_SET_EXPIRATION_CMD

- d -

  • d : _XLT_DATE_INFO
  • date_challenge : _XLT_D_INFO
  • date_data : _XLT_D_INFO
  • date_exp_cmd : _XLT_D_INFO
  • date_sig_cmd : _XLT_D_INFO
  • device_index : _XLT_DATE_LOG
  • device_time : _XLT_DATE_DATA

- e -

  • expiration_time : _XLT_DATE_DATA , _XLT_DATE_SET_EXPIRATION_CMD

- f -

  • functions_to_lock_mask : _XLT_TIMER_DATA , _XLT_DATE_SET_EXPIRATION_CMD , _XLT_DATE_DATA , _XLT_COUNTER_DATA

- i -

  • idle_time_minutes : _XLT_TIMER_DATA

- l -

  • log_counter : _XLT_DATE_LOG

- m -

  • max_missing_update_date_error : _XLT_DATE_DATA , _XLT_DATE_SET_EXPIRATION_CMD
  • max_missing_update_signed_date_error : _XLT_DATE_SET_EXPIRATION_CMD , _XLT_DATE_DATA
  • max_time_between_signed_updates : _XLT_DATE_DATA , _XLT_DATE_SET_EXPIRATION_CMD
  • max_time_between_updates : _XLT_DATE_SET_EXPIRATION_CMD , _XLT_DATE_DATA
  • max_update_date_error : _XLT_DATE_SET_EXPIRATION_CMD , _XLT_DATE_DATA
  • missing_update_date_error : _XLT_DATE_DATA
  • missing_update_signed_date_error : _XLT_DATE_DATA

- n -

  • next_signed_update_time : _XLT_DATE_DATA

- r -

  • reserved : _XLT_DATE_CHALLENGE
  • rfu : _XLT_DATE_INFO , _XLT_TIMER_COUNTER_INFO

- s -

  • serial_number : _XLT_TIMER_DATA , _XLT_TIMER_ADD_CMD , _XLT_DATE_DATA , _XLT_DATE_SET_EXPIRATION_CMD , _XLT_DATE_CHALLENGE , _XLT_COUNTER_DATA
  • status : _XLT_DATE_LOG
  • stop_reason : _XLT_DATE_DATA

- t -

  • tc : _XLT_TIMER_COUNTER_INFO
  • time : _XLT_DATE_SIGNED_DATE_CMD , _XLT_DATE_LOG
  • timer_add_value_cmd : _XLT_TC_INFO
  • timer_cmd : _XLT_TC_INFO
  • timer_data : _XLT_TC_INFO
  • timer_value_minutes : _XLT_TIMER_DATA
  • timer_value_minutes_to_add : _XLT_TIMER_ADD_CMD
  • trigger_functions_mask : _XLT_COUNTER_DATA
  • type : _XLT_TIMER_COUNTER_INFO , _XLT_DATE_INFO

- u -

  • update_date_error : _XLT_DATE_DATA


  • File List
  • Globals
File List
Here is a list of all documented files with brief descriptions:
xlt.h [code] | XLight Library
xlt_help.h [code] |


  • File List
  • Globals
Data Structures | Defines | Typedefs | Functions
xlt.h File Reference

XLight Library. More...

Go to the source code of this file.

Data Structures

struct | _XLT_TIMER_DATA
The structure contains the data of the XLight timer. More...
struct | _XLT_TIMER_ADD_CMD
The structure contains the command for incrementing the timer. More...
struct | _XLT_COUNTER_DATA
The structure contains the data of a XLight counter. More...
union | _XLT_TC_INFO
Union of all timer and counters command and data, that is: XLT_TIMER_DATA, XLT_TIMER_ADD_CMD, XLT_COUNTER_DATA, XLT_TIMER_CMD and XLT_COUNTER_CMD. More...
struct | _XLT_TIMER_COUNTER_INFO
Timer and counters info retrieved from a XLight device. More...
struct | _XLT_DATE_DATA
Date license management data. More...
struct | _XLT_DATE_CHALLENGE
Date license challenge for signed time update. More...
struct | _XLT_DATE_SET_EXPIRATION_CMD
Set expiration date command. More...
struct | _XLT_DATE_SIGNED_DATE_CMD
Signed date command structure. More...
union | _XLT_D_INFO
Union of all date command and data, that is: XLT_DATE_SET_EXPIRATION_CMD, XLT_DATE_SIGNED_DATE_CMD, XLT_DATE_DATA, and XLT_DATE_CHALLENGE. More...
struct | _XLT_DATE_INFO
Date info retrieved from a XLight device. More...
struct | _XLT_DATE_LOG
Log structure This is the structure containing the log info produced by the automatic date management. More...

Defines

#define | XLT_ULONG_LONG unsigned __int64
an alias for unsigned __int64
#define | XLT_FLAG_SETUP 0x10
Set if the device has been initialized.
#define | XLT_FLAG_FROZEN_BANK0 0x0100
Set if the bank 0 is frozen (no longer writable)
#define | XLT_FLAG_FROZEN_BANK1 0x0200
Set if the bank 1 is frozen (no longer writable)
#define | XLT_FLAG_FROZEN_BANK2 0x0400
Set if the bank 2 is frozen (no longer writable)
#define | XLT_FLAG_FROZEN_BANK3 0x0800
Set if the bank 3 is frozen (no longer writable)
#define | XLT_FLAG_FROZEN_BANK4 0x1000
Set if the bank 4 is frozen (no longer writable)
#define | XLT_FLAG_FROZEN_BANK5 0x2000
Set if the bank 5 is frozen (no longer writable)
#define | XLT_FLAG_FROZEN_BANK6 0x4000
Set if the bank 6 is frozen (no longer writable)
#define | XLT_FLAG_LOCKED_BANK0 0x010000
Set if the bank 0 is locked (writable only in encryption form)
#define | XLT_FLAG_LOCKED_BANK1 0x020000
Set if the bank 1 is locked (writable only in encryption form)
#define | XLT_FLAG_LOCKED_BANK2 0x040000
Set if the bank 2 is locked (writable only in encryption form)
#define | XLT_FLAG_LOCKED_BANK3 0x080000
Set if the bank 3 is locked (writable only in encryption form)
#define | XLT_FLAG_LOCKED_BANK4 0x100000
Set if the bank 4 is locked (writable only in encryption form)
#define | XLT_FLAG_LOCKED_BANK5 0x200000
Set if the bank 5 is locked (writable only in encryption form)
#define | XLT_FLAG_LOCKED_BANK6 0x400000
Set if the bank 6 is locked (writable only in encryption form)
#define | XLT_FLAG_TYPE_LOCK 0x800000
Indicate the type of lock applied: if set to 1 the Lock2 is set.
#define | XLT_MODEL_BASIC_USBHID 0x0
Device using the USB DriverLess protocol (HID). It doesn't require a kernel driver.
#define | XLT_MODEL_USBHID_SD 0x1
Device using the USB DriverLess protocol (HID) supplying also an interface for Micro SD reader.
#define | XLT_LABEL_SIZE 64
Size of the Label field passed to the xlt_getinfo() and xlt_setup() functions.
#define | XLT_PASSWORD_SIZE 32
Size of the password field.
#define | XLT_KEY_SIZE 32
Size of a cryptographic Key.
#define | XLT_BANK_SIZE 64
Size of each bank of memory of the XLight device.
#define | XLT_NUMBER_OF_BANKS 7
Number of memory banks of the XLight device.
#define | XLT_LOCKED_BANK_DATA_LENGTH 48
Portion of the usable data for a locked bank. The rest of the bank is used for internal purpose.
#define | XLT_LOCKED_TRANSFER_DATA 80
data to be passed or retrieved using xlt_write_locked() and xlt_read_locked()
#define | XLT_CIPHERTEXT_SIZE 16
Size of the plaintext and ciphertext passed or retrieved by the crypto functions (xlt_encrypt(), xlt_decrypt() and xlt_challenge())
#define | XLT_DEVICE_MAX 16
Max number of devices. Useful when scanning all the device with the xlt_getinfo() functions.
#define | XLT_SESSION_NUMBER_OF_KEYS 8
Number of AES Session Keys.
#define | XLT_RSA_512_BIT_SIZE 512
length in bit of the public modulus of a 512 bit RSA key
#define | XLT_RSA_512_WRAPPED_KEY_SIZE 144
dimension of an RSA private key with modulus of 512 bit in its wrapped form
#define | XLT_RSA_512_PUB_KEY_SIZE 68
dimension of an RSA public key with modulus of 512 bit
#define | XLT_RSA_512_PRIV_KEY_SIZE 132
dimension of an RSA private key with modulus of 512 bit
#define | XLT_RSA_512_PLAINTEXT_SIZE 64
dimension of a plaintext for a 512 bit RSA key
#define | XLT_RSA_512_CIPHERTEXT_SIZE XLT_RSA_512_PLAINTEXT_SIZE
dimension of a ciphertext for a 512 bit RSA key
#define | XLT_RSA_1024_BIT_SIZE 1024
length in bit of the public modulus of a 1024 bit RSA key
#define | XLT_RSA_1024_WRAPPED_KEY_SIZE 272
dimension of an RSA private key with modulus of 1024 bit in its wrapped form
#define | XLT_RSA_1024_PUB_KEY_SIZE 132
dimension of an RSA public key with modulus of 1024 bit
#define | XLT_RSA_1024_PRIV_KEY_SIZE 260
dimension of an RSA private key with modulus of 1024 bit
#define | XLT_RSA_1024_PLAINTEXT_SIZE 128
dimension of a plaintext for a 1024 bit RSA key
#define | XLT_RSA_1024_CIPHERTEXT_SIZE XLT_RSA_1024_PLAINTEXT_SIZE
dimension of a ciphertext for a 1024 bit RSA key
#define | XLT_DISK_PASSWORD_SIZE 32
Size of the disk password (used onto to sd devices).
#define | XLT_COUNTERS_NUM 4
number of usable counters in Xlight
#define | XLT_ERROR_SUCCESS 0
No error.
#define | XLT_ERROR_NOT_FOUND -1
Device not found.
#define | XLT_ERROR_INVALID_ARGUMENT -2
Function called with an invalid argument.
#define | XLT_ERROR_INVALID_STATE -3
Invalid state of the device for the required operation.
#define | XLT_ERROR_TRANSMIT -4
USB communication error.
#define | XLT_ERROR_RESOURCE -5
Resource error (usually not enough memory).
#define | XLT_ERROR_WRONG_PSWD -6
A wrong password has been used.
#define | XLT_ERROR_MISSING_DATA -7
Missing data (returned by an attempt to read memory from an unwritten bank)
#define | XLT_ERROR_FROZEN -8
Trying to write or freeze a frozen bank.
#define | XLT_ERROR_LOCKED -9
Trying to lock an already locked bank.
#define | XLT_ERROR_LOCKED_BAD_SERIAL -10
Writing in a locked bank passing a wrong serial.
#define | XLT_ERROR_LOCKED_BAD_COUNTER -11
Writing in a locked bank passing a wrong counter.
#define | XLT_ERROR_LOCKED_BAD_GROUP -12
Writing in a locked bank passing a wrong group number.
#define | XLT_ERROR_RSA_MAN -13
An error occurred running an RSA software function.
#define | XLT_ERROR_ENC_DISK_NOT_EXIST -14
Error on XLight SD trying to mount the non existent encrypted disk.
#define | XLT_ERROR_STOPPED -15
The function was stopped by the timer, counter or date protection management.
#define | XLT_ERROR_TC_BAD_SERIAL -16
Attempting to apply a time-counter setting on a device with unexpected serial number.
#define | XLT_ERROR_TC_BAD_FORMAT -17
Bad timer-counter command or data format (for instance a wrong Dongle Key was used)
#define | XLT_ERROR_TC_BAD_CMD_COUNTER -18
The counter of the time-counter command was wrong (probably the command was already been applied)
#define | XLT_ERROR_TC_BAD_VALUE -19
Wrong timer or conter value, it's value exceed the allowed limit.
#define | XLT_ERROR_DATE_BAD_SERIAL -20
Attempting to apply a date setting on a device with unexpected serial number.
#define | XLT_ERROR_DATE_BAD_FORMAT -21
Bad date command or data format (for instance a wrong Dongle Key was used)
#define | XLT_ERROR_DATE_BAD_CMD_COUNTER -22
The counter of the date command was wrong (probably the command was already been applied)
#define | XLT_ERROR_DATE_BAD_VALUE -23
sent a date older than the one extimated by the device
#define | XLT_ERROR_DATE_STOPPED -24
The function was stopped by the date protection management.
#define | XLT_ERROR_DATE_NOT_CONFIGURED -25
Date management not configured.
#define | XLT_ERROR_DATE_BAD_CHALLENGE -26
Bad challenge value (value not expected)
#define | XLT_ERROR_DATE_CHALLENGE_TIME_OUT -27
The signed data was sent after challenge expiration.
#define | XLT_ERROR_DATE_UNUSED_SIGNED_TIME -28
A signed date is not expected by the device.
#define | XLT_ERROR_RSA_INTERNAL_ERROR -29
An internal error occurred running the RSA algorithm (it should never happen)
#define | XLT_ERROR_DATEMAN_EXPIRED -30
date license expired
#define | XLT_ERROR_DATEMAN_TIME_SOURCE_UNAVAILABLE -31
any attempt to get a date (local or form internet) is failed
#define | XLT_ERROR_DATEMAN_INTERRUPTED -32
date management function was abruptly interrupted
#define | XLT_ERROR_DATEMAN_IS_RUNNING -40
the date management thread is (already) running and the called function can't be done
#define | XLT_ERROR_DATEMAN_NOT_RUNNING -41
the date management thread is not running
#define | XLT_ERROR_DATEMAN_NOT_SUPPORTED -42
the XLight device doesn't support date license or date license is not set
#define | XLT_ERROR_DATEMAN_PENDING -43
the date management is pending (that is it is running and the task is not completed yet)
#define | XLT_ERROR_DATEMAN_NTP_UNAVAILABLE -52
the NTP server is not found (the address is wrong or cannot be resolved or the internet connection is down)
#define | XLT_ERROR_DATEMAN_NTP_INCONSISTENT -53
the collected NTP time is wrong
#define | XLT_ERROR_DATEMAN_NTP_INTERNAL_ERROR -54
an error occurred managing the NTP time acquiring process
#define | XLT_ERROR_DATEMAN_NTP_LOW_TIME_QUALITY -55
the quality of the NTP time is not good enough
#define | XLT_ERROR_DATEMAN_HTTP_INTERNAL_ERROR -60
an internal error happened collecting the signed time
#define | XLT_ERROR_DATEMAN_HTTP_GENERIC_ERROR -61
a generic error happened collecting the signed time
#define | XLT_ERROR_DATEMAN_HTTP_INVALID_URL -62
invalid URL of the signed time server
#define | XLT_ERROR_DATEMAN_HTTP_CANNOT_CONNECT -63
impossible to establish a connection with the signed time server
#define | XLT_ERROR_DATEMAN_HTTP_CONNECTION_ERROR -64
the connection to the signed time server failed
#define | XLT_ERROR_DATEMAN_HTTP_TIMEOUT -65
timeout of the connection to the signed time server
#define | XLT_ERROR_DATEMAN_HTTP_MISSING_DATA -66
same expected data was missing during a communication with the signed time server
#define | XLT_ERROR_UNKNOWN -100
an unknown error has occurred
#define | XLT_TC_UNKNOWN 0
Unknown data.
#define | XLT_TC_WRITE_COUNTER_CMD 1
the data in the structure are related to a write counter command (xlt_generate_counter_settings())
#define | XLT_TC_WRITE_TIMER_CMD 2
the data in the structure are related to a write timer command (xlt_generate_timer_settings())
#define | XLT_TC_ADD_TIMER_VALUE_CMD 3
the data in the structure are related to a add timer command (xlt_generate_timer_add_settings())
#define | XLT_TC_READ_COUNTERS_DATA 4
the data in the structure are related to read counters info (xlt_enc_read_counters())
#define | XLT_TC_READ_TIMER_DATA 5
the data in the structure are related to read timer info (xlt_enc_read_timer())
#define | XLT_GENERATE_COUNTER_SETTINGS_CMD_ENC_SIZE 60
size of the encrypted buffer returned by xlt_generate_counter_settings()
#define | XLT_GENERATE_TIMER_SETTINGS_CMD_ENC_SIZE 44
size of the encrypted buffer returned by xlt_generate_timer_settings()
#define | XLT_GENERATE_TIMER_ADD_SETTINGS_CMD_ENC_SIZE 44
size of the encrypted buffer returned by xlt_generate_timer_add_settings()
#define | XLT_ENC_READ_COUNTERS_DATA_SIZE 156
size of the encrypted buffer returned by xlt_enc_read_counters()
#define | XLT_ENC_READ_TIMER_DATA_SIZE 44
size of the encrypted buffer returned by xlt_enc_read_timer()
#define | XLT_LOCK_READ_DATA_B0 (((XLT_ULONG_LONG)1) << 0)
Lock the function "Read from bank 0".
#define | XLT_LOCK_READ_DATA_B1 (((XLT_ULONG_LONG)1) << 1)
Lock the function "Read from bank 1".
#define | XLT_LOCK_READ_DATA_B2 (((XLT_ULONG_LONG)1) << 2)
Lock the function "Read from bank 2".
#define | XLT_LOCK_READ_DATA_B3 (((XLT_ULONG_LONG)1) << 3)
Lock the function "Read from bank 3".
#define | XLT_LOCK_READ_DATA_B4 (((XLT_ULONG_LONG)1) << 4)
Lock the function "Read from bank 4".
#define | XLT_LOCK_READ_DATA_B5 (((XLT_ULONG_LONG)1) << 5)
Lock the function "Read from bank 5".
#define | XLT_LOCK_READ_DATA_B6 (((XLT_ULONG_LONG)1) << 6)
Lock the function "Read from bank 6".
#define | XLT_LOCK_RESERVED_7 (((XLT_ULONG_LONG)1) << 7)
RFU.
#define | XLT_LOCK_WRITE_DATA_B0 (((XLT_ULONG_LONG)1) << 8)
Lock the function "Write on bank 0".
#define | XLT_LOCK_WRITE_DATA_B1 (((XLT_ULONG_LONG)1) << 9)
Lock the function "Write on bank 1".
#define | XLT_LOCK_WRITE_DATA_B2 (((XLT_ULONG_LONG)1) << 10)
Lock the function "Write on bank 2".
#define | XLT_LOCK_WRITE_DATA_B3 (((XLT_ULONG_LONG)1) << 11)
Lock the function "Write on bank 3".
#define | XLT_LOCK_WRITE_DATA_B4 (((XLT_ULONG_LONG)1) << 12)
Lock the function "Write on bank 4".
#define | XLT_LOCK_WRITE_DATA_B5 (((XLT_ULONG_LONG)1) << 13)
Lock the function "Write on bank 5".
#define | XLT_LOCK_WRITE_DATA_B6 (((XLT_ULONG_LONG)1) << 14)
Lock the function "Write on bank 6".
#define | XLT_LOCK_RESERVED_15 (((XLT_ULONG_LONG)1) << 15)
RFU.
#define | XLT_LOCK_SESSION_CRYPT_0 (((XLT_ULONG_LONG)1) << 16)
Lock the function "Session Encryption with key of index 0".
#define | XLT_LOCK_SESSION_CRYPT_1 (((XLT_ULONG_LONG)1) << 17)
Lock the function "Session Encryption with key of index 1".
#define | XLT_LOCK_SESSION_CRYPT_2 (((XLT_ULONG_LONG)1) << 18)
Lock the function "Session Encryption with key of index 2".
#define | XLT_LOCK_SESSION_CRYPT_3 (((XLT_ULONG_LONG)1) << 19)
Lock the function "Session Encryption with key of index 3".
#define | XLT_LOCK_SESSION_CRYPT_4 (((XLT_ULONG_LONG)1) << 20)
Lock the function "Session Encryption with key of index 4".
#define | XLT_LOCK_SESSION_CRYPT_5 (((XLT_ULONG_LONG)1) << 21)
Lock the function "Session Encryption with key of index 5".
#define | XLT_LOCK_SESSION_CRYPT_6 (((XLT_ULONG_LONG)1) << 22)
Lock the function "Session Encryption with key of index 6".
#define | XLT_LOCK_SESSION_CRYPT_7 (((XLT_ULONG_LONG)1) << 23)
Lock the function "Session Encryption with key of index 7".
#define | XLT_LOCK_SESSION_DECRYPT_0 (((XLT_ULONG_LONG)1) << 24)
Lock the function "Session Decryption with key of index 0".
#define | XLT_LOCK_SESSION_DECRYPT_1 (((XLT_ULONG_LONG)1) << 25)
Lock the function "Session Decryption with key of index 1".
#define | XLT_LOCK_SESSION_DECRYPT_2 (((XLT_ULONG_LONG)1) << 26)
Lock the function "Session Decryption with key of index 2".
#define | XLT_LOCK_SESSION_DECRYPT_3 (((XLT_ULONG_LONG)1) << 27)
Lock the function "Session Decryption with key of index 3".
#define | XLT_LOCK_SESSION_DECRYPT_4 (((XLT_ULONG_LONG)1) << 28)
Lock the function "Session Decryption with key of index 4".
#define | XLT_LOCK_SESSION_DECRYPT_5 (((XLT_ULONG_LONG)1) << 29)
Lock the function "Session Decryption with key of index 5".
#define | XLT_LOCK_SESSION_DECRYPT_6 (((XLT_ULONG_LONG)1) << 30)
Lock the function "Session Decryption with key of index 6".
#define | XLT_LOCK_SESSION_DECRYPT_7 (((XLT_ULONG_LONG)1) << 31)
Lock the function "Session Decryption with key of index 7".
#define | XLT_LOCK_RSA_CRT_SET_KEY_512 (((XLT_ULONG_LONG)1) << 32)
Lock the function "Set RSA 512 key".
#define | XLT_LOCK_RSA_CRT_SET_KEY_1024 (((XLT_ULONG_LONG)1) << 33)
Lock the function "Set RSA 1024 key".
#define | XLT_LOCK_RSA_CRT_DECRYPT_512 (((XLT_ULONG_LONG)1) << 34)
Lock the function "Decrypt with RSA 512 key".
#define | XLT_LOCK_RSA_CRT_DECRYPT_1024 (((XLT_ULONG_LONG)1) << 35)
Lock the function "Decrypt with RSA 1024 key".
#define | XLT_LOCK_RESERVED_36 (((XLT_ULONG_LONG)1) << 36)
RFU.
#define | XLT_LOCK_RESERVED_37 (((XLT_ULONG_LONG)1) << 37)
RFU.
#define | XLT_LOCK_RESERVED_38 (((XLT_ULONG_LONG)1) << 38)
RFU.
#define | XLT_LOCK_RESERVED_39 (((XLT_ULONG_LONG)1) << 39)
RFU.
#define | XLT_LOCK_CRYPT_ECB (((XLT_ULONG_LONG)1) << 40)
Lock the function xlt_encrypt()
#define | XLT_LOCK_DECRYPT_ECB (((XLT_ULONG_LONG)1) << 41)
Lock the function xlt_decrypt()
#define | XLT_LOCK_CHALLENGE_ECB (((XLT_ULONG_LONG)1) << 42)
Lock the function xlt_challenge()
#define | XLT_LOCK_RESERVED_43 (((XLT_ULONG_LONG)1) << 43)
RFU.
#define | XLT_LOCK_RESERVED_44 (((XLT_ULONG_LONG)1) << 44)
RFU.
#define | XLT_LOCK_RESERVED_45 (((XLT_ULONG_LONG)1) << 45)
RFU.
#define | XLT_LOCK_RESERVED_46 (((XLT_ULONG_LONG)1) << 46)
RFU.
#define | XLT_LOCK_RESERVED_47 (((XLT_ULONG_LONG)1) << 47)
RFU.
#define | XLT_TRIGGER_READ_DATA_B0 XLT_LOCK_READ_DATA_B0
Decrement a given counter when it is called the function "Read from bank 0".
#define | XLT_TRIGGER_READ_DATA_B1 XLT_LOCK_READ_DATA_B1
Decrement a given counter when it is called the function "Read from bank 1".
#define | XLT_TRIGGER_READ_DATA_B2 XLT_LOCK_READ_DATA_B2
Decrement a given counter when it is called the function "Read from bank 2".
#define | XLT_TRIGGER_READ_DATA_B3 XLT_LOCK_READ_DATA_B3
Decrement a given counter when it is called the function "Read from bank 3".
#define | XLT_TRIGGER_READ_DATA_B4 XLT_LOCK_READ_DATA_B4
Decrement a given counter when it is called the function "Read from bank 4".
#define | XLT_TRIGGER_READ_DATA_B5 XLT_LOCK_READ_DATA_B5
Decrement a given counter when it is called the function "Read from bank 5".
#define | XLT_TRIGGER_READ_DATA_B6 XLT_LOCK_READ_DATA_B6
Decrement a given counter when it is called the function "Read from bank 6".
#define | XLT_TRIGGER_RESERVED_7 XLT_LOCK_RESERVED_7
RFU.
#define | XLT_TRIGGER_WRITE_DATA_B0 XLT_LOCK_WRITE_DATA_B0
Decrement a given counter when it is called the function "Write on bank 0".
#define | XLT_TRIGGER_WRITE_DATA_B1 XLT_LOCK_WRITE_DATA_B1
Decrement a given counter when it is called the function "Write on bank 1".
#define | XLT_TRIGGER_WRITE_DATA_B2 XLT_LOCK_WRITE_DATA_B2
Decrement a given counter when it is called the function "Write on bank 2".
#define | XLT_TRIGGER_WRITE_DATA_B3 XLT_LOCK_WRITE_DATA_B3
Decrement a given counter when it is called the function "Write on bank 3".
#define | XLT_TRIGGER_WRITE_DATA_B4 XLT_LOCK_WRITE_DATA_B4
Decrement a given counter when it is called the function "Write on bank 4".
#define | XLT_TRIGGER_WRITE_DATA_B5 XLT_LOCK_WRITE_DATA_B5
Decrement a given counter when it is called the function "Write on bank 5".
#define | XLT_TRIGGER_WRITE_DATA_B6 XLT_LOCK_WRITE_DATA_B6
Decrement a given counter when it is called the function "Write on bank 6".
#define | XLT_TRIGGER_RESERVED_15 XLT_LOCK_RESERVED_15
RFU.
#define | XLT_TRIGGER_SESSION_CRYPT_0 XLT_LOCK_SESSION_CRYPT_0
Decrement a given counter when it is called the function "Session Encryption with key of index 0".
#define | XLT_TRIGGER_SESSION_CRYPT_1 XLT_LOCK_SESSION_CRYPT_1
Decrement a given counter when it is called the function "Session Encryption with key of index 1".
#define | XLT_TRIGGER_SESSION_CRYPT_2 XLT_LOCK_SESSION_CRYPT_2
Decrement a given counter when it is called the function "Session Encryption with key of index 2".
#define | XLT_TRIGGER_SESSION_CRYPT_3 XLT_LOCK_SESSION_CRYPT_3
Decrement a given counter when it is called the function "Session Encryption with key of index 3".
#define | XLT_TRIGGER_SESSION_CRYPT_4 XLT_LOCK_SESSION_CRYPT_4
Decrement a given counter when it is called the function "Session Encryption with key of index 4".
#define | XLT_TRIGGER_SESSION_CRYPT_5 XLT_LOCK_SESSION_CRYPT_5
Decrement a given counter when it is called the function "Session Encryption with key of index 5".
#define | XLT_TRIGGER_SESSION_CRYPT_6 XLT_LOCK_SESSION_CRYPT_6
Decrement a given counter when it is called the function "Session Encryption with key of index 6".
#define | XLT_TRIGGER_SESSION_CRYPT_7 XLT_LOCK_SESSION_CRYPT_7
Decrement a given counter when it is called the function "Session Encryption with key of index 7".
#define | XLT_TRIGGER_SESSION_DECRYPT_0 XLT_LOCK_SESSION_DECRYPT_0
Decrement a given counter when it is called the function "Session Decryption with key of index 0".
#define | XLT_TRIGGER_SESSION_DECRYPT_1 XLT_LOCK_SESSION_DECRYPT_1
Decrement a given counter when it is called the function "Session Decryption with key of index 1".
#define | XLT_TRIGGER_SESSION_DECRYPT_2 XLT_LOCK_SESSION_DECRYPT_2
Decrement a given counter when it is called the function "Session Decryption with key of index 2".
#define | XLT_TRIGGER_SESSION_DECRYPT_3 XLT_LOCK_SESSION_DECRYPT_3
Decrement a given counter when it is called the function "Session Decryption with key of index 3".
#define | XLT_TRIGGER_SESSION_DECRYPT_4 XLT_LOCK_SESSION_DECRYPT_4
Decrement a given counter when it is called the function "Session Decryption with key of index 4".
#define | XLT_TRIGGER_SESSION_DECRYPT_5 XLT_LOCK_SESSION_DECRYPT_5
Decrement a given counter when it is called the function "Session Decryption with key of index 5".
#define | XLT_TRIGGER_SESSION_DECRYPT_6 XLT_LOCK_SESSION_DECRYPT_6
Decrement a given counter when it is called the function "Session Decryption with key of index 6".
#define | XLT_TRIGGER_SESSION_DECRYPT_7 XLT_LOCK_SESSION_DECRYPT_7
Decrement a given counter when it is called the function "Session Decryption with key of index 7".
#define | XLT_TRIGGER_RSA_CRT_SET_KEY_512 XLT_LOCK_RSA_CRT_SET_KEY_512
Decrement a given counter when it is called the function "Set RSA 512 key".
#define | XLT_TRIGGER_RSA_CRT_SET_KEY_1024 XLT_LOCK_RSA_CRT_SET_KEY_1024
Decrement a given counter when it is called the function "Set RSA 1024 key".
#define | XLT_TRIGGER_RSA_CRT_DECRYPT_512 XLT_LOCK_RSA_CRT_DECRYPT_512
Decrement a given counter when it is called the function "Decrypt with RSA 512 key".
#define | XLT_TRIGGER_RSA_CRT_DECRYPT_1024 XLT_LOCK_RSA_CRT_DECRYPT_1024
Decrement a given counter when it is called the function "Decrypt with RSA 1024 key".
#define | XLT_TRIGGER_RESERVED_36 XLT_LOCK_RESERVED_36
RFU.
#define | XLT_TRIGGER_RESERVED_37 XLT_LOCK_RESERVED_37
RFU.
#define | XLT_TRIGGER_RESERVED_38 XLT_LOCK_RESERVED_38
RFU.
#define | XLT_TRIGGER_RESERVED_39 XLT_LOCK_RESERVED_39
RFU.
#define | XLT_TRIGGER_CRYPT_ECB XLT_LOCK_CRYPT_ECB
Decrement a given counter when it is called the function xlt_encrypt().
#define | XLT_TRIGGER_DECRYPT_ECB XLT_LOCK_DECRYPT_ECB
Decrement a given counter when it is called the function xlt_decrypt().
#define | XLT_TRIGGER_CHALLENGE_ECB XLT_LOCK_CHALLENGE_ECB
Decrement a given counter when it is called the function xlt_challenge().
#define | XLT_TRIGGER_RESERVED_43 XLT_LOCK_RESERVED_43
RFU.
#define | XLT_TRIGGER_RESERVED_44 XLT_LOCK_RESERVED_44
RFU.
#define | XLT_TRIGGER_RESERVED_45 XLT_LOCK_RESERVED_45
RFU.
#define | XLT_TRIGGER_RESERVED_46 XLT_LOCK_RESERVED_46
RFU.
#define | XLT_TRIGGER_RESERVED_47 XLT_LOCK_RESERVED_47
RFU.
#define | XLT_TRIGGER_GET_INFO (((XLT_ULONG_LONG)1) << 48)
Decrement a given counter when it is called the function xlt_getinfo() or xlt_locate().
#define | XLT_LOCK_ALL
Define for locking all the lockable functions.
#define | XLT_TRIGGER_ALL (XLT_LOCK_ALL | XLT_TRIGGER_GET_INFO)
Define for triggering all the triggerable functions.
#define | XLT_DATE_CHALLENGE_SIZE 16
the size of the challenge buffer for signed
#define | CHALLENGE_EXPIRATION_MAX_TIME (3600 * 24 * 7)
the maximimum time in seconds that challenge_expiration_time can assume (seven days)
#define | XLT_DATE_TYPE_UNKNOWN 0
Unknown data.
#define | XLT_DATE_TYPE_SET_EXPIRATION_CMD 1
set date expiration command.
#define | XLT_DATE_TYPE_SIGNED_DATE_CMD 2
set signed date command.
#define | XLT_DATE_TYPE_DATA 3
data containing information and settings of a date expiration management.
#define | XLT_DATE_TYPE_CHALLENGE 4
challenge data from Xlight device needed to issue a set signed date command.
#define | XLT_DATE_ENC_EXP_CMD_SIZE 76
the length of the encrypted buffer containing the command for setting the expiration date
#define | XLT_DATE_SIG_UPD_CMD_SIZE 44
the length of the encrypted buffer containing the command for updating the signed date
#define | XLT_DATE_ENC_CHALLENGE_SIZE 44
the length of the get challenge encrypted buffer
#define | XLT_DATE_READ_ENC_DATA_SIZE 76
the length of the encrypted buffer containing encrypted date info
#define | XLT_DATE_MANAGE_AUTO_START 1
start the automatic date management.
#define | XLT_DATE_MANAGE_AUTO_STOP 2
terminate the automatic date management.
#define | XLT_DATE_MANAGE_DO_SET_TIME 3
immdiately run date update onto the attached devices.
#define | XLT_DATE_MANAGE_DO_SET_TIME_ASYNC 4
immdiately start the date update onto the attached devices but not wait for completion.
#define | XLT_DATE_MANAGE_DO_SET_TIME_RESULT 5
get the status result of the execution xlt_date_manage() called with command argument XLT_DATE_MANAGE_DO_SET_TIME_ASYNC.
#define | XLT_DATE_MANAGE_CLEAN_STATE 6
cleanup the thread management status (that is the value retrieved using XLT_DATE_MANAGE_DO_SET_TIME_RESULT).
#define | XLT_DATE_MANAGE_SET_IDLE_TIME_SEC 7
set the idle timeout for the thread management (better not to choose less than 60 seconds and no more the half of the time refresh neeeded for the device time). Don't change this value if not needed.
#define | XLT_DATE_MANAGE_MAKE_LOGS 8
start or stop the log of the date management thread.
#define | XLT_DATE_MANAGE_CLEAN_LOG 9
cleanup logs.
#define | XLT_DATE_MANAGE_LOG_ONLY_ERROR 10
set or reset the log trace only for failed operation.
#define | XLT_DATE_MANAGE_LOG_SET_QUEUE_LEN 11
set the maximum number of the log records kept in memory (max 10000 records).
#define | XLT_DATE_OPT_USE_LOCAL_TIME 0x1
the automatic date management thread (when needed) updates the date of the device using the time of the computer .
#define | XLT_DATE_OPT_USE_INTERNET_TIME 0x2
the automatic date management thread (when needed) updates the date of the device using internet time (NTP: Network Time Protocol).
#define | XLT_DATE_OPT_USE_INTERNET_SIGNED_TIME 0x4
the automatic date management thread (when needed) updates the signed date using the OxySec service.
#define | XLT_DATE_OPT_IMMEDIATELY_USE_LOCAL_TIME 0x40
the automatic date management thread immediately update the date of the device just after being started (also if not strictly necessary).
#define | XLT_DATE_OPT_IMMEDIATELY_USE_INTERNET_TIME 0x80
the automatic date management thread immediately update the date of the device just after being started using NTP (also if not strictly necessary).
#define | XLT_DATE_OPT_IMMEDIATELY_USE_INTERNET_SIGNED_TIME 0x100
the automatic date management thread immediately update the signed date of the device just after being started (also if not strictly necessary).
#define | XLT_DATE_OPT_USE_INTERNET_TIME_FOR_SCHEDULING_TASKS 0x200
this setting doesn't allow to use local time for library scheduling (the local time wont' be used at all).
#define | LOG_ACTION_GET_DATE_INFO 1
event or error while getting date info from the device
#define | LOG_ACTION_SIGNED_TIME 2
event or error while attempting to perform the signed date update procedure
#define | LOG_ACTION_NTP_TIME 3
event or error while getting the internet time
#define | LOG_ACTION_LOCAL_TIME 4
event or error while setting the date to the device using local time
#define | LOCK2_AVAILABLE_MIN_VERSION_ON_MODEL_BASIC_USBHID 0x101
minimum XLight version that support the Lock2 feature on basic XLight devices.
#define | RSA_AVAILABLE_MIN_VERSION_ON_MODEL_BASIC_USBHID 0x200
minimum XLight version that support the RSA feature on basic XLight devices.
#define | SESSION_KEY_AVAILABLE_MIN_VERSION_ON_MODEL_BASIC_USBHID 0x200
minimum XLight version that support the AES Session Key feature on basic XLight devices.
#define | SD_MEM_AVAILABLE_MIN_VERSION_ON_MODEL_BASIC_USBHID 0xffff
minimum XLight version that support the SD memory feature on basic XLight devices (no basic XLight device supports this feature).
#define | TIMER_AVAILABLE_MIN_VERSION_ON_MODEL_BASIC_USBHID 0x210
minimum XLight version that support timer and counter management on basic XLight devices.
#define | DATE_AVAILABLE_MIN_VERSION_ON_MODEL_BASIC_USBHID 0x220
minimum XLight version that support timer and counter management on basic XLight devices.
#define | LOCK2_AVAILABLE_MIN_VERSION_ON_MODEL_USBHID_SD 0x100
minimum XLight version that support the Lock2 feature on XLight SD devices.
#define | RSA_AVAILABLE_MIN_VERSION_ON_MODEL_USBHID_SD 0x100
minimum XLight version that support the RSA feature on XLight SD devices.
#define | SESSION_KEY_AVAILABLE_MIN_VERSION_ON_MODEL_USBHID_SD 0x100
minimum XLight version that support the AES Session Key feature on XLight SD devices.
#define | SD_MEM_AVAILABLE_MIN_VERSION_ON_MODEL_USBHID_SD 0x100
minimum XLight version that support the SD memory feature on XLight SD devices.
#define | TIMER_AVAILABLE_MIN_VERSION_ON_MODEL_USBHID_SD 0xffff
minimum XLight version that support timer and counter management on XLight SD devices.
#define | DATE_AVAILABLE_MIN_VERSION_ON_MODEL_USBHID_SD 0xffff
minimum XLight version that support timer and counter management on XLight SD devices.
Compiler

Linking and calling convention specifications for the current compiler.

#define | XLT_LINK
Linking type of the exported XLight functions.
#define | XLT_API __stdcall
Calling convention of the exported XLight functions.
#define | XLT_DATE_STOP_FOR_DATE_EXPIRATION 0x01
Date reason for device halting This value is a mask of bits returned by stop_reason field in the structure XLT_DATE_DATA.
#define | XLT_DATE_STOP_FOR_UPDATE_MAX_ERROR 0x02
the number of allowed error during time update was passed.
#define | XLT_DATE_STOP_FOR_NORMAL_UPDATE_TIME_OUT_MAX_ERROR 0x04
the number of missing time update was passed (too long time without date update).
#define | XLT_DATE_STOP_FOR_SIGNED_UPDATE_TIME_OUT_MAX_ERROR 0x08
the number of missing signed time update was passed (too long time without signed date update).

Typedefs

typedef struct _XLT_TIMER_DATA | XLT_TIMER_DATA
typedef struct _XLT_TIMER_ADD_CMD | XLT_TIMER_ADD_CMD
typedef struct _XLT_COUNTER_DATA | XLT_COUNTER_DATA
typedef XLT_TIMER_DATA | XLT_TIMER_CMD
Contains the command for setting the timer.
typedef XLT_COUNTER_DATA | XLT_COUNTER_CMD
Contains the command for setting a counter.
typedef union _XLT_TC_INFO | XLT_TC_INFO
typedef struct
_XLT_TIMER_COUNTER_INFO 		XLT_TIMER_COUNTER_INFO
Timer and counters info retrieved from a XLight device.
typedef struct _XLT_DATE_DATA | XLT_DATE_DATA
typedef struct
_XLT_DATE_SET_EXPIRATION_CMD 		XLT_DATE_SET_EXPIRATION_CMD
typedef struct
_XLT_DATE_SIGNED_DATE_CMD 		XLT_DATE_SIGNED_DATE_CMD
typedef union _XLT_D_INFO | XLT_D_INFO
typedef struct _XLT_DATE_INFO | XLT_DATE_INFO
Date info retrieved from a XLight device.
typedef struct _XLT_DATE_LOG | XLT_DATE_LOG
Log structure This is the structure containing the log info produced by the automatic date management.
typedef struct _XLT_DATE_CHALLENGE | XLT_DATE_CHALLENGE

Functions

int XLT_API | xlt_getinfo (unsigned int device, unsigned int *pversion, unsigned int *pmodel, unsigned int *pflags, unsigned int *pserial, unsigned char *label)
Return information about the selected device.
int XLT_API | xlt_setup (unsigned int device, const unsigned char *label, const unsigned char *password, const unsigned char *dongle_key, const unsigned char *cr_key)
Set the label, the password and the cryptographic keys of the device.
int XLT_API | xlt_locate (const unsigned char *label)
Find a device with the specified label.
int XLT_API | xlt_write (unsigned int device, const unsigned char *password, unsigned int bank, const unsigned char *data)
Write into a memory bank of the XLight device.
int XLT_API | xlt_read (unsigned int device, const unsigned char *password, unsigned int bank, unsigned char *data)
Read from a memory bank of the XLight device.
int XLT_API | xlt_bank_freeze (unsigned int device, const unsigned char *password, unsigned int bank)
Freeze a given memory bank.
int XLT_API | xlt_encrypt (unsigned int device, const unsigned char *plaintext, unsigned char *ciphertext)
Perform AES-256 encryption.
int XLT_API | xlt_decrypt (unsigned int device, const unsigned char *ciphertext, unsigned char *plaintext)
Perform AES-256 decryption.
int XLT_API | xlt_challenge (unsigned int device, const unsigned char *challenge, unsigned char *response)
Challenge-Response computation based on AES-256.
int XLT_API | xlt_session_set_key (unsigned int device, unsigned int key_index, const unsigned char *wrapped_key)
Load on a XLight device the session AES key to be used for AES session encryption functions.
int XLT_API | xlt_session_encrypt (unsigned int device, unsigned int key_index, const unsigned char *plaintext, unsigned char *ciphertext)
Encrypt data using a Session Key.
int XLT_API | xlt_session_decrypt (unsigned int device, unsigned int key_index, const unsigned char *ciphertext, unsigned char *plaintext)
Decrypt data using a Session Key.
int XLT_API | xlt_session_wrap_key (const unsigned char *session_key, const unsigned char *dongle_key, unsigned char *wrapped_key)
Wraps a Session Key.
int XLT_API | xlt_rsa_generate_key (unsigned int bit_size, unsigned char *private_key, unsigned int private_key_size, unsigned int *p_private_key_len, unsigned char *public_key, unsigned int public_key_size, unsigned int *p_public_key_len)
Generate an RSA key.
int XLT_API | xlt_rsa_wrap_privkey (const unsigned char *private_key, unsigned int private_key_length, const unsigned char *dongle_key, unsigned char *wrapped_key, unsigned int wrapped_key_len)
Wraps an RSA key.
int XLT_API | xlt_rsa_set_privkey (unsigned int device, const unsigned char *wrapped_key, unsigned int wrapped_key_length)
Load an RSA private key onto an XLight device.
int XLT_API | xlt_never_use_this_rsa_encrypt (const unsigned char *public_key, unsigned int public_key_len, const unsigned char *plaintext, unsigned int plaintext_ciphertext_length, unsigned char *ciphertext)
Performs RSA encryption.
int XLT_API | xlt_never_use_this_rsa_sw_decrypt (const unsigned char *private_key, unsigned int private_key_len, const unsigned char *ciphertext, unsigned int ciphertext_plaintext_length, unsigned char *plaintext)
Performs a software RSA decryption.
int XLT_API | xlt_rsa_decrypt (unsigned int device, const unsigned char *ciphertext, unsigned int ciphertext_plaintext_length, unsigned char *plaintext)
Runs an RSA decryption onto an XLight device.
int XLT_API | xlt_bank_lock (unsigned int device, const unsigned char *password, unsigned int bank, unsigned int group_number)
Lock a memory bank.
int XLT_API | xlt_bank_lock2 (unsigned int device, const unsigned char *password, unsigned int bank, unsigned int group_number)
Lock a memory bank in advanced mode (Lock2).
int XLT_API | xlt_write_locked (unsigned int device, unsigned int bank, const unsigned char *transfer_data)
Perform a write operation in a locked bank (both normal and advanced Lock2 mode).
int XLT_API | xlt_read_locked (unsigned int device, unsigned int bank, unsigned char *transfer_data)
Perform a read operation in a locked bank (both normal and advanced Lock2 mode).
int XLT_API | xlt_set_write_locked_serial_check (const unsigned char *data, unsigned int bank, unsigned int new_counter, unsigned int serial, const unsigned char *dongle_key, unsigned char *transfer_data)
Encrypt the buffer to be written into a locked bank of a specific XLight device.
int XLT_API | xlt_set_write_locked2_serial_check (const unsigned char *data, unsigned int bank, unsigned int new_counter, unsigned int serial, const unsigned char *dongle_key, unsigned char *transfer_data)
Encrypt the buffer to be written into a bank locked with Lock2 of a specific XLight device.
int XLT_API | xlt_set_write_locked_group_check (const unsigned char *data, unsigned int bank, unsigned int new_counter, unsigned int group_number, const unsigned char *dongle_key, unsigned char *transfer_data)
Encrypt the buffer to be written into a locked bank belonging to an XLight devices of a given group.
int XLT_API | xlt_set_write_locked2_group_check (const unsigned char *data, unsigned int bank, unsigned int new_counter, unsigned int group_number, const unsigned char *dongle_key, unsigned char *transfer_data)
Encrypt the buffer to be written into a bank locked with Lock2 belonging to an XLight devices of a given group.
int XLT_API | xlt_decrypt_locked_data (const unsigned char *transfer_data, const unsigned char *dongle_key, unsigned char *data)
Retrieve the data in clear form of the content of a locked memory bank.
int XLT_API | xlt_decrypt_locked2_data (const unsigned char *transfer_data, const unsigned char *dongle_key, unsigned char *data)
Retrieve the data in clear form of the content of a locked with Lock2 memory bank.
int XLT_API | xlt_get_info_from_locked_bank (const unsigned char *data, unsigned int *pbank, unsigned int *pcounter, unsigned int *pserial, unsigned int *pgroup_number)
Return information of a locked bank (both normal and advanced Lock2 mode).
int XLT_API | xlt_virg_demo (unsigned int device)
Virginize (reset) a demo XLight device.
void XLT_API | xlt_close ()
Cleanup the allocated memory by the XLight functions.
int XLT_API | xlt_init ()
Initialize the environment for XLight management.
int XLT_API | xlt_storage_get_mem_size (unsigned int device, unsigned int *p_mem_size_in_blocks, unsigned int *p_enc_mem_size_in_blocks)
Get memory size information of the memory flash in XLight SD devices.
int XLT_API | xlt_storage_set (unsigned int device, unsigned int locked_mem_size_in_blocks, const unsigned char *dongle_key, const unsigned char *disk_password)
Initialize the memory flash of an XLight SD device.
int XLT_API | xlt_storage_unlock (unsigned int device, const unsigned char *disk_password)
Mount the encrypted disk of an XLight SD device.
int XLT_API | xlt_storage_unlock_ro (unsigned int device, const unsigned char *disk_password)
Mount the encrypted disk of an XLight SD device with read only access.
int XLT_API | xlt_storage_lock (unsigned int device, const unsigned char *disk_password)
Unmount the encrypted disk of an XLight SD device.
int XLT_API | xlt_update_get_counter (unsigned int device, unsigned int counter, unsigned int sub_value, unsigned int *p_new_value)
Update and get the value of a counter.
int XLT_API | xlt_get_timer (unsigned int device, unsigned int *p_value)
Retrieve the current value of the timer.
int XLT_API | xlt_generate_counter_settings (const XLT_COUNTER_CMD *counter_cmd, const unsigned char *dongle_key, unsigned char *enc_cmd, unsigned int enc_cmd_size, unsigned int *p_enc_cmd_len)
Generate a command buffer to a set a counter.
int XLT_API | xlt_generate_timer_settings (const XLT_TIMER_CMD *timer_cmd, const unsigned char *dongle_key, unsigned char *enc_cmd, unsigned int enc_cmd_size, unsigned int *p_enc_cmd_len)
Generate a command buffer to a set the timer.
int XLT_API | xlt_generate_timer_add_settings (const XLT_TIMER_ADD_CMD *timer_add_cmd, const unsigned char *dongle_key, unsigned char *enc_cmd, unsigned int enc_cmd_size, unsigned int *p_enc_cmd_len)
Generate a command buffer to increase the timer value.
int XLT_API | xlt_enc_apply_timer_counter (unsigned int device, const unsigned char *enc_cmd, unsigned int enc_cmd_len)
Apply a timer or counter command onto the device.
int XLT_API | xlt_enc_read_counters (unsigned int device, unsigned char *enc_data, unsigned int enc_data_size, unsigned int *p_enc_data_len)
Read in encrypted form the current state of all the counters of the device.
int XLT_API | xlt_enc_read_timer (unsigned int device, unsigned char *enc_data, unsigned int enc_data_size, unsigned int *p_enc_data_len)
Read in encrypted form the current state the device timer.
int XLT_API | xlt_timer_counters_retrieve (const unsigned char *enc_data, unsigned int enc_data_len, const unsigned char *dongle_key, XLT_TIMER_COUNTER_INFO *retrieved_data)
Decrypt encrypted data from the device regarding timer or counters.
int XLT_API | xlt_enc_read_date (unsigned int device, unsigned char *enc_data, unsigned int enc_data_size, unsigned int *p_enc_data_len)
Read in encrypted form the current state of the date license management of the device.
int XLT_API | xlt_read_date (unsigned int device, XLT_DATE_DATA *date_info)
Read the current state of the date license management of the device.
int XLT_API | xlt_set_date (unsigned int device, unsigned int time)
Set the current time (date) of the device.
int XLT_API | xlt_date_get_challenge (unsigned int device, unsigned char *enc_challenge, unsigned int enc_challenge_size, unsigned int *p_enc_challenge_len)
Retrieve the challenge buffer generated by the XLight device for update signed update (Signed date update constraint) The challenge buffer need to be used for setting the signed date onto the device See Date based licensing for an introduction to XLight license management based on the date.
int XLT_API | xlt_generate_date_expiration_cmd (const XLT_DATE_SET_EXPIRATION_CMD *cmd, const unsigned char *dongle_key, unsigned char *enc_cmd, unsigned int enc_cmd_size, unsigned int *p_enc_cmd_len)
Generate the license date expiration command See Date based licensing for an introduction to XLight license management based on the date (and the SetDateExpiration for an example of xlt_generate_date_expiration_cmd() usage).
int XLT_API | xlt_generate_signed_date_cmd (unsigned int time, const unsigned char *challenge, unsigned int challenge_len, const unsigned char *dongle_key, unsigned char *enc_cmd, unsigned int enc_cmd_size, unsigned int *p_enc_cmd_len)
Generate the signed date command.
int XLT_API | xlt_apply_date_enc_cmd (unsigned int device, const unsigned char *enc_cmd, unsigned int enc_cmd_len)
Apply both license expiration setting and signed date update to the XLight device.
int XLT_API | xlt_date_enc_retrieve (const unsigned char *enc_data, unsigned int enc_data_len, const unsigned char *dongle_key, XLT_DATE_INFO *retrieved_data)
Decrypt the encrypted data returned by the device regarding the date license settings.
int XLT_API | xlt_date_manage (unsigned int cmd, unsigned int device, unsigned int options, const char *args, const unsigned char *label)
Date management function.
int XLT_API | xlt_date_manage_get_num_log_records (unsigned int *p_num_entries)
Retrieve the number of log records collected by the automatic date management process issued by xlt_date_manage().
int XLT_API | xlt_date_manage_get_log_records (unsigned int starting_index, unsigned int num_entries, XLT_DATE_LOG date_log[], unsigned int *p_num_entries_retrieved)
Retrieve log records collected by the automatic date management process issued by xlt_date_manage().

Detailed Description

XLight Library.


  • File List
  • Globals
  • All
  • Functions
  • Typedefs
  • Defines
  • c
  • d
  • l
  • r
  • s
  • t
  • x
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- c -

  • CHALLENGE_EXPIRATION_MAX_TIME : xlt.h


  • Data Fields
  • All
  • Variables
  • a
  • c
  • d
  • e
  • f
  • i
  • l
  • m
  • n
  • r
  • s
  • t
  • u

- a -

  • action : _XLT_DATE_LOG

- c -

  • challenge : _XLT_DATE_CHALLENGE , _XLT_DATE_SIGNED_DATE_CMD
  • challenge_expiration_time : _XLT_DATE_SET_EXPIRATION_CMD , _XLT_DATE_DATA
  • cmd_counter : _XLT_DATE_DATA , _XLT_DATE_SET_EXPIRATION_CMD , _XLT_TIMER_DATA , _XLT_TIMER_ADD_CMD , _XLT_COUNTER_DATA
  • counter_cmd : _XLT_TC_INFO
  • counter_data : _XLT_TC_INFO
  • counter_id : _XLT_COUNTER_DATA
  • counter_value : _XLT_COUNTER_DATA
  • current_time : _XLT_DATE_SET_EXPIRATION_CMD

- d -

  • d : _XLT_DATE_INFO
  • date_challenge : _XLT_D_INFO
  • date_data : _XLT_D_INFO
  • date_exp_cmd : _XLT_D_INFO
  • date_sig_cmd : _XLT_D_INFO
  • device_index : _XLT_DATE_LOG
  • device_time : _XLT_DATE_DATA

- e -

  • expiration_time : _XLT_DATE_DATA , _XLT_DATE_SET_EXPIRATION_CMD

- f -

  • functions_to_lock_mask : _XLT_TIMER_DATA , _XLT_DATE_SET_EXPIRATION_CMD , _XLT_DATE_DATA , _XLT_COUNTER_DATA

- i -

  • idle_time_minutes : _XLT_TIMER_DATA

- l -

  • log_counter : _XLT_DATE_LOG

- m -

  • max_missing_update_date_error : _XLT_DATE_DATA , _XLT_DATE_SET_EXPIRATION_CMD
  • max_missing_update_signed_date_error : _XLT_DATE_SET_EXPIRATION_CMD , _XLT_DATE_DATA
  • max_time_between_signed_updates : _XLT_DATE_DATA , _XLT_DATE_SET_EXPIRATION_CMD
  • max_time_between_updates : _XLT_DATE_SET_EXPIRATION_CMD , _XLT_DATE_DATA
  • max_update_date_error : _XLT_DATE_SET_EXPIRATION_CMD , _XLT_DATE_DATA
  • missing_update_date_error : _XLT_DATE_DATA
  • missing_update_signed_date_error : _XLT_DATE_DATA

- n -

  • next_signed_update_time : _XLT_DATE_DATA

- r -

  • reserved : _XLT_DATE_CHALLENGE
  • rfu : _XLT_DATE_INFO , _XLT_TIMER_COUNTER_INFO

- s -

  • serial_number : _XLT_TIMER_DATA , _XLT_TIMER_ADD_CMD , _XLT_DATE_DATA , _XLT_DATE_SET_EXPIRATION_CMD , _XLT_DATE_CHALLENGE , _XLT_COUNTER_DATA
  • status : _XLT_DATE_LOG
  • stop_reason : _XLT_DATE_DATA

- t -

  • tc : _XLT_TIMER_COUNTER_INFO
  • time : _XLT_DATE_SIGNED_DATE_CMD , _XLT_DATE_LOG
  • timer_add_value_cmd : _XLT_TC_INFO
  • timer_cmd : _XLT_TC_INFO
  • timer_data : _XLT_TC_INFO
  • timer_value_minutes : _XLT_TIMER_DATA
  • timer_value_minutes_to_add : _XLT_TIMER_ADD_CMD
  • trigger_functions_mask : _XLT_COUNTER_DATA
  • type : _XLT_TIMER_COUNTER_INFO , _XLT_DATE_INFO

- u -

  • update_date_error : _XLT_DATE_DATA


  • File List
  • Globals
  • All
  • Functions
  • Typedefs
  • Defines
  • c
  • d
  • l
  • r
  • s
  • t
  • x
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- l -

  • LOCK2_AVAILABLE_MIN_VERSION_ON_MODEL_BASIC_USBHID : xlt.h
  • LOCK2_AVAILABLE_MIN_VERSION_ON_MODEL_USBHID_SD : xlt.h
  • LOG_ACTION_GET_DATE_INFO : xlt.h
  • LOG_ACTION_LOCAL_TIME : xlt.h
  • LOG_ACTION_NTP_TIME : xlt.h
  • LOG_ACTION_SIGNED_TIME : xlt.h


  • File List
  • Globals
  • All
  • Functions
  • Typedefs
  • Defines
  • c
  • d
  • l
  • r
  • s
  • t
  • x
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- d -

  • DATE_AVAILABLE_MIN_VERSION_ON_MODEL_BASIC_USBHID : xlt.h
  • DATE_AVAILABLE_MIN_VERSION_ON_MODEL_USBHID_SD : xlt.h


  • File List
  • Globals
  • All
  • Functions
  • Typedefs
  • Defines
  • c
  • d
  • l
  • r
  • s
  • t
  • x
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- r -

  • RSA_AVAILABLE_MIN_VERSION_ON_MODEL_BASIC_USBHID : xlt.h
  • RSA_AVAILABLE_MIN_VERSION_ON_MODEL_USBHID_SD : xlt.h


  • File List
  • Globals
  • All
  • Functions
  • Typedefs
  • Defines
  • c
  • d
  • l
  • r
  • s
  • t
  • x
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- s -

  • SD_MEM_AVAILABLE_MIN_VERSION_ON_MODEL_BASIC_USBHID : xlt.h
  • SD_MEM_AVAILABLE_MIN_VERSION_ON_MODEL_USBHID_SD : xlt.h
  • SESSION_KEY_AVAILABLE_MIN_VERSION_ON_MODEL_BASIC_USBHID : xlt.h
  • SESSION_KEY_AVAILABLE_MIN_VERSION_ON_MODEL_USBHID_SD : xlt.h


  • File List
  • Globals
  • All
  • Functions
  • Typedefs
  • Defines
  • c
  • d
  • l
  • r
  • s
  • t
  • x
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- t -

  • TIMER_AVAILABLE_MIN_VERSION_ON_MODEL_BASIC_USBHID : xlt.h
  • TIMER_AVAILABLE_MIN_VERSION_ON_MODEL_USBHID_SD : xlt.h


  • File List
  • Globals
  • All
  • Functions
  • Typedefs
  • Defines
  • c
  • d
  • l
  • r
  • s
  • t
  • x
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- x -

  • XLT_API : xlt.h
  • xlt_apply_date_enc_cmd() : xlt.h
  • xlt_bank_freeze() : xlt.h
  • xlt_bank_lock() : xlt.h
  • xlt_bank_lock2() : xlt.h
  • XLT_BANK_SIZE : xlt.h
  • xlt_challenge() : xlt.h
  • XLT_CIPHERTEXT_SIZE : xlt.h
  • xlt_close() : xlt.h
  • XLT_COUNTER_CMD : xlt.h
  • XLT_COUNTER_DATA : xlt.h
  • XLT_COUNTERS_NUM : xlt.h
  • XLT_D_INFO : xlt.h
  • XLT_DATE_CHALLENGE : xlt.h
  • XLT_DATE_CHALLENGE_SIZE : xlt.h
  • XLT_DATE_DATA : xlt.h
  • XLT_DATE_ENC_CHALLENGE_SIZE : xlt.h
  • XLT_DATE_ENC_EXP_CMD_SIZE : xlt.h
  • xlt_date_enc_retrieve() : xlt.h
  • xlt_date_get_challenge() : xlt.h
  • XLT_DATE_INFO : xlt.h
  • XLT_DATE_LOG : xlt.h
  • xlt_date_manage() : xlt.h
  • XLT_DATE_MANAGE_AUTO_START : xlt.h
  • XLT_DATE_MANAGE_AUTO_STOP : xlt.h
  • XLT_DATE_MANAGE_CLEAN_LOG : xlt.h
  • XLT_DATE_MANAGE_CLEAN_STATE : xlt.h
  • XLT_DATE_MANAGE_DO_SET_TIME : xlt.h
  • XLT_DATE_MANAGE_DO_SET_TIME_ASYNC : xlt.h
  • XLT_DATE_MANAGE_DO_SET_TIME_RESULT : xlt.h
  • xlt_date_manage_get_log_records() : xlt.h
  • xlt_date_manage_get_num_log_records() : xlt.h
  • XLT_DATE_MANAGE_LOG_ONLY_ERROR : xlt.h
  • XLT_DATE_MANAGE_LOG_SET_QUEUE_LEN : xlt.h
  • XLT_DATE_MANAGE_MAKE_LOGS : xlt.h
  • XLT_DATE_MANAGE_SET_IDLE_TIME_SEC : xlt.h
  • XLT_DATE_OPT_IMMEDIATELY_USE_INTERNET_SIGNED_TIME : xlt.h
  • XLT_DATE_OPT_IMMEDIATELY_USE_INTERNET_TIME : xlt.h
  • XLT_DATE_OPT_IMMEDIATELY_USE_LOCAL_TIME : xlt.h
  • XLT_DATE_OPT_USE_INTERNET_SIGNED_TIME : xlt.h
  • XLT_DATE_OPT_USE_INTERNET_TIME : xlt.h
  • XLT_DATE_OPT_USE_INTERNET_TIME_FOR_SCHEDULING_TASKS : xlt.h
  • XLT_DATE_OPT_USE_LOCAL_TIME : xlt.h
  • XLT_DATE_READ_ENC_DATA_SIZE : xlt.h
  • XLT_DATE_SET_EXPIRATION_CMD : xlt.h
  • XLT_DATE_SIG_UPD_CMD_SIZE : xlt.h
  • XLT_DATE_SIGNED_DATE_CMD : xlt.h
  • XLT_DATE_STOP_FOR_DATE_EXPIRATION : xlt.h
  • XLT_DATE_STOP_FOR_NORMAL_UPDATE_TIME_OUT_MAX_ERROR : xlt.h
  • XLT_DATE_STOP_FOR_SIGNED_UPDATE_TIME_OUT_MAX_ERROR : xlt.h
  • XLT_DATE_STOP_FOR_UPDATE_MAX_ERROR : xlt.h
  • XLT_DATE_TYPE_CHALLENGE : xlt.h
  • XLT_DATE_TYPE_DATA : xlt.h
  • XLT_DATE_TYPE_SET_EXPIRATION_CMD : xlt.h
  • XLT_DATE_TYPE_SIGNED_DATE_CMD : xlt.h
  • XLT_DATE_TYPE_UNKNOWN : xlt.h
  • xlt_decrypt() : xlt.h
  • xlt_decrypt_locked2_data() : xlt.h
  • xlt_decrypt_locked_data() : xlt.h
  • XLT_DEVICE_MAX : xlt.h
  • XLT_DISK_PASSWORD_SIZE : xlt.h
  • xlt_enc_apply_timer_counter() : xlt.h
  • xlt_enc_read_counters() : xlt.h
  • XLT_ENC_READ_COUNTERS_DATA_SIZE : xlt.h
  • xlt_enc_read_date() : xlt.h
  • xlt_enc_read_timer() : xlt.h
  • XLT_ENC_READ_TIMER_DATA_SIZE : xlt.h
  • xlt_encrypt() : xlt.h
  • XLT_ERROR_DATE_BAD_CHALLENGE : xlt.h
  • XLT_ERROR_DATE_BAD_CMD_COUNTER : xlt.h
  • XLT_ERROR_DATE_BAD_FORMAT : xlt.h
  • XLT_ERROR_DATE_BAD_SERIAL : xlt.h
  • XLT_ERROR_DATE_BAD_VALUE : xlt.h
  • XLT_ERROR_DATE_CHALLENGE_TIME_OUT : xlt.h
  • XLT_ERROR_DATE_NOT_CONFIGURED : xlt.h
  • XLT_ERROR_DATE_STOPPED : xlt.h
  • XLT_ERROR_DATE_UNUSED_SIGNED_TIME : xlt.h
  • XLT_ERROR_DATEMAN_EXPIRED : xlt.h
  • XLT_ERROR_DATEMAN_HTTP_CANNOT_CONNECT : xlt.h
  • XLT_ERROR_DATEMAN_HTTP_CONNECTION_ERROR : xlt.h
  • XLT_ERROR_DATEMAN_HTTP_GENERIC_ERROR : xlt.h
  • XLT_ERROR_DATEMAN_HTTP_INTERNAL_ERROR : xlt.h
  • XLT_ERROR_DATEMAN_HTTP_INVALID_URL : xlt.h
  • XLT_ERROR_DATEMAN_HTTP_MISSING_DATA : xlt.h
  • XLT_ERROR_DATEMAN_HTTP_TIMEOUT : xlt.h
  • XLT_ERROR_DATEMAN_INTERRUPTED : xlt.h
  • XLT_ERROR_DATEMAN_IS_RUNNING : xlt.h
  • XLT_ERROR_DATEMAN_NOT_RUNNING : xlt.h
  • XLT_ERROR_DATEMAN_NOT_SUPPORTED : xlt.h
  • XLT_ERROR_DATEMAN_NTP_INCONSISTENT : xlt.h
  • XLT_ERROR_DATEMAN_NTP_INTERNAL_ERROR : xlt.h
  • XLT_ERROR_DATEMAN_NTP_LOW_TIME_QUALITY : xlt.h
  • XLT_ERROR_DATEMAN_NTP_UNAVAILABLE : xlt.h
  • XLT_ERROR_DATEMAN_PENDING : xlt.h
  • XLT_ERROR_DATEMAN_TIME_SOURCE_UNAVAILABLE : xlt.h
  • XLT_ERROR_ENC_DISK_NOT_EXIST : xlt.h
  • XLT_ERROR_FROZEN : xlt.h
  • XLT_ERROR_INVALID_ARGUMENT : xlt.h
  • XLT_ERROR_INVALID_STATE : xlt.h
  • XLT_ERROR_LOCKED : xlt.h
  • XLT_ERROR_LOCKED_BAD_COUNTER : xlt.h
  • XLT_ERROR_LOCKED_BAD_GROUP : xlt.h
  • XLT_ERROR_LOCKED_BAD_SERIAL : xlt.h
  • XLT_ERROR_MISSING_DATA : xlt.h
  • XLT_ERROR_NOT_FOUND : xlt.h
  • XLT_ERROR_RESOURCE : xlt.h
  • XLT_ERROR_RSA_INTERNAL_ERROR : xlt.h
  • XLT_ERROR_RSA_MAN : xlt.h
  • XLT_ERROR_STOPPED : xlt.h
  • XLT_ERROR_SUCCESS : xlt.h
  • XLT_ERROR_TC_BAD_CMD_COUNTER : xlt.h
  • XLT_ERROR_TC_BAD_FORMAT : xlt.h
  • XLT_ERROR_TC_BAD_SERIAL : xlt.h
  • XLT_ERROR_TC_BAD_VALUE : xlt.h
  • XLT_ERROR_TRANSMIT : xlt.h
  • XLT_ERROR_UNKNOWN : xlt.h
  • XLT_ERROR_WRONG_PSWD : xlt.h
  • XLT_FLAG_FROZEN_BANK0 : xlt.h
  • XLT_FLAG_FROZEN_BANK1 : xlt.h
  • XLT_FLAG_FROZEN_BANK2 : xlt.h
  • XLT_FLAG_FROZEN_BANK3 : xlt.h
  • XLT_FLAG_FROZEN_BANK4 : xlt.h
  • XLT_FLAG_FROZEN_BANK5 : xlt.h
  • XLT_FLAG_FROZEN_BANK6 : xlt.h
  • XLT_FLAG_LOCKED_BANK0 : xlt.h
  • XLT_FLAG_LOCKED_BANK1 : xlt.h
  • XLT_FLAG_LOCKED_BANK2 : xlt.h
  • XLT_FLAG_LOCKED_BANK3 : xlt.h
  • XLT_FLAG_LOCKED_BANK4 : xlt.h
  • XLT_FLAG_LOCKED_BANK5 : xlt.h
  • XLT_FLAG_LOCKED_BANK6 : xlt.h
  • XLT_FLAG_SETUP : xlt.h
  • XLT_FLAG_TYPE_LOCK : xlt.h
  • xlt_generate_counter_settings() : xlt.h
  • XLT_GENERATE_COUNTER_SETTINGS_CMD_ENC_SIZE : xlt.h
  • xlt_generate_date_expiration_cmd() : xlt.h
  • xlt_generate_signed_date_cmd() : xlt.h
  • xlt_generate_timer_add_settings() : xlt.h
  • XLT_GENERATE_TIMER_ADD_SETTINGS_CMD_ENC_SIZE : xlt.h
  • xlt_generate_timer_settings() : xlt.h
  • XLT_GENERATE_TIMER_SETTINGS_CMD_ENC_SIZE : xlt.h
  • xlt_get_info_from_locked_bank() : xlt.h
  • xlt_get_timer() : xlt.h
  • xlt_getinfo() : xlt.h
  • xlt_init() : xlt.h
  • XLT_KEY_SIZE : xlt.h
  • XLT_LABEL_SIZE : xlt.h
  • XLT_LINK : xlt.h
  • xlt_locate() : xlt.h
  • XLT_LOCK_ALL : xlt.h
  • XLT_LOCK_CHALLENGE_ECB : xlt.h
  • XLT_LOCK_CRYPT_ECB : xlt.h
  • XLT_LOCK_DECRYPT_ECB : xlt.h
  • XLT_LOCK_READ_DATA_B0 : xlt.h
  • XLT_LOCK_READ_DATA_B1 : xlt.h
  • XLT_LOCK_READ_DATA_B2 : xlt.h
  • XLT_LOCK_READ_DATA_B3 : xlt.h
  • XLT_LOCK_READ_DATA_B4 : xlt.h
  • XLT_LOCK_READ_DATA_B5 : xlt.h
  • XLT_LOCK_READ_DATA_B6 : xlt.h
  • XLT_LOCK_RESERVED_15 : xlt.h
  • XLT_LOCK_RESERVED_36 : xlt.h
  • XLT_LOCK_RESERVED_37 : xlt.h
  • XLT_LOCK_RESERVED_38 : xlt.h
  • XLT_LOCK_RESERVED_39 : xlt.h
  • XLT_LOCK_RESERVED_43 : xlt.h
  • XLT_LOCK_RESERVED_44 : xlt.h
  • XLT_LOCK_RESERVED_45 : xlt.h
  • XLT_LOCK_RESERVED_46 : xlt.h
  • XLT_LOCK_RESERVED_47 : xlt.h
  • XLT_LOCK_RESERVED_7 : xlt.h
  • XLT_LOCK_RSA_CRT_DECRYPT_1024 : xlt.h
  • XLT_LOCK_RSA_CRT_DECRYPT_512 : xlt.h
  • XLT_LOCK_RSA_CRT_SET_KEY_1024 : xlt.h
  • XLT_LOCK_RSA_CRT_SET_KEY_512 : xlt.h
  • XLT_LOCK_SESSION_CRYPT_0 : xlt.h
  • XLT_LOCK_SESSION_CRYPT_1 : xlt.h
  • XLT_LOCK_SESSION_CRYPT_2 : xlt.h
  • XLT_LOCK_SESSION_CRYPT_3 : xlt.h
  • XLT_LOCK_SESSION_CRYPT_4 : xlt.h
  • XLT_LOCK_SESSION_CRYPT_5 : xlt.h
  • XLT_LOCK_SESSION_CRYPT_6 : xlt.h
  • XLT_LOCK_SESSION_CRYPT_7 : xlt.h
  • XLT_LOCK_SESSION_DECRYPT_0 : xlt.h
  • XLT_LOCK_SESSION_DECRYPT_1 : xlt.h
  • XLT_LOCK_SESSION_DECRYPT_2 : xlt.h
  • XLT_LOCK_SESSION_DECRYPT_3 : xlt.h
  • XLT_LOCK_SESSION_DECRYPT_4 : xlt.h
  • XLT_LOCK_SESSION_DECRYPT_5 : xlt.h
  • XLT_LOCK_SESSION_DECRYPT_6 : xlt.h
  • XLT_LOCK_SESSION_DECRYPT_7 : xlt.h
  • XLT_LOCK_WRITE_DATA_B0 : xlt.h
  • XLT_LOCK_WRITE_DATA_B1 : xlt.h
  • XLT_LOCK_WRITE_DATA_B2 : xlt.h
  • XLT_LOCK_WRITE_DATA_B3 : xlt.h
  • XLT_LOCK_WRITE_DATA_B4 : xlt.h
  • XLT_LOCK_WRITE_DATA_B5 : xlt.h
  • XLT_LOCK_WRITE_DATA_B6 : xlt.h
  • XLT_LOCKED_BANK_DATA_LENGTH : xlt.h
  • XLT_LOCKED_TRANSFER_DATA : xlt.h
  • XLT_MODEL_BASIC_USBHID : xlt.h
  • XLT_MODEL_USBHID_SD : xlt.h
  • xlt_never_use_this_rsa_encrypt() : xlt.h
  • xlt_never_use_this_rsa_sw_decrypt() : xlt.h
  • XLT_NUMBER_OF_BANKS : xlt.h
  • XLT_PASSWORD_SIZE : xlt.h
  • xlt_read() : xlt.h
  • xlt_read_date() : xlt.h
  • xlt_read_locked() : xlt.h
  • XLT_RSA_1024_BIT_SIZE : xlt.h
  • XLT_RSA_1024_CIPHERTEXT_SIZE : xlt.h
  • XLT_RSA_1024_PLAINTEXT_SIZE : xlt.h
  • XLT_RSA_1024_PRIV_KEY_SIZE : xlt.h
  • XLT_RSA_1024_PUB_KEY_SIZE : xlt.h
  • XLT_RSA_1024_WRAPPED_KEY_SIZE : xlt.h
  • XLT_RSA_512_BIT_SIZE : xlt.h
  • XLT_RSA_512_CIPHERTEXT_SIZE : xlt.h
  • XLT_RSA_512_PLAINTEXT_SIZE : xlt.h
  • XLT_RSA_512_PRIV_KEY_SIZE : xlt.h
  • XLT_RSA_512_PUB_KEY_SIZE : xlt.h
  • XLT_RSA_512_WRAPPED_KEY_SIZE : xlt.h
  • xlt_rsa_decrypt() : xlt.h
  • xlt_rsa_generate_key() : xlt.h
  • xlt_rsa_set_privkey() : xlt.h
  • xlt_rsa_wrap_privkey() : xlt.h
  • xlt_session_decrypt() : xlt.h
  • xlt_session_encrypt() : xlt.h
  • XLT_SESSION_NUMBER_OF_KEYS : xlt.h
  • xlt_session_set_key() : xlt.h
  • xlt_session_wrap_key() : xlt.h
  • xlt_set_date() : xlt.h
  • xlt_set_write_locked2_group_check() : xlt.h
  • xlt_set_write_locked2_serial_check() : xlt.h
  • xlt_set_write_locked_group_check() : xlt.h
  • xlt_set_write_locked_serial_check() : xlt.h
  • xlt_setup() : xlt.h
  • xlt_storage_get_mem_size() : xlt.h
  • xlt_storage_lock() : xlt.h
  • xlt_storage_set() : xlt.h
  • xlt_storage_unlock() : xlt.h
  • xlt_storage_unlock_ro() : xlt.h
  • XLT_TC_ADD_TIMER_VALUE_CMD : xlt.h
  • XLT_TC_INFO : xlt.h
  • XLT_TC_READ_COUNTERS_DATA : xlt.h
  • XLT_TC_READ_TIMER_DATA : xlt.h
  • XLT_TC_UNKNOWN : xlt.h
  • XLT_TC_WRITE_COUNTER_CMD : xlt.h
  • XLT_TC_WRITE_TIMER_CMD : xlt.h
  • XLT_TIMER_ADD_CMD : xlt.h
  • XLT_TIMER_CMD : xlt.h
  • XLT_TIMER_COUNTER_INFO : xlt.h
  • xlt_timer_counters_retrieve() : xlt.h
  • XLT_TIMER_DATA : xlt.h
  • XLT_TRIGGER_ALL : xlt.h
  • XLT_TRIGGER_CHALLENGE_ECB : xlt.h
  • XLT_TRIGGER_CRYPT_ECB : xlt.h
  • XLT_TRIGGER_DECRYPT_ECB : xlt.h
  • XLT_TRIGGER_GET_INFO : xlt.h
  • XLT_TRIGGER_READ_DATA_B0 : xlt.h
  • XLT_TRIGGER_READ_DATA_B1 : xlt.h
  • XLT_TRIGGER_READ_DATA_B2 : xlt.h
  • XLT_TRIGGER_READ_DATA_B3 : xlt.h
  • XLT_TRIGGER_READ_DATA_B4 : xlt.h
  • XLT_TRIGGER_READ_DATA_B5 : xlt.h
  • XLT_TRIGGER_READ_DATA_B6 : xlt.h
  • XLT_TRIGGER_RESERVED_15 : xlt.h
  • XLT_TRIGGER_RESERVED_36 : xlt.h
  • XLT_TRIGGER_RESERVED_37 : xlt.h
  • XLT_TRIGGER_RESERVED_38 : xlt.h
  • XLT_TRIGGER_RESERVED_39 : xlt.h
  • XLT_TRIGGER_RESERVED_43 : xlt.h
  • XLT_TRIGGER_RESERVED_44 : xlt.h
  • XLT_TRIGGER_RESERVED_45 : xlt.h
  • XLT_TRIGGER_RESERVED_46 : xlt.h
  • XLT_TRIGGER_RESERVED_47 : xlt.h
  • XLT_TRIGGER_RESERVED_7 : xlt.h
  • XLT_TRIGGER_RSA_CRT_DECRYPT_1024 : xlt.h
  • XLT_TRIGGER_RSA_CRT_DECRYPT_512 : xlt.h
  • XLT_TRIGGER_RSA_CRT_SET_KEY_1024 : xlt.h
  • XLT_TRIGGER_RSA_CRT_SET_KEY_512 : xlt.h
  • XLT_TRIGGER_SESSION_CRYPT_0 : xlt.h
  • XLT_TRIGGER_SESSION_CRYPT_1 : xlt.h
  • XLT_TRIGGER_SESSION_CRYPT_2 : xlt.h
  • XLT_TRIGGER_SESSION_CRYPT_3 : xlt.h
  • XLT_TRIGGER_SESSION_CRYPT_4 : xlt.h
  • XLT_TRIGGER_SESSION_CRYPT_5 : xlt.h
  • XLT_TRIGGER_SESSION_CRYPT_6 : xlt.h
  • XLT_TRIGGER_SESSION_CRYPT_7 : xlt.h
  • XLT_TRIGGER_SESSION_DECRYPT_0 : xlt.h
  • XLT_TRIGGER_SESSION_DECRYPT_1 : xlt.h
  • XLT_TRIGGER_SESSION_DECRYPT_2 : xlt.h
  • XLT_TRIGGER_SESSION_DECRYPT_3 : xlt.h
  • XLT_TRIGGER_SESSION_DECRYPT_4 : xlt.h
  • XLT_TRIGGER_SESSION_DECRYPT_5 : xlt.h
  • XLT_TRIGGER_SESSION_DECRYPT_6 : xlt.h
  • XLT_TRIGGER_SESSION_DECRYPT_7 : xlt.h
  • XLT_TRIGGER_WRITE_DATA_B0 : xlt.h
  • XLT_TRIGGER_WRITE_DATA_B1 : xlt.h
  • XLT_TRIGGER_WRITE_DATA_B2 : xlt.h
  • XLT_TRIGGER_WRITE_DATA_B3 : xlt.h
  • XLT_TRIGGER_WRITE_DATA_B4 : xlt.h
  • XLT_TRIGGER_WRITE_DATA_B5 : xlt.h
  • XLT_TRIGGER_WRITE_DATA_B6 : xlt.h
  • XLT_ULONG_LONG : xlt.h
  • xlt_update_get_counter() : xlt.h
  • xlt_virg_demo() : xlt.h
  • xlt_write() : xlt.h
  • xlt_write_locked() : xlt.h


  • File List
  • Globals
  • All
  • Functions
  • Typedefs
  • Defines
  • c
  • d
  • l
  • r
  • s
  • t
  • x

- c -

  • CHALLENGE_EXPIRATION_MAX_TIME : xlt.h


  • File List
  • Globals
  • All
  • Functions
  • Typedefs
  • Defines
  • c
  • d
  • l
  • r
  • s
  • t
  • x

- l -

  • LOCK2_AVAILABLE_MIN_VERSION_ON_MODEL_BASIC_USBHID : xlt.h
  • LOCK2_AVAILABLE_MIN_VERSION_ON_MODEL_USBHID_SD : xlt.h
  • LOG_ACTION_GET_DATE_INFO : xlt.h
  • LOG_ACTION_LOCAL_TIME : xlt.h
  • LOG_ACTION_NTP_TIME : xlt.h
  • LOG_ACTION_SIGNED_TIME : xlt.h


  • File List
  • Globals
  • All
  • Functions
  • Typedefs
  • Defines
  • c
  • d
  • l
  • r
  • s
  • t
  • x

- d -

  • DATE_AVAILABLE_MIN_VERSION_ON_MODEL_BASIC_USBHID : xlt.h
  • DATE_AVAILABLE_MIN_VERSION_ON_MODEL_USBHID_SD : xlt.h


  • File List
  • Globals
  • All
  • Functions
  • Typedefs
  • Defines
  • c
  • d
  • l
  • r
  • s
  • t
  • x

- r -

  • RSA_AVAILABLE_MIN_VERSION_ON_MODEL_BASIC_USBHID : xlt.h
  • RSA_AVAILABLE_MIN_VERSION_ON_MODEL_USBHID_SD : xlt.h


  • File List
  • Globals
  • All
  • Functions
  • Typedefs
  • Defines
  • c
  • d
  • l
  • r
  • s
  • t
  • x

- s -

  • SD_MEM_AVAILABLE_MIN_VERSION_ON_MODEL_BASIC_USBHID : xlt.h
  • SD_MEM_AVAILABLE_MIN_VERSION_ON_MODEL_USBHID_SD : xlt.h
  • SESSION_KEY_AVAILABLE_MIN_VERSION_ON_MODEL_BASIC_USBHID : xlt.h
  • SESSION_KEY_AVAILABLE_MIN_VERSION_ON_MODEL_USBHID_SD : xlt.h


  • File List
  • Globals
  • All
  • Functions
  • Typedefs
  • Defines
  • c
  • d
  • l
  • r
  • s
  • t
  • x

- t -

  • TIMER_AVAILABLE_MIN_VERSION_ON_MODEL_BASIC_USBHID : xlt.h
  • TIMER_AVAILABLE_MIN_VERSION_ON_MODEL_USBHID_SD : xlt.h


  • File List
  • Globals
  • All
  • Functions
  • Typedefs
  • Defines
  • c
  • d
  • l
  • r
  • s
  • t
  • x

- x -

  • XLT_API : xlt.h
  • XLT_BANK_SIZE : xlt.h
  • XLT_CIPHERTEXT_SIZE : xlt.h
  • XLT_COUNTERS_NUM : xlt.h
  • XLT_DATE_CHALLENGE_SIZE : xlt.h
  • XLT_DATE_ENC_CHALLENGE_SIZE : xlt.h
  • XLT_DATE_ENC_EXP_CMD_SIZE : xlt.h
  • XLT_DATE_MANAGE_AUTO_START : xlt.h
  • XLT_DATE_MANAGE_AUTO_STOP : xlt.h
  • XLT_DATE_MANAGE_CLEAN_LOG : xlt.h
  • XLT_DATE_MANAGE_CLEAN_STATE : xlt.h
  • XLT_DATE_MANAGE_DO_SET_TIME : xlt.h
  • XLT_DATE_MANAGE_DO_SET_TIME_ASYNC : xlt.h
  • XLT_DATE_MANAGE_DO_SET_TIME_RESULT : xlt.h
  • XLT_DATE_MANAGE_LOG_ONLY_ERROR : xlt.h
  • XLT_DATE_MANAGE_LOG_SET_QUEUE_LEN : xlt.h
  • XLT_DATE_MANAGE_MAKE_LOGS : xlt.h
  • XLT_DATE_MANAGE_SET_IDLE_TIME_SEC : xlt.h
  • XLT_DATE_OPT_IMMEDIATELY_USE_INTERNET_SIGNED_TIME : xlt.h
  • XLT_DATE_OPT_IMMEDIATELY_USE_INTERNET_TIME : xlt.h
  • XLT_DATE_OPT_IMMEDIATELY_USE_LOCAL_TIME : xlt.h
  • XLT_DATE_OPT_USE_INTERNET_SIGNED_TIME : xlt.h
  • XLT_DATE_OPT_USE_INTERNET_TIME : xlt.h
  • XLT_DATE_OPT_USE_INTERNET_TIME_FOR_SCHEDULING_TASKS : xlt.h
  • XLT_DATE_OPT_USE_LOCAL_TIME : xlt.h
  • XLT_DATE_READ_ENC_DATA_SIZE : xlt.h
  • XLT_DATE_SIG_UPD_CMD_SIZE : xlt.h
  • XLT_DATE_STOP_FOR_DATE_EXPIRATION : xlt.h
  • XLT_DATE_STOP_FOR_NORMAL_UPDATE_TIME_OUT_MAX_ERROR : xlt.h
  • XLT_DATE_STOP_FOR_SIGNED_UPDATE_TIME_OUT_MAX_ERROR : xlt.h
  • XLT_DATE_STOP_FOR_UPDATE_MAX_ERROR : xlt.h
  • XLT_DATE_TYPE_CHALLENGE : xlt.h
  • XLT_DATE_TYPE_DATA : xlt.h
  • XLT_DATE_TYPE_SET_EXPIRATION_CMD : xlt.h
  • XLT_DATE_TYPE_SIGNED_DATE_CMD : xlt.h
  • XLT_DATE_TYPE_UNKNOWN : xlt.h
  • XLT_DEVICE_MAX : xlt.h
  • XLT_DISK_PASSWORD_SIZE : xlt.h
  • XLT_ENC_READ_COUNTERS_DATA_SIZE : xlt.h
  • XLT_ENC_READ_TIMER_DATA_SIZE : xlt.h
  • XLT_ERROR_DATE_BAD_CHALLENGE : xlt.h
  • XLT_ERROR_DATE_BAD_CMD_COUNTER : xlt.h
  • XLT_ERROR_DATE_BAD_FORMAT : xlt.h
  • XLT_ERROR_DATE_BAD_SERIAL : xlt.h
  • XLT_ERROR_DATE_BAD_VALUE : xlt.h
  • XLT_ERROR_DATE_CHALLENGE_TIME_OUT : xlt.h
  • XLT_ERROR_DATE_NOT_CONFIGURED : xlt.h
  • XLT_ERROR_DATE_STOPPED : xlt.h
  • XLT_ERROR_DATE_UNUSED_SIGNED_TIME : xlt.h
  • XLT_ERROR_DATEMAN_EXPIRED : xlt.h
  • XLT_ERROR_DATEMAN_HTTP_CANNOT_CONNECT : xlt.h
  • XLT_ERROR_DATEMAN_HTTP_CONNECTION_ERROR : xlt.h
  • XLT_ERROR_DATEMAN_HTTP_GENERIC_ERROR : xlt.h
  • XLT_ERROR_DATEMAN_HTTP_INTERNAL_ERROR : xlt.h
  • XLT_ERROR_DATEMAN_HTTP_INVALID_URL : xlt.h
  • XLT_ERROR_DATEMAN_HTTP_MISSING_DATA : xlt.h
  • XLT_ERROR_DATEMAN_HTTP_TIMEOUT : xlt.h
  • XLT_ERROR_DATEMAN_INTERRUPTED : xlt.h
  • XLT_ERROR_DATEMAN_IS_RUNNING : xlt.h
  • XLT_ERROR_DATEMAN_NOT_RUNNING : xlt.h
  • XLT_ERROR_DATEMAN_NOT_SUPPORTED : xlt.h
  • XLT_ERROR_DATEMAN_NTP_INCONSISTENT : xlt.h
  • XLT_ERROR_DATEMAN_NTP_INTERNAL_ERROR : xlt.h
  • XLT_ERROR_DATEMAN_NTP_LOW_TIME_QUALITY : xlt.h
  • XLT_ERROR_DATEMAN_NTP_UNAVAILABLE : xlt.h
  • XLT_ERROR_DATEMAN_PENDING : xlt.h
  • XLT_ERROR_DATEMAN_TIME_SOURCE_UNAVAILABLE : xlt.h
  • XLT_ERROR_ENC_DISK_NOT_EXIST : xlt.h
  • XLT_ERROR_FROZEN : xlt.h
  • XLT_ERROR_INVALID_ARGUMENT : xlt.h
  • XLT_ERROR_INVALID_STATE : xlt.h
  • XLT_ERROR_LOCKED : xlt.h
  • XLT_ERROR_LOCKED_BAD_COUNTER : xlt.h
  • XLT_ERROR_LOCKED_BAD_GROUP : xlt.h
  • XLT_ERROR_LOCKED_BAD_SERIAL : xlt.h
  • XLT_ERROR_MISSING_DATA : xlt.h
  • XLT_ERROR_NOT_FOUND : xlt.h
  • XLT_ERROR_RESOURCE : xlt.h
  • XLT_ERROR_RSA_INTERNAL_ERROR : xlt.h
  • XLT_ERROR_RSA_MAN : xlt.h
  • XLT_ERROR_STOPPED : xlt.h
  • XLT_ERROR_SUCCESS : xlt.h
  • XLT_ERROR_TC_BAD_CMD_COUNTER : xlt.h
  • XLT_ERROR_TC_BAD_FORMAT : xlt.h
  • XLT_ERROR_TC_BAD_SERIAL : xlt.h
  • XLT_ERROR_TC_BAD_VALUE : xlt.h
  • XLT_ERROR_TRANSMIT : xlt.h
  • XLT_ERROR_UNKNOWN : xlt.h
  • XLT_ERROR_WRONG_PSWD : xlt.h
  • XLT_FLAG_FROZEN_BANK0 : xlt.h
  • XLT_FLAG_FROZEN_BANK1 : xlt.h
  • XLT_FLAG_FROZEN_BANK2 : xlt.h
  • XLT_FLAG_FROZEN_BANK3 : xlt.h
  • XLT_FLAG_FROZEN_BANK4 : xlt.h
  • XLT_FLAG_FROZEN_BANK5 : xlt.h
  • XLT_FLAG_FROZEN_BANK6 : xlt.h
  • XLT_FLAG_LOCKED_BANK0 : xlt.h
  • XLT_FLAG_LOCKED_BANK1 : xlt.h
  • XLT_FLAG_LOCKED_BANK2 : xlt.h
  • XLT_FLAG_LOCKED_BANK3 : xlt.h
  • XLT_FLAG_LOCKED_BANK4 : xlt.h
  • XLT_FLAG_LOCKED_BANK5 : xlt.h
  • XLT_FLAG_LOCKED_BANK6 : xlt.h
  • XLT_FLAG_SETUP : xlt.h
  • XLT_FLAG_TYPE_LOCK : xlt.h
  • XLT_GENERATE_COUNTER_SETTINGS_CMD_ENC_SIZE : xlt.h
  • XLT_GENERATE_TIMER_ADD_SETTINGS_CMD_ENC_SIZE : xlt.h
  • XLT_GENERATE_TIMER_SETTINGS_CMD_ENC_SIZE : xlt.h
  • XLT_KEY_SIZE : xlt.h
  • XLT_LABEL_SIZE : xlt.h
  • XLT_LINK : xlt.h
  • XLT_LOCK_ALL : xlt.h
  • XLT_LOCK_CHALLENGE_ECB : xlt.h
  • XLT_LOCK_CRYPT_ECB : xlt.h
  • XLT_LOCK_DECRYPT_ECB : xlt.h
  • XLT_LOCK_READ_DATA_B0 : xlt.h
  • XLT_LOCK_READ_DATA_B1 : xlt.h
  • XLT_LOCK_READ_DATA_B2 : xlt.h
  • XLT_LOCK_READ_DATA_B3 : xlt.h
  • XLT_LOCK_READ_DATA_B4 : xlt.h
  • XLT_LOCK_READ_DATA_B5 : xlt.h
  • XLT_LOCK_READ_DATA_B6 : xlt.h
  • XLT_LOCK_RESERVED_15 : xlt.h
  • XLT_LOCK_RESERVED_36 : xlt.h
  • XLT_LOCK_RESERVED_37 : xlt.h
  • XLT_LOCK_RESERVED_38 : xlt.h
  • XLT_LOCK_RESERVED_39 : xlt.h
  • XLT_LOCK_RESERVED_43 : xlt.h
  • XLT_LOCK_RESERVED_44 : xlt.h
  • XLT_LOCK_RESERVED_45 : xlt.h
  • XLT_LOCK_RESERVED_46 : xlt.h
  • XLT_LOCK_RESERVED_47 : xlt.h
  • XLT_LOCK_RESERVED_7 : xlt.h
  • XLT_LOCK_RSA_CRT_DECRYPT_1024 : xlt.h
  • XLT_LOCK_RSA_CRT_DECRYPT_512 : xlt.h
  • XLT_LOCK_RSA_CRT_SET_KEY_1024 : xlt.h
  • XLT_LOCK_RSA_CRT_SET_KEY_512 : xlt.h
  • XLT_LOCK_SESSION_CRYPT_0 : xlt.h
  • XLT_LOCK_SESSION_CRYPT_1 : xlt.h
  • XLT_LOCK_SESSION_CRYPT_2 : xlt.h
  • XLT_LOCK_SESSION_CRYPT_3 : xlt.h
  • XLT_LOCK_SESSION_CRYPT_4 : xlt.h
  • XLT_LOCK_SESSION_CRYPT_5 : xlt.h
  • XLT_LOCK_SESSION_CRYPT_6 : xlt.h
  • XLT_LOCK_SESSION_CRYPT_7 : xlt.h
  • XLT_LOCK_SESSION_DECRYPT_0 : xlt.h
  • XLT_LOCK_SESSION_DECRYPT_1 : xlt.h
  • XLT_LOCK_SESSION_DECRYPT_2 : xlt.h
  • XLT_LOCK_SESSION_DECRYPT_3 : xlt.h
  • XLT_LOCK_SESSION_DECRYPT_4 : xlt.h
  • XLT_LOCK_SESSION_DECRYPT_5 : xlt.h
  • XLT_LOCK_SESSION_DECRYPT_6 : xlt.h
  • XLT_LOCK_SESSION_DECRYPT_7 : xlt.h
  • XLT_LOCK_WRITE_DATA_B0 : xlt.h
  • XLT_LOCK_WRITE_DATA_B1 : xlt.h
  • XLT_LOCK_WRITE_DATA_B2 : xlt.h
  • XLT_LOCK_WRITE_DATA_B3 : xlt.h
  • XLT_LOCK_WRITE_DATA_B4 : xlt.h
  • XLT_LOCK_WRITE_DATA_B5 : xlt.h
  • XLT_LOCK_WRITE_DATA_B6 : xlt.h
  • XLT_LOCKED_BANK_DATA_LENGTH : xlt.h
  • XLT_LOCKED_TRANSFER_DATA : xlt.h
  • XLT_MODEL_BASIC_USBHID : xlt.h
  • XLT_MODEL_USBHID_SD : xlt.h
  • XLT_NUMBER_OF_BANKS : xlt.h
  • XLT_PASSWORD_SIZE : xlt.h
  • XLT_RSA_1024_BIT_SIZE : xlt.h
  • XLT_RSA_1024_CIPHERTEXT_SIZE : xlt.h
  • XLT_RSA_1024_PLAINTEXT_SIZE : xlt.h
  • XLT_RSA_1024_PRIV_KEY_SIZE : xlt.h
  • XLT_RSA_1024_PUB_KEY_SIZE : xlt.h
  • XLT_RSA_1024_WRAPPED_KEY_SIZE : xlt.h
  • XLT_RSA_512_BIT_SIZE : xlt.h
  • XLT_RSA_512_CIPHERTEXT_SIZE : xlt.h
  • XLT_RSA_512_PLAINTEXT_SIZE : xlt.h
  • XLT_RSA_512_PRIV_KEY_SIZE : xlt.h
  • XLT_RSA_512_PUB_KEY_SIZE : xlt.h
  • XLT_RSA_512_WRAPPED_KEY_SIZE : xlt.h
  • XLT_SESSION_NUMBER_OF_KEYS : xlt.h
  • XLT_TC_ADD_TIMER_VALUE_CMD : xlt.h
  • XLT_TC_READ_COUNTERS_DATA : xlt.h
  • XLT_TC_READ_TIMER_DATA : xlt.h
  • XLT_TC_UNKNOWN : xlt.h
  • XLT_TC_WRITE_COUNTER_CMD : xlt.h
  • XLT_TC_WRITE_TIMER_CMD : xlt.h
  • XLT_TRIGGER_ALL : xlt.h
  • XLT_TRIGGER_CHALLENGE_ECB : xlt.h
  • XLT_TRIGGER_CRYPT_ECB : xlt.h
  • XLT_TRIGGER_DECRYPT_ECB : xlt.h
  • XLT_TRIGGER_GET_INFO : xlt.h
  • XLT_TRIGGER_READ_DATA_B0 : xlt.h
  • XLT_TRIGGER_READ_DATA_B1 : xlt.h
  • XLT_TRIGGER_READ_DATA_B2 : xlt.h
  • XLT_TRIGGER_READ_DATA_B3 : xlt.h
  • XLT_TRIGGER_READ_DATA_B4 : xlt.h
  • XLT_TRIGGER_READ_DATA_B5 : xlt.h
  • XLT_TRIGGER_READ_DATA_B6 : xlt.h
  • XLT_TRIGGER_RESERVED_15 : xlt.h
  • XLT_TRIGGER_RESERVED_36 : xlt.h
  • XLT_TRIGGER_RESERVED_37 : xlt.h
  • XLT_TRIGGER_RESERVED_38 : xlt.h
  • XLT_TRIGGER_RESERVED_39 : xlt.h
  • XLT_TRIGGER_RESERVED_43 : xlt.h
  • XLT_TRIGGER_RESERVED_44 : xlt.h
  • XLT_TRIGGER_RESERVED_45 : xlt.h
  • XLT_TRIGGER_RESERVED_46 : xlt.h
  • XLT_TRIGGER_RESERVED_47 : xlt.h
  • XLT_TRIGGER_RESERVED_7 : xlt.h
  • XLT_TRIGGER_RSA_CRT_DECRYPT_1024 : xlt.h
  • XLT_TRIGGER_RSA_CRT_DECRYPT_512 : xlt.h
  • XLT_TRIGGER_RSA_CRT_SET_KEY_1024 : xlt.h
  • XLT_TRIGGER_RSA_CRT_SET_KEY_512 : xlt.h
  • XLT_TRIGGER_SESSION_CRYPT_0 : xlt.h
  • XLT_TRIGGER_SESSION_CRYPT_1 : xlt.h
  • XLT_TRIGGER_SESSION_CRYPT_2 : xlt.h
  • XLT_TRIGGER_SESSION_CRYPT_3 : xlt.h
  • XLT_TRIGGER_SESSION_CRYPT_4 : xlt.h
  • XLT_TRIGGER_SESSION_CRYPT_5 : xlt.h
  • XLT_TRIGGER_SESSION_CRYPT_6 : xlt.h
  • XLT_TRIGGER_SESSION_CRYPT_7 : xlt.h
  • XLT_TRIGGER_SESSION_DECRYPT_0 : xlt.h
  • XLT_TRIGGER_SESSION_DECRYPT_1 : xlt.h
  • XLT_TRIGGER_SESSION_DECRYPT_2 : xlt.h
  • XLT_TRIGGER_SESSION_DECRYPT_3 : xlt.h
  • XLT_TRIGGER_SESSION_DECRYPT_4 : xlt.h
  • XLT_TRIGGER_SESSION_DECRYPT_5 : xlt.h
  • XLT_TRIGGER_SESSION_DECRYPT_6 : xlt.h
  • XLT_TRIGGER_SESSION_DECRYPT_7 : xlt.h
  • XLT_TRIGGER_WRITE_DATA_B0 : xlt.h
  • XLT_TRIGGER_WRITE_DATA_B1 : xlt.h
  • XLT_TRIGGER_WRITE_DATA_B2 : xlt.h
  • XLT_TRIGGER_WRITE_DATA_B3 : xlt.h
  • XLT_TRIGGER_WRITE_DATA_B4 : xlt.h
  • XLT_TRIGGER_WRITE_DATA_B5 : xlt.h
  • XLT_TRIGGER_WRITE_DATA_B6 : xlt.h
  • XLT_ULONG_LONG : xlt.h


  • File List
  • Globals
  • All
  • Functions
  • Typedefs
  • Defines
  • x

- x -

  • xlt_apply_date_enc_cmd() : xlt.h
  • xlt_bank_freeze() : xlt.h
  • xlt_bank_lock() : xlt.h
  • xlt_bank_lock2() : xlt.h
  • xlt_challenge() : xlt.h
  • xlt_close() : xlt.h
  • xlt_date_enc_retrieve() : xlt.h
  • xlt_date_get_challenge() : xlt.h
  • xlt_date_manage() : xlt.h
  • xlt_date_manage_get_log_records() : xlt.h
  • xlt_date_manage_get_num_log_records() : xlt.h
  • xlt_decrypt() : xlt.h
  • xlt_decrypt_locked2_data() : xlt.h
  • xlt_decrypt_locked_data() : xlt.h
  • xlt_enc_apply_timer_counter() : xlt.h
  • xlt_enc_read_counters() : xlt.h
  • xlt_enc_read_date() : xlt.h
  • xlt_enc_read_timer() : xlt.h
  • xlt_encrypt() : xlt.h
  • xlt_generate_counter_settings() : xlt.h
  • xlt_generate_date_expiration_cmd() : xlt.h
  • xlt_generate_signed_date_cmd() : xlt.h
  • xlt_generate_timer_add_settings() : xlt.h
  • xlt_generate_timer_settings() : xlt.h
  • xlt_get_info_from_locked_bank() : xlt.h
  • xlt_get_timer() : xlt.h
  • xlt_getinfo() : xlt.h
  • xlt_init() : xlt.h
  • xlt_locate() : xlt.h
  • xlt_never_use_this_rsa_encrypt() : xlt.h
  • xlt_never_use_this_rsa_sw_decrypt() : xlt.h
  • xlt_read() : xlt.h
  • xlt_read_date() : xlt.h
  • xlt_read_locked() : xlt.h
  • xlt_rsa_decrypt() : xlt.h
  • xlt_rsa_generate_key() : xlt.h
  • xlt_rsa_set_privkey() : xlt.h
  • xlt_rsa_wrap_privkey() : xlt.h
  • xlt_session_decrypt() : xlt.h
  • xlt_session_encrypt() : xlt.h
  • xlt_session_set_key() : xlt.h
  • xlt_session_wrap_key() : xlt.h
  • xlt_set_date() : xlt.h
  • xlt_set_write_locked2_group_check() : xlt.h
  • xlt_set_write_locked2_serial_check() : xlt.h
  • xlt_set_write_locked_group_check() : xlt.h
  • xlt_set_write_locked_serial_check() : xlt.h
  • xlt_setup() : xlt.h
  • xlt_storage_get_mem_size() : xlt.h
  • xlt_storage_lock() : xlt.h
  • xlt_storage_set() : xlt.h
  • xlt_storage_unlock() : xlt.h
  • xlt_storage_unlock_ro() : xlt.h
  • xlt_timer_counters_retrieve() : xlt.h
  • xlt_update_get_counter() : xlt.h
  • xlt_virg_demo() : xlt.h
  • xlt_write() : xlt.h
  • xlt_write_locked() : xlt.h


  • File List
  • Globals
  • All
  • Functions
  • Typedefs
  • Defines
  • XLT_COUNTER_CMD : xlt.h
  • XLT_COUNTER_DATA : xlt.h
  • XLT_D_INFO : xlt.h
  • XLT_DATE_CHALLENGE : xlt.h
  • XLT_DATE_DATA : xlt.h
  • XLT_DATE_INFO : xlt.h
  • XLT_DATE_LOG : xlt.h
  • XLT_DATE_SET_EXPIRATION_CMD : xlt.h
  • XLT_DATE_SIGNED_DATE_CMD : xlt.h
  • XLT_TC_INFO : xlt.h
  • XLT_TIMER_ADD_CMD : xlt.h
  • XLT_TIMER_CMD : xlt.h
  • XLT_TIMER_COUNTER_INFO : xlt.h
  • XLT_TIMER_DATA : xlt.h


Graph Legend

This page explains how to interpret the graphs that are generated by doxygen.

Consider the following example:

/*! Invisible class because of truncation */
class Invisible { };

/*! Truncated class, inheritance relation is hidden */
class Truncated : public Invisible { };

/* Class not documented with doxygen comments */
class Undocumented { };

/*! Class that is inherited using public inheritance */
class PublicBase : public Truncated { };

/*! A template class */
template<class T> class Templ { };

/*! Class that is inherited using protected inheritance */
class ProtectedBase { };

/*! Class that is inherited using private inheritance */
class PrivateBase { };

/*! Class that is used by the Inherited class */
class Used { };

/*! Super class that inherits a number of other classes */
class Inherited : public PublicBase,
                  protected ProtectedBase,
                  private PrivateBase,
                  public Undocumented,
                  public Templ<int>
{
  private:
    Used *m_usedClass;
};

This will result in the following graph:

The boxes in the above graph have the following meaning:

  • A filled gray box represents the struct or class for which the graph is generated.
  • A box with a black border denotes a documented struct or class.
  • A box with a grey border denotes an undocumented struct or class.
  • A box with a red border denotes a documented struct or class forwhich not all inheritance/containment relations are shown. A graph is truncated if it does not fit within the specified boundaries.

The arrows have the following meaning:

  • A dark blue arrow is used to visualize a public inheritance relation between two classes.
  • A dark green arrow is used for protected inheritance.
  • A dark red arrow is used for private inheritance.
  • A purple dashed arrow is used if a class is contained or used by another class. The arrow is labeled with the variable(s) through which the pointed class or struct is accessible.
  • A yellow dashed arrow denotes a relation between a template instance and the template class it was instantiated from. The arrow is labeled with the template parameters of the instance.


  • File List
  • Globals
xlt.h
Go to the documentation of this file.
00001
00037 #ifndef XLT_H_205672482
00038 #define XLT_H_205672482
00039
00040 #ifdef USE_BCC_502
00041 #define USE_BCC
00042 #endif
00043
00044 // We don't use "unsigned long long" because Borland C doesn't recognize it, while "unsigned __int64" works both in Borland and Microsoft Visual Studio
00048 #define XLT_ULONG_LONG unsigned __int64
00049
00050 #ifdef __cplusplus
00051 extern "C" {
00052 #endif
00053
00058 #define XLT_LINK ///< Linking type of the exported XLight functions.
00059 #define XLT_API __stdcall ///< Calling convention of the exported XLight functions.
00060
00061
00073
00074 #define XLT_FLAG_SETUP 0x10 ///< Set if the device has been initialized.
00075 #define XLT_FLAG_FROZEN_BANK0 0x0100 ///< Set if the bank 0 is frozen (no longer writable)
00076 #define XLT_FLAG_FROZEN_BANK1 0x0200 ///< Set if the bank 1 is frozen (no longer writable)
00077 #define XLT_FLAG_FROZEN_BANK2 0x0400 ///< Set if the bank 2 is frozen (no longer writable)
00078 #define XLT_FLAG_FROZEN_BANK3 0x0800 ///< Set if the bank 3 is frozen (no longer writable)
00079 #define XLT_FLAG_FROZEN_BANK4 0x1000 ///< Set if the bank 4 is frozen (no longer writable)
00080 #define XLT_FLAG_FROZEN_BANK5 0x2000 ///< Set if the bank 5 is frozen (no longer writable)
00081 #define XLT_FLAG_FROZEN_BANK6 0x4000 ///< Set if the bank 6 is frozen (no longer writable)
00082
00083 #define XLT_FLAG_LOCKED_BANK0 0x010000 ///< Set if the bank 0 is locked (writable only in encryption form)
00084 #define XLT_FLAG_LOCKED_BANK1 0x020000 ///< Set if the bank 1 is locked (writable only in encryption form)
00085 #define XLT_FLAG_LOCKED_BANK2 0x040000 ///< Set if the bank 2 is locked (writable only in encryption form)
00086 #define XLT_FLAG_LOCKED_BANK3 0x080000 ///< Set if the bank 3 is locked (writable only in encryption form)
00087 #define XLT_FLAG_LOCKED_BANK4 0x100000 ///< Set if the bank 4 is locked (writable only in encryption form)
00088 #define XLT_FLAG_LOCKED_BANK5 0x200000 ///< Set if the bank 5 is locked (writable only in encryption form)
00089 #define XLT_FLAG_LOCKED_BANK6 0x400000 ///< Set if the bank 6 is locked (writable only in encryption form)
00090
00091 #define XLT_FLAG_TYPE_LOCK 0x800000 ///< Indicate the type of lock applied: if set to 1 the Lock2 is set
00092
00094
00100 #define XLT_MODEL_BASIC_USBHID 0x0 ///< Device using the USB DriverLess protocol (HID). It doesn't require a kernel driver.
00101 #define XLT_MODEL_USBHID_SD 0x1 ///< Device using the USB DriverLess protocol (HID) supplying also an interface for Micro SD reader
00102
00103
00108 #define XLT_LABEL_SIZE 64 ///< Size of the Label field passed to the xlt_getinfo() and xlt_setup() functions.
00109 #define XLT_PASSWORD_SIZE 32 ///< Size of the password field.
00110 #define XLT_KEY_SIZE 32 ///< Size of a cryptographic Key.
00111 #define XLT_BANK_SIZE 64 ///< Size of each bank of memory of the XLight device.
00112 #define XLT_NUMBER_OF_BANKS 7 ///< Number of memory banks of the XLight device.
00113 #define XLT_LOCKED_BANK_DATA_LENGTH 48 ///< Portion of the usable data for a locked bank. The rest of the bank is used for internal purpose.
00114 #define XLT_LOCKED_TRANSFER_DATA 80 ///< data to be passed or retrieved using xlt_write_locked() and xlt_read_locked()
00115 #define XLT_CIPHERTEXT_SIZE 16 ///< Size of the plaintext and ciphertext passed or retrieved by the crypto functions (xlt_encrypt(), xlt_decrypt() and xlt_challenge())
00116 #define XLT_DEVICE_MAX 16 ///< Max number of devices. Useful when scanning all the device with the xlt_getinfo() functions.
00117 #define XLT_SESSION_NUMBER_OF_KEYS 8 ///< Number of AES Session Keys
00118
00119 #define XLT_RSA_512_BIT_SIZE 512 ///< length in bit of the public modulus of a 512 bit RSA key
00120 #define XLT_RSA_512_WRAPPED_KEY_SIZE 144 ///< dimension of an RSA private key with modulus of 512 bit in its wrapped form
00121 #define XLT_RSA_512_PUB_KEY_SIZE 68 ///< dimension of an RSA public key with modulus of 512 bit
00122 #define XLT_RSA_512_PRIV_KEY_SIZE 132 ///< dimension of an RSA private key with modulus of 512 bit
00123 #define XLT_RSA_512_PLAINTEXT_SIZE 64 ///< dimension of a plaintext for a 512 bit RSA key
00124 #define XLT_RSA_512_CIPHERTEXT_SIZE XLT_RSA_512_PLAINTEXT_SIZE ///< dimension of a ciphertext for a 512 bit RSA key
00125
00126 #define XLT_RSA_1024_BIT_SIZE 1024 ///< length in bit of the public modulus of a 1024 bit RSA key
00127 #define XLT_RSA_1024_WRAPPED_KEY_SIZE 272 ///< dimension of an RSA private key with modulus of 1024 bit in its wrapped form
00128 #define XLT_RSA_1024_PUB_KEY_SIZE 132 ///<dimension of an RSA public key with modulus of 1024 bit
00129 #define XLT_RSA_1024_PRIV_KEY_SIZE 260 ///< dimension of an RSA private key with modulus of 1024 bit
00130 #define XLT_RSA_1024_PLAINTEXT_SIZE 128 ///< dimension of a plaintext for a 1024 bit RSA key
00131 #define XLT_RSA_1024_CIPHERTEXT_SIZE XLT_RSA_1024_PLAINTEXT_SIZE ///< dimension of a ciphertext for a 1024 bit RSA key
00132
00133 #define XLT_DISK_PASSWORD_SIZE 32 ///< Size of the disk password (used onto to sd devices).
00134 #define XLT_COUNTERS_NUM 4 ///< number of usable counters in Xlight
00135
00137
00143 #define XLT_ERROR_SUCCESS 0 ///< No error.
00144 #define XLT_ERROR_NOT_FOUND -1 ///< Device not found.
00145 #define XLT_ERROR_INVALID_ARGUMENT -2 ///< Function called with an invalid argument.
00146 #define XLT_ERROR_INVALID_STATE -3 ///< Invalid state of the device for the required operation.
00147 #define XLT_ERROR_TRANSMIT -4 ///< USB communication error.
00148 #define XLT_ERROR_RESOURCE -5 ///< Resource error (usually not enough memory).
00149 #define XLT_ERROR_WRONG_PSWD -6 ///< A wrong password has been used
00150 #define XLT_ERROR_MISSING_DATA -7 ///< Missing data (returned by an attempt to read memory from an unwritten bank)
00151 #define XLT_ERROR_FROZEN -8 ///< Trying to write or freeze a frozen bank
00152 #define XLT_ERROR_LOCKED -9 ///< Trying to lock an already locked bank
00153 #define XLT_ERROR_LOCKED_BAD_SERIAL -10 ///< Writing in a locked bank passing a wrong serial
00154 #define XLT_ERROR_LOCKED_BAD_COUNTER -11 ///< Writing in a locked bank passing a wrong counter
00155 #define XLT_ERROR_LOCKED_BAD_GROUP -12 ///< Writing in a locked bank passing a wrong group number
00156 #define XLT_ERROR_RSA_MAN -13 ///< An error occurred running an RSA software function
00157 #define XLT_ERROR_ENC_DISK_NOT_EXIST -14 ///< Error on <i>XLight SD</i> trying to mount the non existent encrypted disk
00158 #define XLT_ERROR_STOPPED -15 ///< The function was stopped by the timer, counter or date protection management
00159 #define XLT_ERROR_TC_BAD_SERIAL -16 ///< Attempting to apply a time-counter setting on a device with unexpected serial number
00160 #define XLT_ERROR_TC_BAD_FORMAT -17 ///< Bad timer-counter command or data format (for instance a wrong <i>Dongle Key</i> was used)
00161 #define XLT_ERROR_TC_BAD_CMD_COUNTER -18 ///< The counter of the time-counter command was wrong (probably the command was already been applied)
00162 #define XLT_ERROR_TC_BAD_VALUE -19 ///< Wrong timer or conter value, it's value exceed the allowed limit
00163 #define XLT_ERROR_DATE_BAD_SERIAL -20 ///< Attempting to apply a date setting on a device with unexpected serial number
00164 #define XLT_ERROR_DATE_BAD_FORMAT -21 ///< Bad date command or data format (for instance a wrong <i>Dongle Key</i> was used)
00165 #define XLT_ERROR_DATE_BAD_CMD_COUNTER -22 ///< The counter of the date command was wrong (probably the command was already been applied)
00166 #define XLT_ERROR_DATE_BAD_VALUE -23 ///< sent a date older than the one extimated by the device
00167 #define XLT_ERROR_DATE_STOPPED -24 ///< The function was stopped by the date protection management
00168 #define XLT_ERROR_DATE_NOT_CONFIGURED -25 ///< Date management not configured
00169 #define XLT_ERROR_DATE_BAD_CHALLENGE -26 ///< Bad challenge value (value not expected)
00170 #define XLT_ERROR_DATE_CHALLENGE_TIME_OUT -27 ///< The signed data was sent after challenge expiration
00171 #define XLT_ERROR_DATE_UNUSED_SIGNED_TIME -28 ///< A signed date is not expected by the device
00172 #define XLT_ERROR_RSA_INTERNAL_ERROR -29 ///< An internal error occurred running the RSA algorithm (it should never happen)
00173
00174 /* __ * \defgroup DateThreadErrors Errors of date management functions
00175 * Error codes.
00176 * The XLight functions return the following error codes.
00177  @  __ {
00178  */
00179 #define XLT_ERROR_DATEMAN_EXPIRED -30 ///< date license expired
00180 #define XLT_ERROR_DATEMAN_TIME_SOURCE_UNAVAILABLE -31 ///< any attempt to get a date (local or form internet) is failed
00181 #define XLT_ERROR_DATEMAN_INTERRUPTED -32 ///<date management function was abruptly interrupted
00182 #define XLT_ERROR_DATEMAN_IS_RUNNING -40 ///< the date management thread is (already) running and the called function can't be done
00183 #define XLT_ERROR_DATEMAN_NOT_RUNNING -41 ///< the date management thread is not running
00184 #define XLT_ERROR_DATEMAN_NOT_SUPPORTED -42 ///< the XLight device doesn't support date license or date license is not set
00185 #define XLT_ERROR_DATEMAN_PENDING -43 ///< the date management is pending (that is it is running and the task is not completed yet)
00186
00187 #define XLT_ERROR_DATEMAN_NTP_UNAVAILABLE -52 ///< the NTP server is not found (the address is wrong or cannot be resolved or the internet connection is down)
00188 #define XLT_ERROR_DATEMAN_NTP_INCONSISTENT -53 ///< the collected NTP time is wrong
00189 #define XLT_ERROR_DATEMAN_NTP_INTERNAL_ERROR -54 ///< an error occurred managing the NTP time acquiring process
00190 #define XLT_ERROR_DATEMAN_NTP_LOW_TIME_QUALITY -55 ///< the quality of the NTP time is not good enough
00191
00192 #define XLT_ERROR_DATEMAN_HTTP_INTERNAL_ERROR -60 ///< an internal error happened collecting the signed time
00193 #define XLT_ERROR_DATEMAN_HTTP_GENERIC_ERROR -61 ///< a generic error happened collecting the signed time
00194 #define XLT_ERROR_DATEMAN_HTTP_INVALID_URL -62 ///< invalid URL of the signed time server
00195 #define XLT_ERROR_DATEMAN_HTTP_CANNOT_CONNECT -63 ///< impossible to establish a connection with the signed time server
00196 #define XLT_ERROR_DATEMAN_HTTP_CONNECTION_ERROR -64 ///< the connection to the signed time server failed
00197 #define XLT_ERROR_DATEMAN_HTTP_TIMEOUT -65 ///< timeout of the connection to the signed time server
00198 #define XLT_ERROR_DATEMAN_HTTP_MISSING_DATA -66 ///< same expected data was missing during a communication with the signed time server
00199 //@ __ }
00200
00201 #define XLT_ERROR_UNKNOWN -100 ///< an unknown error has occurred
00202
00203
00204 //\cond NOT_COMMENTED
00205 #define XLT_ERROR_INVALID_FW_RELEASE -1050
00206 #define XLT_ERROR_INVALID_SN -1051
00207 #define XLT_ERROR_INVALID_B_COUNTER -1052
00208 //\endcond
00210
00219 struct _XLT_TIMER_DATA{
00220         XLT_ULONG_LONG functions_to_lock_mask;
00221         unsigned int timer_value_minutes;
00222         unsigned int idle_time_minutes;
00223         unsigned int cmd_counter;
00224         unsigned int serial_number;
00225 };
00229 typedef struct _XLT_TIMER_DATA XLT_TIMER_DATA;
00230
00234 struct _XLT_TIMER_ADD_CMD{
00235         unsigned int timer_value_minutes_to_add;
00236         unsigned int cmd_counter;
00237         unsigned int serial_number;
00238 };
00242 typedef struct _XLT_TIMER_ADD_CMD XLT_TIMER_ADD_CMD;
00243
00247 struct _XLT_COUNTER_DATA{
00248         XLT_ULONG_LONG trigger_functions_mask;
00249         XLT_ULONG_LONG functions_to_lock_mask;
00250         unsigned int counter_id;
00251         unsigned int counter_value;
00252         unsigned int cmd_counter;
00253         unsigned int serial_number;
00254 };
00258 typedef struct _XLT_COUNTER_DATA XLT_COUNTER_DATA;
00259
00263 typedef XLT_TIMER_DATA XLT_TIMER_CMD;
00264
00268 typedef XLT_COUNTER_DATA XLT_COUNTER_CMD;
00269
00274 union _XLT_TC_INFO{
00275         XLT_COUNTER_DATA counter_data[XLT_COUNTERS_NUM];
00276         XLT_TIMER_DATA timer_data;
00277         XLT_COUNTER_CMD counter_cmd;
00278         XLT_TIMER_CMD timer_cmd;
00279         XLT_TIMER_ADD_CMD timer_add_value_cmd;
00280 };
00284 typedef union _XLT_TC_INFO XLT_TC_INFO;
00285
00296 #define XLT_TC_UNKNOWN 0 ///< Unknown data
00297 #define XLT_TC_WRITE_COUNTER_CMD 1 ///< the data in the structure are related to a write counter command (xlt_generate_counter_settings())
00298 #define XLT_TC_WRITE_TIMER_CMD 2 ///< the data in the structure are related to a write timer command (xlt_generate_timer_settings())
00299 #define XLT_TC_ADD_TIMER_VALUE_CMD 3 ///< the data in the structure are related to a add timer command (xlt_generate_timer_add_settings())
00300 #define XLT_TC_READ_COUNTERS_DATA 4 ///< the data in the structure are related to read counters info (xlt_enc_read_counters())
00301 #define XLT_TC_READ_TIMER_DATA 5 ///< the data in the structure are related to read timer info (xlt_enc_read_timer())
00302
00303
00305 typedef struct _XLT_TIMER_COUNTER_INFO{
00306         unsigned int type;
00307         unsigned int rfu;
00308         XLT_TC_INFO tc;
00309 }XLT_TIMER_COUNTER_INFO;
00311
00312 #define XLT_GENERATE_COUNTER_SETTINGS_CMD_ENC_SIZE 60 ///< size of the encrypted buffer returned by xlt_generate_counter_settings()
00313 #define XLT_GENERATE_TIMER_SETTINGS_CMD_ENC_SIZE 44 ///< size of the encrypted buffer returned by xlt_generate_timer_settings()
00314 #define XLT_GENERATE_TIMER_ADD_SETTINGS_CMD_ENC_SIZE 44 ///< size of the encrypted buffer returned by xlt_generate_timer_add_settings()
00315 #define XLT_ENC_READ_COUNTERS_DATA_SIZE 156 ///< size of the encrypted buffer returned by xlt_enc_read_counters()
00316 #define XLT_ENC_READ_TIMER_DATA_SIZE 44 ///< size of the encrypted buffer returned by xlt_enc_read_timer()
00317
00322 #define XLT_LOCK_READ_DATA_B0 (((XLT_ULONG_LONG)1) << 0) ///< Lock the function "Read from bank 0".
00323 #define XLT_LOCK_READ_DATA_B1 (((XLT_ULONG_LONG)1) << 1) ///< Lock the function "Read from bank 1".
00324 #define XLT_LOCK_READ_DATA_B2 (((XLT_ULONG_LONG)1) << 2) ///< Lock the function "Read from bank 2".
00325 #define XLT_LOCK_READ_DATA_B3 (((XLT_ULONG_LONG)1) << 3) ///< Lock the function "Read from bank 3".
00326 #define XLT_LOCK_READ_DATA_B4 (((XLT_ULONG_LONG)1) << 4) ///< Lock the function "Read from bank 4".
00327 #define XLT_LOCK_READ_DATA_B5 (((XLT_ULONG_LONG)1) << 5) ///< Lock the function "Read from bank 5".
00328 #define XLT_LOCK_READ_DATA_B6 (((XLT_ULONG_LONG)1) << 6) ///< Lock the function "Read from bank 6".
00329 #define XLT_LOCK_RESERVED_7 (((XLT_ULONG_LONG)1) << 7) ///< RFU
00330 #define XLT_LOCK_WRITE_DATA_B0 (((XLT_ULONG_LONG)1) << 8) ///< Lock the function "Write on bank 0".
00331 #define XLT_LOCK_WRITE_DATA_B1 (((XLT_ULONG_LONG)1) << 9) ///< Lock the function "Write on bank 1".
00332 #define XLT_LOCK_WRITE_DATA_B2 (((XLT_ULONG_LONG)1) << 10) ///< Lock the function "Write on bank 2".
00333 #define XLT_LOCK_WRITE_DATA_B3 (((XLT_ULONG_LONG)1) << 11) ///< Lock the function "Write on bank 3".
00334 #define XLT_LOCK_WRITE_DATA_B4 (((XLT_ULONG_LONG)1) << 12) ///< Lock the function "Write on bank 4".
00335 #define XLT_LOCK_WRITE_DATA_B5 (((XLT_ULONG_LONG)1) << 13) ///< Lock the function "Write on bank 5".
00336 #define XLT_LOCK_WRITE_DATA_B6 (((XLT_ULONG_LONG)1) << 14) ///< Lock the function "Write on bank 6".
00337 #define XLT_LOCK_RESERVED_15 (((XLT_ULONG_LONG)1) << 15) ///< RFU
00338 #define XLT_LOCK_SESSION_CRYPT_0 (((XLT_ULONG_LONG)1) << 16) ///< Lock the function "Session Encryption with key of index 0".
00339 #define XLT_LOCK_SESSION_CRYPT_1 (((XLT_ULONG_LONG)1) << 17) ///< Lock the function "Session Encryption with key of index 1".
00340 #define XLT_LOCK_SESSION_CRYPT_2 (((XLT_ULONG_LONG)1) << 18) ///< Lock the function "Session Encryption with key of index 2".
00341 #define XLT_LOCK_SESSION_CRYPT_3 (((XLT_ULONG_LONG)1) << 19) ///< Lock the function "Session Encryption with key of index 3".
00342 #define XLT_LOCK_SESSION_CRYPT_4 (((XLT_ULONG_LONG)1) << 20) ///< Lock the function "Session Encryption with key of index 4".
00343 #define XLT_LOCK_SESSION_CRYPT_5 (((XLT_ULONG_LONG)1) << 21) ///< Lock the function "Session Encryption with key of index 5".
00344 #define XLT_LOCK_SESSION_CRYPT_6 (((XLT_ULONG_LONG)1) << 22) ///< Lock the function "Session Encryption with key of index 6".
00345 #define XLT_LOCK_SESSION_CRYPT_7 (((XLT_ULONG_LONG)1) << 23) ///< Lock the function "Session Encryption with key of index 7".
00346 #define XLT_LOCK_SESSION_DECRYPT_0 (((XLT_ULONG_LONG)1) << 24) ///< Lock the function "Session Decryption with key of index 0".
00347 #define XLT_LOCK_SESSION_DECRYPT_1 (((XLT_ULONG_LONG)1) << 25) ///< Lock the function "Session Decryption with key of index 1".
00348 #define XLT_LOCK_SESSION_DECRYPT_2 (((XLT_ULONG_LONG)1) << 26) ///< Lock the function "Session Decryption with key of index 2".
00349 #define XLT_LOCK_SESSION_DECRYPT_3 (((XLT_ULONG_LONG)1) << 27) ///< Lock the function "Session Decryption with key of index 3".
00350 #define XLT_LOCK_SESSION_DECRYPT_4 (((XLT_ULONG_LONG)1) << 28) ///< Lock the function "Session Decryption with key of index 4".
00351 #define XLT_LOCK_SESSION_DECRYPT_5 (((XLT_ULONG_LONG)1) << 29) ///< Lock the function "Session Decryption with key of index 5".
00352 #define XLT_LOCK_SESSION_DECRYPT_6 (((XLT_ULONG_LONG)1) << 30) ///< Lock the function "Session Decryption with key of index 6".
00353 #define XLT_LOCK_SESSION_DECRYPT_7 (((XLT_ULONG_LONG)1) << 31) ///< Lock the function "Session Decryption with key of index 7".
00354 #define XLT_LOCK_RSA_CRT_SET_KEY_512 (((XLT_ULONG_LONG)1) << 32) ///< Lock the function "Set RSA 512 key".
00355 #define XLT_LOCK_RSA_CRT_SET_KEY_1024 (((XLT_ULONG_LONG)1) << 33) ///< Lock the function "Set RSA 1024 key".
00356 #define XLT_LOCK_RSA_CRT_DECRYPT_512 (((XLT_ULONG_LONG)1) << 34) ///< Lock the function "Decrypt with RSA 512 key".
00357 #define XLT_LOCK_RSA_CRT_DECRYPT_1024 (((XLT_ULONG_LONG)1) << 35) ///< Lock the function "Decrypt with RSA 1024 key".
00358 #define XLT_LOCK_RESERVED_36 (((XLT_ULONG_LONG)1) << 36) ///< RFU
00359 #define XLT_LOCK_RESERVED_37 (((XLT_ULONG_LONG)1) << 37) ///< RFU
00360 #define XLT_LOCK_RESERVED_38 (((XLT_ULONG_LONG)1) << 38) ///< RFU
00361 #define XLT_LOCK_RESERVED_39 (((XLT_ULONG_LONG)1) << 39) ///< RFU
00362 #define XLT_LOCK_CRYPT_ECB (((XLT_ULONG_LONG)1) << 40) ///< Lock the function xlt_encrypt()
00363 #define XLT_LOCK_DECRYPT_ECB (((XLT_ULONG_LONG)1) << 41) ///< Lock the function xlt_decrypt()
00364 #define XLT_LOCK_CHALLENGE_ECB (((XLT_ULONG_LONG)1) << 42) ///< Lock the function xlt_challenge()
00365 #define XLT_LOCK_RESERVED_43 (((XLT_ULONG_LONG)1) << 43) ///< RFU
00366 #define XLT_LOCK_RESERVED_44 (((XLT_ULONG_LONG)1) << 44) ///< RFU
00367 #define XLT_LOCK_RESERVED_45 (((XLT_ULONG_LONG)1) << 45) ///< RFU
00368 #define XLT_LOCK_RESERVED_46 (((XLT_ULONG_LONG)1) << 46) ///< RFU
00369 #define XLT_LOCK_RESERVED_47 (((XLT_ULONG_LONG)1) << 47) ///< RFU
00370
00371
00376 #define XLT_TRIGGER_READ_DATA_B0 XLT_LOCK_READ_DATA_B0 ///< Decrement a given counter when it is called the function "Read from bank 0".
00377 #define XLT_TRIGGER_READ_DATA_B1 XLT_LOCK_READ_DATA_B1 ///< Decrement a given counter when it is called the function "Read from bank 1".
00378 #define XLT_TRIGGER_READ_DATA_B2 XLT_LOCK_READ_DATA_B2 ///< Decrement a given counter when it is called the function "Read from bank 2".
00379 #define XLT_TRIGGER_READ_DATA_B3 XLT_LOCK_READ_DATA_B3 ///< Decrement a given counter when it is called the function "Read from bank 3".
00380 #define XLT_TRIGGER_READ_DATA_B4 XLT_LOCK_READ_DATA_B4 ///< Decrement a given counter when it is called the function "Read from bank 4".
00381 #define XLT_TRIGGER_READ_DATA_B5 XLT_LOCK_READ_DATA_B5 ///< Decrement a given counter when it is called the function "Read from bank 5".
00382 #define XLT_TRIGGER_READ_DATA_B6 XLT_LOCK_READ_DATA_B6 ///< Decrement a given counter when it is called the function "Read from bank 6".
00383 #define XLT_TRIGGER_RESERVED_7 XLT_LOCK_RESERVED_7 ///< RFU
00384 #define XLT_TRIGGER_WRITE_DATA_B0 XLT_LOCK_WRITE_DATA_B0 ///< Decrement a given counter when it is called the function "Write on bank 0".
00385 #define XLT_TRIGGER_WRITE_DATA_B1 XLT_LOCK_WRITE_DATA_B1 ///< Decrement a given counter when it is called the function "Write on bank 1".
00386 #define XLT_TRIGGER_WRITE_DATA_B2 XLT_LOCK_WRITE_DATA_B2 ///< Decrement a given counter when it is called the function "Write on bank 2".
00387 #define XLT_TRIGGER_WRITE_DATA_B3 XLT_LOCK_WRITE_DATA_B3 ///< Decrement a given counter when it is called the function "Write on bank 3".
00388 #define XLT_TRIGGER_WRITE_DATA_B4 XLT_LOCK_WRITE_DATA_B4 ///< Decrement a given counter when it is called the function "Write on bank 4".
00389 #define XLT_TRIGGER_WRITE_DATA_B5 XLT_LOCK_WRITE_DATA_B5 ///< Decrement a given counter when it is called the function "Write on bank 5".
00390 #define XLT_TRIGGER_WRITE_DATA_B6 XLT_LOCK_WRITE_DATA_B6 ///< Decrement a given counter when it is called the function "Write on bank 6".
00391 #define XLT_TRIGGER_RESERVED_15 XLT_LOCK_RESERVED_15 ///< RFU
00392 #define XLT_TRIGGER_SESSION_CRYPT_0 XLT_LOCK_SESSION_CRYPT_0 ///< Decrement a given counter when it is called the function "Session Encryption with key of index 0".
00393 #define XLT_TRIGGER_SESSION_CRYPT_1 XLT_LOCK_SESSION_CRYPT_1 ///< Decrement a given counter when it is called the function "Session Encryption with key of index 1".
00394 #define XLT_TRIGGER_SESSION_CRYPT_2 XLT_LOCK_SESSION_CRYPT_2 ///< Decrement a given counter when it is called the function "Session Encryption with key of index 2".
00395 #define XLT_TRIGGER_SESSION_CRYPT_3 XLT_LOCK_SESSION_CRYPT_3 ///< Decrement a given counter when it is called the function "Session Encryption with key of index 3".
00396 #define XLT_TRIGGER_SESSION_CRYPT_4 XLT_LOCK_SESSION_CRYPT_4 ///< Decrement a given counter when it is called the function "Session Encryption with key of index 4".
00397 #define XLT_TRIGGER_SESSION_CRYPT_5 XLT_LOCK_SESSION_CRYPT_5 ///< Decrement a given counter when it is called the function "Session Encryption with key of index 5".
00398 #define XLT_TRIGGER_SESSION_CRYPT_6 XLT_LOCK_SESSION_CRYPT_6 ///< Decrement a given counter when it is called the function "Session Encryption with key of index 6".
00399 #define XLT_TRIGGER_SESSION_CRYPT_7 XLT_LOCK_SESSION_CRYPT_7 ///< Decrement a given counter when it is called the function "Session Encryption with key of index 7".
00400 #define XLT_TRIGGER_SESSION_DECRYPT_0 XLT_LOCK_SESSION_DECRYPT_0 ///< Decrement a given counter when it is called the function "Session Decryption with key of index 0".
00401 #define XLT_TRIGGER_SESSION_DECRYPT_1 XLT_LOCK_SESSION_DECRYPT_1 ///< Decrement a given counter when it is called the function "Session Decryption with key of index 1".
00402 #define XLT_TRIGGER_SESSION_DECRYPT_2 XLT_LOCK_SESSION_DECRYPT_2 ///< Decrement a given counter when it is called the function "Session Decryption with key of index 2".
00403 #define XLT_TRIGGER_SESSION_DECRYPT_3 XLT_LOCK_SESSION_DECRYPT_3 ///< Decrement a given counter when it is called the function "Session Decryption with key of index 3".
00404 #define XLT_TRIGGER_SESSION_DECRYPT_4 XLT_LOCK_SESSION_DECRYPT_4 ///< Decrement a given counter when it is called the function "Session Decryption with key of index 4".
00405 #define XLT_TRIGGER_SESSION_DECRYPT_5 XLT_LOCK_SESSION_DECRYPT_5 ///< Decrement a given counter when it is called the function "Session Decryption with key of index 5".
00406 #define XLT_TRIGGER_SESSION_DECRYPT_6 XLT_LOCK_SESSION_DECRYPT_6 ///< Decrement a given counter when it is called the function "Session Decryption with key of index 6".
00407 #define XLT_TRIGGER_SESSION_DECRYPT_7 XLT_LOCK_SESSION_DECRYPT_7 ///< Decrement a given counter when it is called the function "Session Decryption with key of index 7".
00408 #define XLT_TRIGGER_RSA_CRT_SET_KEY_512 XLT_LOCK_RSA_CRT_SET_KEY_512 ///< Decrement a given counter when it is called the function "Set RSA 512 key".
00409 #define XLT_TRIGGER_RSA_CRT_SET_KEY_1024 XLT_LOCK_RSA_CRT_SET_KEY_1024 ///< Decrement a given counter when it is called the function "Set RSA 1024 key".
00410 #define XLT_TRIGGER_RSA_CRT_DECRYPT_512 XLT_LOCK_RSA_CRT_DECRYPT_512 ///< Decrement a given counter when it is called the function "Decrypt with RSA 512 key".
00411 #define XLT_TRIGGER_RSA_CRT_DECRYPT_1024 XLT_LOCK_RSA_CRT_DECRYPT_1024 ///< Decrement a given counter when it is called the function "Decrypt with RSA 1024 key".
00412 #define XLT_TRIGGER_RESERVED_36 XLT_LOCK_RESERVED_36 ///< RFU
00413 #define XLT_TRIGGER_RESERVED_37 XLT_LOCK_RESERVED_37 ///< RFU
00414 #define XLT_TRIGGER_RESERVED_38 XLT_LOCK_RESERVED_38 ///< RFU
00415 #define XLT_TRIGGER_RESERVED_39 XLT_LOCK_RESERVED_39 ///< RFU
00416 #define XLT_TRIGGER_CRYPT_ECB XLT_LOCK_CRYPT_ECB ///< Decrement a given counter when it is called the function xlt_encrypt().
00417 #define XLT_TRIGGER_DECRYPT_ECB XLT_LOCK_DECRYPT_ECB ///< Decrement a given counter when it is called the function xlt_decrypt().
00418 #define XLT_TRIGGER_CHALLENGE_ECB XLT_LOCK_CHALLENGE_ECB ///< Decrement a given counter when it is called the function xlt_challenge().
00419 #define XLT_TRIGGER_RESERVED_43 XLT_LOCK_RESERVED_43 ///< RFU
00420 #define XLT_TRIGGER_RESERVED_44 XLT_LOCK_RESERVED_44 ///< RFU
00421 #define XLT_TRIGGER_RESERVED_45 XLT_LOCK_RESERVED_45 ///< RFU
00422 #define XLT_TRIGGER_RESERVED_46 XLT_LOCK_RESERVED_46 ///< RFU
00423 #define XLT_TRIGGER_RESERVED_47 XLT_LOCK_RESERVED_47 ///< RFU
00424 #define XLT_TRIGGER_GET_INFO (((XLT_ULONG_LONG)1) << 48) ///< Decrement a given counter when it is called the function xlt_getinfo() or xlt_locate().
00425 //LOCK_RESERVED_49_63
00427
00431 #define XLT_LOCK_ALL (\
00432 XLT_LOCK_READ_DATA_B0 | XLT_LOCK_READ_DATA_B1 | XLT_LOCK_READ_DATA_B2 | XLT_LOCK_READ_DATA_B3 | XLT_LOCK_READ_DATA_B4 |\
00433 XLT_LOCK_READ_DATA_B5 | XLT_LOCK_READ_DATA_B6 | XLT_LOCK_WRITE_DATA_B0 | XLT_LOCK_WRITE_DATA_B1 | XLT_LOCK_WRITE_DATA_B2 |\
00434 XLT_LOCK_WRITE_DATA_B3 | XLT_LOCK_WRITE_DATA_B4 | XLT_LOCK_WRITE_DATA_B5 | XLT_LOCK_WRITE_DATA_B6 | XLT_LOCK_SESSION_CRYPT_0 |\
00435 XLT_LOCK_SESSION_CRYPT_1 | XLT_LOCK_SESSION_CRYPT_2 | XLT_LOCK_SESSION_CRYPT_3 | XLT_LOCK_SESSION_CRYPT_4 | XLT_LOCK_SESSION_CRYPT_5 |\
00436 XLT_LOCK_SESSION_CRYPT_6 | XLT_LOCK_SESSION_CRYPT_7 | XLT_LOCK_SESSION_DECRYPT_0 | XLT_LOCK_SESSION_DECRYPT_1 | XLT_LOCK_SESSION_DECRYPT_2 |\
00437 XLT_LOCK_SESSION_DECRYPT_3 | XLT_LOCK_SESSION_DECRYPT_4 | XLT_LOCK_SESSION_DECRYPT_5 | XLT_LOCK_SESSION_DECRYPT_6 | XLT_LOCK_SESSION_DECRYPT_7 |\
00438 XLT_LOCK_RSA_CRT_SET_KEY_512 | XLT_LOCK_RSA_CRT_SET_KEY_1024 | XLT_LOCK_RSA_CRT_DECRYPT_512 | XLT_LOCK_RSA_CRT_DECRYPT_1024 |\
00439 XLT_LOCK_CRYPT_ECB | XLT_LOCK_DECRYPT_ECB | XLT_LOCK_CHALLENGE_ECB)
00440
00444 #define XLT_TRIGGER_ALL (XLT_LOCK_ALL | XLT_TRIGGER_GET_INFO)
00445
00447
00448
00454 //\cond NOT_COMMENTED
00455 #define DATE_STRUCT_DEFINED
00456 //\endcond
00457
00463 struct _XLT_DATE_DATA{
00464         XLT_ULONG_LONG functions_to_lock_mask;
00465         unsigned int expiration_time;
00466         unsigned int device_time;
00467         unsigned int max_time_between_updates;
00468         unsigned int max_time_between_signed_updates;
00469         unsigned int next_signed_update_time;
00470         unsigned int challenge_expiration_time;
00471         unsigned int max_update_date_error;
00472         unsigned int update_date_error;
00473         unsigned int max_missing_update_date_error;
00474         unsigned int missing_update_date_error;
00475         unsigned int max_missing_update_signed_date_error;
00476         unsigned int missing_update_signed_date_error;
00477         unsigned int stop_reason;
00478         unsigned int cmd_counter;
00479         unsigned int serial_number;
00480 };
00484 typedef struct _XLT_DATE_DATA XLT_DATE_DATA;
00485
00490 #define XLT_DATE_STOP_FOR_DATE_EXPIRATION 0x01 ///< the license time is expired.
00491 #define XLT_DATE_STOP_FOR_UPDATE_MAX_ERROR 0x02 ///< the number of allowed error during time update was passed.
00492 #define XLT_DATE_STOP_FOR_NORMAL_UPDATE_TIME_OUT_MAX_ERROR 0x04 ///< the number of missing time update was passed (too long time without date update).
00493 #define XLT_DATE_STOP_FOR_SIGNED_UPDATE_TIME_OUT_MAX_ERROR 0x08 ///< the number of missing signed time update was passed (too long time without signed date update).
00494
00495 #define XLT_DATE_CHALLENGE_SIZE 16 ///< the size of the challenge buffer for signed
00496
00503 struct _XLT_DATE_CHALLENGE{
00504         unsigned int serial_number;
00505         unsigned int reserved;
00506         unsigned char challenge[XLT_DATE_CHALLENGE_SIZE];
00507 };
00511 typedef struct _XLT_DATE_CHALLENGE XLT_DATE_CHALLENGE;
00513
00514 #define CHALLENGE_EXPIRATION_MAX_TIME (3600 * 24 * 7)///< the maximimum time in seconds that challenge_expiration_time can assume (seven days)
00515
00521 struct _XLT_DATE_SET_EXPIRATION_CMD{
00522         XLT_ULONG_LONG functions_to_lock_mask;
00523         unsigned int expiration_time;
00524         unsigned int current_time;
00525         unsigned int max_time_between_updates;
00526         unsigned int max_time_between_signed_updates;
00527         unsigned int challenge_expiration_time;
00528         unsigned int max_update_date_error;
00529         unsigned int max_missing_update_date_error;
00530         unsigned int max_missing_update_signed_date_error;
00531         unsigned int cmd_counter;
00532         unsigned int serial_number;
00533 };
00537 typedef struct _XLT_DATE_SET_EXPIRATION_CMD XLT_DATE_SET_EXPIRATION_CMD;
00538
00542 struct _XLT_DATE_SIGNED_DATE_CMD{
00543         unsigned char challenge[XLT_DATE_CHALLENGE_SIZE];
00544         unsigned int time;
00545 };
00549 typedef struct _XLT_DATE_SIGNED_DATE_CMD XLT_DATE_SIGNED_DATE_CMD;
00550
00551
00556 union _XLT_D_INFO{
00557         XLT_DATE_SET_EXPIRATION_CMD date_exp_cmd;
00558         XLT_DATE_SIGNED_DATE_CMD date_sig_cmd;
00559         XLT_DATE_DATA date_data;
00560         XLT_DATE_CHALLENGE date_challenge;
00561 };
00565 typedef union _XLT_D_INFO XLT_D_INFO;
00566
00567
00577 #define XLT_DATE_TYPE_UNKNOWN 0 ///< Unknown data.
00578 #define XLT_DATE_TYPE_SET_EXPIRATION_CMD 1 ///< set date expiration command.
00579 #define XLT_DATE_TYPE_SIGNED_DATE_CMD 2 ///< set signed date command.
00580 #define XLT_DATE_TYPE_DATA 3 ///< data containing information and settings of a date expiration management.
00581 #define XLT_DATE_TYPE_CHALLENGE 4 ///< challenge data from Xlight device needed to issue a set signed date command.
00582
00583
00585 typedef struct _XLT_DATE_INFO{
00586         unsigned int type;
00587         unsigned int rfu;
00588         XLT_D_INFO d;
00589 }XLT_DATE_INFO;
00591
00592 #define XLT_DATE_ENC_EXP_CMD_SIZE 76 ///< the length of the encrypted buffer containing the command for setting the expiration date
00593 #define XLT_DATE_SIG_UPD_CMD_SIZE 44 ///< the length of the encrypted buffer containing the command for updating the signed date
00594 #define XLT_DATE_ENC_CHALLENGE_SIZE 44 ///< the length of the get challenge encrypted buffer
00595 #define XLT_DATE_READ_ENC_DATA_SIZE 76 ///< the length of the encrypted buffer containing encrypted date info
00596
00598
00602 #define XLT_DATE_MANAGE_AUTO_START 1 ///< start the automatic date management.
00603 #define XLT_DATE_MANAGE_AUTO_STOP 2 ///< terminate the automatic date management.
00604 #define XLT_DATE_MANAGE_DO_SET_TIME 3 ///< immdiately run date update onto the attached devices.
00605 #define XLT_DATE_MANAGE_DO_SET_TIME_ASYNC 4 ///< immdiately start the date update onto the attached devices but not wait for completion.
00606 #define XLT_DATE_MANAGE_DO_SET_TIME_RESULT 5 ///< get the status result of the execution xlt_date_manage() called with command argument ::XLT_DATE_MANAGE_DO_SET_TIME_ASYNC.
00607 #define XLT_DATE_MANAGE_CLEAN_STATE 6 ///< cleanup the thread management status (that is the value retrieved using ::XLT_DATE_MANAGE_DO_SET_TIME_RESULT).
00608 #define XLT_DATE_MANAGE_SET_IDLE_TIME_SEC 7 ///< set the idle timeout for the thread management (better not to choose less than 60 seconds and no more the half of the time refresh neeeded for the device time). Don't change this value if not needed.
00609 #define XLT_DATE_MANAGE_MAKE_LOGS 8 ///< start or stop the log of the date management thread.
00610 #define XLT_DATE_MANAGE_CLEAN_LOG 9 ///< cleanup logs.
00611 #define XLT_DATE_MANAGE_LOG_ONLY_ERROR 10 ///< set or reset the log trace only for failed operation.
00612 #define XLT_DATE_MANAGE_LOG_SET_QUEUE_LEN 11 ///< set the maximum number of the log records kept in memory (max 10000 records).
00613
00614
00625 #define XLT_DATE_OPT_USE_LOCAL_TIME 0x1 ///< the automatic date management thread (when needed) updates the date of the device using the time of the computer .
00626 #define XLT_DATE_OPT_USE_INTERNET_TIME 0x2 ///< the automatic date management thread (when needed) updates the date of the device using internet time (NTP: Network Time Protocol).
00627 #define XLT_DATE_OPT_USE_INTERNET_SIGNED_TIME 0x4 ///< the automatic date management thread (when needed) updates the signed date using the OxySec service.
00628 #define XLT_DATE_OPT_IMMEDIATELY_USE_LOCAL_TIME 0x40 ///< the automatic date management thread immediately update the date of the device just after being started (also if not strictly necessary).
00629 #define XLT_DATE_OPT_IMMEDIATELY_USE_INTERNET_TIME 0x80 ///< the automatic date management thread immediately update the date of the device just after being started using NTP (also if not strictly necessary).
00630 #define XLT_DATE_OPT_IMMEDIATELY_USE_INTERNET_SIGNED_TIME 0x100 ///< the automatic date management thread immediately update the signed date of the device just after being started (also if not strictly necessary).
00631 #define XLT_DATE_OPT_USE_INTERNET_TIME_FOR_SCHEDULING_TASKS 0x200 ///< this setting doesn't allow to use local time for library scheduling (the local time wont' be used at all).
00632
00633
00634
00635 //oxyservice = script.google.com/macros/s/AKfycbwKjS-n-Q3zuuu_37BjrUg7dnV1E2ZfBy0I5TsrnVLcZ5x8Rl4/exec
00636 //ntp = pool.ntp.org
00637 //oxyservice = script.google.com/macros/s/AKfycbwKjS-n-Q3zuuu_37BjrUg7dnV1E2ZfBy0I5TsrnVLcZ5x8Rl4/exec ;  ntp = pool.ntp.org
00638
00643 //Log actions values
00648 #define LOG_ACTION_GET_DATE_INFO 1 ///< event or error while getting date info from the device
00649 #define LOG_ACTION_SIGNED_TIME 2 ///< event or error while attempting to perform the signed date update procedure
00650 #define LOG_ACTION_NTP_TIME 3 ///< event or error while getting the internet time
00651 #define LOG_ACTION_LOCAL_TIME 4 ///< event or error while setting the date to the device using local time
00652
00657 typedef struct _XLT_DATE_LOG{
00658         unsigned int time;
00659         int action;
00660         int status;
00661         unsigned int device_index;
00662         unsigned int log_counter;
00663 }XLT_DATE_LOG;
00665
00666
00671 #define LOCK2_AVAILABLE_MIN_VERSION_ON_MODEL_BASIC_USBHID 0x101 ///< minimum XLight version that support the <i>Lock2</i> feature on basic XLight devices.
00672 #define RSA_AVAILABLE_MIN_VERSION_ON_MODEL_BASIC_USBHID 0x200 ///< minimum XLight version that support the RSA feature on basic XLight devices.
00673 #define SESSION_KEY_AVAILABLE_MIN_VERSION_ON_MODEL_BASIC_USBHID 0x200 ///< minimum XLight version that support the <i>AES Session Key</i> feature on basic XLight devices.
00674 #define SD_MEM_AVAILABLE_MIN_VERSION_ON_MODEL_BASIC_USBHID 0xffff ///< minimum XLight version that support the <i>SD memory</i> feature on basic XLight devices (no basic XLight device supports this feature).
00675 #define TIMER_AVAILABLE_MIN_VERSION_ON_MODEL_BASIC_USBHID 0x210 ///< minimum XLight version that support timer and counter management on basic XLight devices.
00676 #define DATE_AVAILABLE_MIN_VERSION_ON_MODEL_BASIC_USBHID 0x220 ///< minimum XLight version that support timer and counter management on basic XLight devices.
00677
00678 #define LOCK2_AVAILABLE_MIN_VERSION_ON_MODEL_USBHID_SD 0x100 ///< minimum XLight version that support the <i>Lock2</i> feature on <i>XLight SD</i> devices.
00679 #define RSA_AVAILABLE_MIN_VERSION_ON_MODEL_USBHID_SD 0x100 ///< minimum XLight version that support the RSA feature on <i>XLight SD</i> devices.
00680 #define SESSION_KEY_AVAILABLE_MIN_VERSION_ON_MODEL_USBHID_SD 0x100 ///< minimum XLight version that support the <i>AES Session Key</i> feature on <i>XLight SD</i> devices.
00681 #define SD_MEM_AVAILABLE_MIN_VERSION_ON_MODEL_USBHID_SD 0x100 ///< minimum XLight version that support the <i>SD memory</i> feature on <i>XLight SD</i> devices.
00682
00683 #define TIMER_AVAILABLE_MIN_VERSION_ON_MODEL_USBHID_SD 0xffff ///< minimum XLight version that support timer and counter management on <i>XLight SD</i> devices.
00684 #define DATE_AVAILABLE_MIN_VERSION_ON_MODEL_USBHID_SD 0xffff ///< minimum XLight version that support timer and counter management on <i>XLight SD</i> devices.
00685
00687
00689
00766 XLT_LINK int XLT_API xlt_getinfo(unsigned int device, unsigned int* pversion, unsigned int* pmodel, unsigned int* pflags, unsigned int* pserial, unsigned char* label);
00767
00768
00825 XLT_LINK int XLT_API xlt_setup(unsigned int device, const unsigned char* label, const unsigned char* password, const unsigned char* dongle_key, const unsigned char* cr_key);
00826
00827
00854 XLT_LINK int XLT_API xlt_locate(const unsigned char* label);
00855
00856
00890 XLT_LINK int XLT_API xlt_write(unsigned int device, const unsigned char* password, unsigned int bank, const unsigned char* data);
00891
00892
00926 XLT_LINK int XLT_API xlt_read(unsigned int device, const unsigned char* password, unsigned int bank, unsigned char* data);
00927
00928
00960 XLT_LINK int XLT_API xlt_bank_freeze(unsigned int device, const unsigned char* password, unsigned int bank);
00961
00962
01027 XLT_LINK int XLT_API xlt_encrypt(unsigned int device, const unsigned char* plaintext, unsigned char* ciphertext);
01028
01029
01058 XLT_LINK int XLT_API xlt_decrypt(unsigned int device, const unsigned char* ciphertext, unsigned char* plaintext);
01059
01060
01140 XLT_LINK int XLT_API xlt_challenge(unsigned int device, const unsigned char* challenge, unsigned char* response);
01141
01162 XLT_LINK int XLT_API xlt_session_set_key(unsigned int device, unsigned int key_index, const unsigned char* wrapped_key);
01163
01180 XLT_LINK int XLT_API xlt_session_encrypt(unsigned int device, unsigned int key_index, const unsigned char* plaintext, unsigned char* ciphertext);
01181
01196 XLT_LINK int XLT_API xlt_session_decrypt(unsigned int device, unsigned int key_index, const unsigned char* ciphertext, unsigned char* plaintext);
01197
01216 XLT_LINK int XLT_API xlt_session_wrap_key(const unsigned char* session_key, const unsigned char* dongle_key, unsigned char* wrapped_key);
01217
01236 XLT_LINK int XLT_API xlt_rsa_generate_key(unsigned int bit_size, unsigned char* private_key, unsigned int private_key_size, unsigned int* p_private_key_len,
01237                                                                                   unsigned char* public_key, unsigned int public_key_size, unsigned int* p_public_key_len);
01238
01256 XLT_LINK int XLT_API xlt_rsa_wrap_privkey(const unsigned char* private_key, unsigned int private_key_length, const unsigned char* dongle_key, unsigned char* wrapped_key, unsigned int wrapped_key_len);
01257
01276 XLT_LINK int XLT_API xlt_rsa_set_privkey(unsigned int device, const unsigned char* wrapped_key, unsigned int wrapped_key_length);
01277
01294 XLT_LINK int XLT_API xlt_never_use_this_rsa_encrypt(const unsigned char* public_key, unsigned int public_key_len, const unsigned char* plaintext, unsigned int plaintext_ciphertext_length, unsigned char* ciphertext);
01295
01311 XLT_LINK int XLT_API xlt_never_use_this_rsa_sw_decrypt(const unsigned char* private_key, unsigned int private_key_len, const unsigned char* ciphertext, unsigned int ciphertext_plaintext_length, unsigned char* plaintext);
01312
01327 XLT_LINK int XLT_API xlt_rsa_decrypt(unsigned int device, const unsigned char* ciphertext, unsigned int ciphertext_plaintext_length, unsigned char* plaintext);
01328
01355 XLT_LINK int XLT_API xlt_bank_lock(unsigned int device, const unsigned char* password, unsigned int bank, unsigned int group_number);
01356
01383 XLT_LINK int XLT_API xlt_bank_lock2(unsigned int device, const unsigned char* password, unsigned int bank, unsigned int group_number);
01384
01396 XLT_LINK int XLT_API xlt_write_locked(unsigned int device, unsigned int bank, const unsigned char* transfer_data);
01397
01398
01415 XLT_LINK int XLT_API xlt_read_locked(unsigned int device, unsigned int bank, unsigned char* transfer_data);
01416
01417
01440 XLT_LINK int XLT_API xlt_set_write_locked_serial_check(const unsigned char* data, unsigned int bank, unsigned int new_counter, unsigned int serial, const unsigned char* dongle_key , unsigned char* transfer_data);
01441
01465 XLT_LINK int XLT_API xlt_set_write_locked2_serial_check(const unsigned char* data, unsigned int bank, unsigned int new_counter, unsigned int serial, const unsigned char* dongle_key , unsigned char* transfer_data);
01466
01485 XLT_LINK int XLT_API xlt_set_write_locked_group_check(const unsigned char* data, unsigned int bank, unsigned int new_counter, unsigned int group_number, const unsigned char* dongle_key, unsigned char* transfer_data);
01486
01506 XLT_LINK int XLT_API xlt_set_write_locked2_group_check(const unsigned char* data, unsigned int bank, unsigned int new_counter, unsigned int group_number, const unsigned char* dongle_key, unsigned char* transfer_data);
01507
01528 XLT_LINK int XLT_API xlt_decrypt_locked_data(const unsigned char* transfer_data, const unsigned char* dongle_key, unsigned char* data);
01529
01551 XLT_LINK int XLT_API xlt_decrypt_locked2_data(const unsigned char* transfer_data, const unsigned char* dongle_key, unsigned char* data);
01552
01566 XLT_LINK int XLT_API xlt_get_info_from_locked_bank(const unsigned char* data, unsigned int* pbank, unsigned int* pcounter, unsigned int* pserial, unsigned int* pgroup_number);
01567
01568
01579 XLT_LINK int XLT_API xlt_virg_demo(unsigned int device);
01580
01587 XLT_LINK void XLT_API xlt_close();
01588
01600 XLT_LINK int XLT_API xlt_init();
01601
01602 //XLT_LINK int XLT_API xlt_storage_get_mem_size(unsigned int device, unsigned int *p_mem_size_in_blocks);
01603
01612 XLT_LINK int XLT_API xlt_storage_get_mem_size(unsigned int device, unsigned int *p_mem_size_in_blocks, unsigned int *p_enc_mem_size_in_blocks);
01613
01623 XLT_LINK int XLT_API xlt_storage_set(unsigned int device, unsigned int locked_mem_size_in_blocks, const unsigned char* dongle_key, const unsigned char* disk_password);
01624
01632 XLT_LINK int XLT_API xlt_storage_unlock(unsigned int device, const unsigned char* disk_password);
01633
01641 XLT_LINK int XLT_API xlt_storage_unlock_ro(unsigned int device, const unsigned char* disk_password);
01642
01650 XLT_LINK int XLT_API xlt_storage_lock(unsigned int device, const unsigned char* disk_password);
01651
01652
01653
01667 XLT_LINK int XLT_API xlt_update_get_counter(unsigned int device, unsigned int counter, unsigned int sub_value, unsigned int* p_new_value);
01668
01677 XLT_LINK int XLT_API xlt_get_timer(unsigned int device, unsigned int* p_value);
01678
01690 XLT_LINK int XLT_API xlt_generate_counter_settings(const XLT_COUNTER_CMD* counter_cmd, const unsigned char* dongle_key, unsigned char* enc_cmd, unsigned int enc_cmd_size, unsigned int* p_enc_cmd_len);
01691
01703 XLT_LINK int XLT_API xlt_generate_timer_settings(const XLT_TIMER_CMD* timer_cmd, const unsigned char* dongle_key, unsigned char* enc_cmd, unsigned int enc_cmd_size, unsigned int* p_enc_cmd_len);
01704
01716 XLT_LINK int XLT_API xlt_generate_timer_add_settings(const XLT_TIMER_ADD_CMD* timer_add_cmd, const unsigned char* dongle_key, unsigned char* enc_cmd, unsigned int enc_cmd_size, unsigned int* p_enc_cmd_len);
01717
01727 XLT_LINK int XLT_API xlt_enc_apply_timer_counter(unsigned int device, const unsigned char* enc_cmd, unsigned int enc_cmd_len);
01728
01739 XLT_LINK int XLT_API xlt_enc_read_counters(unsigned int device, unsigned char* enc_data, unsigned int enc_data_size, unsigned int* p_enc_data_len);
01740
01751 XLT_LINK int XLT_API xlt_enc_read_timer(unsigned int device, unsigned char* enc_data, unsigned int enc_data_size, unsigned int* p_enc_data_len);
01752
01764 XLT_LINK int XLT_API xlt_timer_counters_retrieve(const unsigned char* enc_data, unsigned int enc_data_len, const unsigned char* dongle_key, XLT_TIMER_COUNTER_INFO* retrieved_data);
01765
01767 //DATE management
01768
01778 XLT_LINK int XLT_API xlt_enc_read_date(unsigned int device, unsigned char* enc_data, unsigned int enc_data_size, unsigned int* p_enc_data_len);
01779
01797 XLT_LINK int XLT_API xlt_read_date(unsigned int device, XLT_DATE_DATA* date_info);
01798
01806 XLT_LINK int XLT_API xlt_set_date(unsigned int device, unsigned int time);
01807
01818 XLT_LINK int XLT_API xlt_date_get_challenge(unsigned int device, unsigned char* enc_challenge, unsigned int enc_challenge_size, unsigned int* p_enc_challenge_len);
01819
01820
01831 XLT_LINK int XLT_API xlt_generate_date_expiration_cmd(const XLT_DATE_SET_EXPIRATION_CMD* cmd, const unsigned char* dongle_key, unsigned char* enc_cmd, unsigned int enc_cmd_size, unsigned int* p_enc_cmd_len);
01832
01847 XLT_LINK int XLT_API xlt_generate_signed_date_cmd(unsigned int time, const unsigned char* challenge, unsigned int challenge_len, const unsigned char* dongle_key, unsigned char* enc_cmd, unsigned int enc_cmd_size, unsigned int* p_enc_cmd_len);
01848
01849
01858 XLT_LINK int XLT_API xlt_apply_date_enc_cmd(unsigned int device, const unsigned char* enc_cmd, unsigned int enc_cmd_len);
01859
01870 XLT_LINK int XLT_API xlt_date_enc_retrieve(const unsigned char* enc_data, unsigned int enc_data_len, const unsigned char* dongle_key, XLT_DATE_INFO* retrieved_data);
01871
01912 XLT_LINK int XLT_API xlt_date_manage(unsigned int cmd, unsigned int device, unsigned int options, const char* args, const unsigned char* label);
01913
01920 XLT_LINK int XLT_API xlt_date_manage_get_num_log_records(unsigned int* p_num_entries);
01921
01931 XLT_LINK int XLT_API xlt_date_manage_get_log_records(unsigned int starting_index, unsigned int num_entries, XLT_DATE_LOG date_log[], unsigned int* p_num_entries_retrieved);
01932
01933
01934
01935 //\cond NOT_COMMENTED
01936 XLT_LINK int XLT_API xlt_reserved(unsigned int device, const unsigned char* direct_cmd, unsigned int direct_cmd_len,
01937                                                                    unsigned char* direct_resp, unsigned int direct_resp_size);
01938 XLT_LINK int xlt_reserved2(const unsigned char* dongle_key, unsigned int serial, const unsigned char* oxy_pre_cmd, unsigned int oxy_pre_cmd_len, unsigned char* direct_resp, unsigned int direct_resp_size);
01939 XLT_LINK int XLT_API xlt_xlightsd_switch_to_nondemo(unsigned int device);
01940 //\endcond
01941
01943
01944
01945 #ifdef __cplusplus
01946 }
01947 #endif
01948
01949 #endif


  • File List
  • Globals
xlt_help.h
00001 #ifndef XLT_HELP_H_540958394
00002 #define XLT_HELP_H_540958394
00003
00004 //documnetation file
00005
00190
00192
00199
00204
00210
00215
00517
00966
00968
00978
00982
00995
00997
01001
01003
01146
01148
01159
01163
01176
01178
01182
01184
01313
01315
01326
01330
01343
01345
01349
01351
01727
01729
01739
01743
01756
01758
01762
01764
01921
01923
01933
01937
01950
01952
01956
01958
02585 #endif