UniToken API Usage

From SecuTech Wiki
Revision as of 17:55, 12 April 2012 by Damien (talk | contribs)
Jump to navigationJump to search


UniToken provides a set of UniToken API to manage the secure file system for general usage apart from PKI applications. Please install UniToken API package or UniToken full package to enable features.

UniToken API package installs UniToken.dll for general UniToken API implementation and UniTokenAx.dll for ActiveX usage.

API Usage

Initialize the library to release resources by calling UT_Initialize and UT_Finalize. UT_Initialize needs to be called before using the library and UT_Finalize needs to be called to end your operation. Both functions need to be called only once.
Calling UT_GetTokenList and UT_OpenDevice to get device and open it to obtain the device handle. Get all the slots having devices by calling UT_GetTokenList. Open the device of the specified slot to obtain the device handle.
Start operating the device.

Prototype Specification

UT_HANDLE

UT_HANDLE is specified by UniToken library and used for detecting devices. It is defined as follows:

typedef unsigned long UT_HANDLE;

KEY_HANDLE, KEY_HANDLE_PTR

KEY_HANDLE is specified by UniToken library and used for detecting keys. It is defined as follows:

typedef unsigned long KEY_HANDLE; KEY_HANDLE_PTR is the pointer of KEY_HANDLE.

UT_RV

UT_RV is specified by UniToken library and used for identifying the return value of library. It is defined as follows:

typedef unsigned long UT_RV;

UT_SLOT_ID

UT_SLOT_ID is specified by UniToken library and used for identifying slots. It is defined as follows:

typedef unsigned long UT_SLOT_ID;

UT_STATUS

UT_STATUS is specified by UniToken library and used for identifying the status of slot. It is defined as follows:

typedef unsigned long UT_STATUS;

We defined some values for this UniToken library version.

  1. define TOKEN_NO_EVENT 0
  2. define TOKEN_INSERT 1
  3. define TOKEN_REMOVE 2

About Macro

Size

  1. define UT_MAX_PIN_LEN 128
  2. define UT_MAX_ID_LEN 32
  3. define MAX_SLOT_NUMBER 32
  4. define FS_MEMORY (256*1024)

Parameter Meaning
UT_MAX_PIN_LEN the maximum password length
UT_MAX_ID_LEN the maximum UniToken ID length
MAX_SLOT_NUMBER the maximum volume of slot
FS_MEMORY the maximum capacity of file system

Password

  1. define UT_DEFAULT_SO "admin"
  2. define UT_DEFAULT_USER "user"

Slot status

User level

Modes of changing passwords

LED on-off

DES key length

DES data length

AES key length

AES data length

RSA modulus length

RSA PUBLIC EXPONENT

RSA data length

RSA import new key pair

File name length

File permission