UniToken API Reference

From SecuTech Wiki
Jump to navigationJump to search


UT_GetLibraryVersion

API Prototype

unsigned long UT_API UT_GetLibraryVersion().

Description

To get the version of the present library

Parameters

n/a

Returned value

RETURNED VALUE DESCRIPTION
Library version the version of the current library

Sample

unsigned long ulLibraryVersion;
ulLibraryVersion = UT_GetLibraryVersion();

UT_Initialize

API Prototype

UT_RV UT_API UT_Initialize()

Description

To initialize the UniToken. It should be called before all the other functions except UT_GetLibraryVersion.

Parameters

n/a

Returned value

RETURNED VALUE DESCRIPTION
UT_OK Successful operation
UT_ALREADY_INITIALIZE Library already initialized

Sample

UT_RV ret;
ret = UT_Initialize();

UT_Finalize

API Prototype

UT_RV UT_API UT_Finalize()

Description

Call this function to end any interaction with UniToken and free the memory.

Parameters

n/a

Returned value

RETURNED VALUE DESCRIPTION
UT_OK Successful operation
UT_NOT_INITIALIZE Library not initialized

Sample

UT_RV ret;
ret = UT_Finalize();

UT_GetTokenList

API Prototype

UT_RV UT_API UT_GetTokenList(UT_SLOT_ID* lpSlotID, unsigned long* lpTokenCount)

Description

To get the list of Slot ID and the number of Slot ID

Parameters

PARAMETERS DESCRIPTION
lpSlotID [out] slot ID list
lpTokenCount [in] size of buffer (0~32 bytes)

[out]number of token

Returned value

RETURNED VALUE DESCRIPTION
UT_OK Successful operation
UT_NOT_INITIALIZE Library not initialized

Sample

UT_RV ret;
UT_HANDLE utHandle;
UT_SLOT_ID* lpSlotID = NULL;
unsigned long ulTokenCount = 0;
ret = UT_GetTokenList(lpSlotID,&ulTokenCount);
if (ret == UT_BUFFER_TOO_SMALL){
     lpSlotID = new UT_SLOT_ID[ulTokenCount];
     ret = UT_GetTokenList(lpSlotID,&ulTokenCount);
}
ret = UT_OpenDevice(lpSlotID[0],&utHandle);
ret = UT_GetHandle(lpSlotID[0],&utHandle);
ret = UT_GetSlotID(utHandle,&lpSlotID[0]);
ret = UT_CloseDevice(utHandle);

UT_OpenDevice

UT_CloseDevice

UT_GetHandle

UT_GetSlotID

UT_GetSlotStatus

UT_GetTokenType

UT_GetFirmwareVersion

UT_Logoff

UT_Logon

UT_GetCurrentUserLevel

UT_ChangePin

UT_GetID

UT_SetID

UT_GetHID

UT_GetSoftID

UT_SetSoftID

UT_LED

UT_SetAttemptCount

UT_GetAttemptCount

UT_Format

UT_Rand

UT_DESGenerateKey

UT_DESEncrypt

UT_DESDecrypt

UT_DESImportKey

UT_DESDeleteKey

UT_DESGetKeyCount

UT_DESGetFirstKeyHandle

UT_DESGetNextKeyHandle

UT_DES3GenerateKey

UT_DES3Encrypt

UT_DES3Decrypt

UT_DES3ImportKey

UT_DES3DeleteKey

UT_DES3GetKeyCount

UT_DES3GetFirstKeyHandle

UT_DES3GetNextKeyHandle

UT_AESGenerateKey

UT_AESEncrypt

UT_AESDecrypt

UT_AESImportKey

UT_AESDeleteKey

UT_AESGetKeyCount

UT_AESGetKeyLen

UT_AESGetFirstKeyHandle

UT_AESGetNextKeyHandle

UT_RSAGenerateKeyPair

UT_RSAPubKeyEncrypt

UT_RSAPriKeyDecrypt

UT_RSAPriKeyEncrypt

UT_RSAPubKeyDecrypt

UT_RSAGetKeyPairCount

UT_RSAGetFirstKeyPairHandle

UT_RSAGetNextKeyPairHandle

UT_RSAPubKeyImport

UT_RSAPriKeyImport

UT_RSAPubKeyExport

UT_RSAGetPubKeyHandle

UT_RSAGetPriKeyHandle

UT_RSAGetKeyPairModulus

UT_RSADeleteKeyPair

UT_MD5HMACGenerateKey

UT_MD5HMAC

UT_MD5

UT_MD5GetKeyCount

UT_MD5GetKeyLen

UT_MD5GetFirstKeyHandle

UT_MD5GetNextKeyHandle

UT_MD5DeleteKey

UT_MD5ImportKey

UT_SHA1HMACGenerateKey

UT_SHA1HMAC

UT_SHA1

UT_SHA1GetKeyCount

UT_SHA1GetKeyLen

UT_SHA1GetFirstKeyHandle

UT_SHA1GetNextKeyHandle

UT_SHA1DeleteKey

UT_SHA1ImportKey

UT_FS_GetSpace

UT_FS_GetFileCount

UT_FS_GetFirstFileName

UT_FS_GetNextFileName

UT_FS_GetFileSize

UT_FS_GetFilePermission

UT_FS_CreatFile

UT_FS_DeleteFile

UT_FS_OpenFile

UT_FS_WriteFile

UT_FS_ReadFile

UT_FS_CloseFile