UniToken API Usage
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.
- define TOKEN_NO_EVENT 0
- define TOKEN_INSERT 1
- define TOKEN_REMOVE 2
About Macro
Size
- define UT_MAX_PIN_LEN 128
- define UT_MAX_ID_LEN 32
- define MAX_SLOT_NUMBER 32
- 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
- define UT_DEFAULT_SO "admin"
- define UT_DEFAULT_USER "user"