UniKey API Reference for C Language: Difference between revisions

From SecuTech Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 1: Line 1:
[[category:UniKey APIs]]
<br>


== Find a UniKey dongle ==
== Find a UniKey dongle ==


 
API Prototype<br>long UniKey_Find( WORD* pHandle ,<br>DWORD* pSetting1 , <br>DWORD* pSetting2 )&nbsp;;  
API Prototype<br>long UniKey_Find( WORD* pHandle ,<br>DWORD* pSetting1 , <br>DWORD* pSetting2 ) ;  


Description<br>Check if a specific UniKey is attached to the USB port. This is the first API to start a UniKey session.  
Description<br>Check if a specific UniKey is attached to the USB port. This is the first API to start a UniKey session.  
Line 10: Line 9:
Parameters<br>Parameter Meaning<br>*pHandle [out] Dongle handle <br>*pSetting1 *[in] Working Mode (UniKey PRO only), useless for UniKey STD<br>[out] Hardware ID<br>*pSetting2 *[in] Access Mode (UniKey PRO only), useless for UniKey STD(UniKey PRO only)<br>[out] Number of dongle attached , useless for UniKey STD  
Parameters<br>Parameter Meaning<br>*pHandle [out] Dongle handle <br>*pSetting1 *[in] Working Mode (UniKey PRO only), useless for UniKey STD<br>[out] Hardware ID<br>*pSetting2 *[in] Access Mode (UniKey PRO only), useless for UniKey STD(UniKey PRO only)<br>[out] Number of dongle attached , useless for UniKey STD  


Return values<br>Marco Value Meaning<br>SUCCESS 0 Success<br>ERROR_UNIKEY_NO_UNIEKY 200 No UniKey dongle
Return values<br>Marco Value Meaning<br>SUCCESS 0 Success<br>ERROR_UNIKEY_NO_UNIEKY 200 No UniKey dongle  
 
 


== Find the Next UniKey dongle  ==
== Find the Next UniKey dongle  ==


API Prototype<br>Long UniKey_Find_Next( WORD* pHandle ,<br>DWORD* pSetting1 , <br>DWORD* pSetting2 ) ;  
API Prototype<br>Long UniKey_Find_Next( WORD* pHandle ,<br>DWORD* pSetting1 , <br>DWORD* pSetting2 )&nbsp;;  


Description<br>Check if another UniKey is attached to the USB port.  
Description<br>Check if another UniKey is attached to the USB port.  
Line 24: Line 25:
== <br>Logon UniKey Dongle  ==
== <br>Logon UniKey Dongle  ==


API Prototype<br>long UniKey_User_Logon( WORD* pHandle , <br>WORD* pPassword1 , <br>WORD* pPassword2 ) ;<br>-------------------------------------------------------------------------------------------  
API Prototype<br>long UniKey_User_Logon( WORD* pHandle , <br>WORD* pPassword1 , <br>WORD* pPassword2 )&nbsp;;<br>-------------------------------------------------------------------------------------------  


For UniKey Drive, the API Prototype is UniKey_User_Logon (WORD* pHandle, DWORD* pPassword1, DWORD* pPassword2); <br>-------------------------------------------------------------------------------------------<br>Description <br>Logon a UniKey dongle with specified passwords. This API should be called in the released software in order to improve security.  
For UniKey Drive, the API Prototype is UniKey_User_Logon (WORD* pHandle, DWORD* pPassword1, DWORD* pPassword2); <br>-------------------------------------------------------------------------------------------<br>Description <br>Logon a UniKey dongle with specified passwords. This API should be called in the released software in order to improve security.  
Line 31: Line 32:


Return values<br>Marco Value Meaning<br>SUCCESS 0 Success<br>ERROR_UNIKEY_NOT_FOUND 200 No UniKey dongle<br>ERROR_UNIKEY_INVALID_PASSWORD 201 UniKey dongle found, but Basic passwords are incorrect<br>ERROR_UNIKEY_INVALID_PASSWORD_OR_ID 202 Wrong password or UniKey HID <br>
Return values<br>Marco Value Meaning<br>SUCCESS 0 Success<br>ERROR_UNIKEY_NOT_FOUND 200 No UniKey dongle<br>ERROR_UNIKEY_INVALID_PASSWORD 201 UniKey dongle found, but Basic passwords are incorrect<br>ERROR_UNIKEY_INVALID_PASSWORD_OR_ID 202 Wrong password or UniKey HID <br>
== Logon UniKey Dongle in vendor mode ==
<br>API Prototype<br>long UniKey_Vender_Logon( WORD* pHandle ,<br>WORD* pPassword1 ,<br>WORD* pPassword2 ,<br>WORD* pPassword3 ,<br>WORD* pPassword4 ) ;<br>---------------------------------------------------------------------------------------------------<br>For UniKey Drive, the API Prototype is UniKey_Vender_Logon(WORD* pHandle, DWORD* pPassword1, DWORD* pPassword2, DWORD* pPassword3, DWORD* pPassword4);<br>---------------------------------------------------------------------------------------------------
Description <br>Logon a UniKey dongle in vendor mode with specified passwords. This API helps software vendors to logon the UniKey dongle in vendor mode, and get the full permission to UniKey dongle.<br>---------------------------------------------------------------------------------------------------<br>We do NOT advise you to enclose this API in the final released software. This API is only for software vendor’s usage.<br>--------------------------------------------------------------------------------------------------<br>If password3 or password4 is wrong while password1 and password2 is correct, the dongle is also logged on in user mode automatically. <br>---------------------------------------------------------------------------------------------------
Parameters<br>Parameter Meaning<br>*pPassword1 [in]Password 1<br>*pPassword2 [in]Password 2<br>*pPassword3 [in]Password 3<br>*pPassword4 [in]Password 4<br>*pHandle [out] Dongle handle
Return values<br>Marco Value Meaning<br>SUCCESS 0 Success<br>ERROR_UNIKEY_NOT_FOUND 200 No UniKey dongle<br>ERROR_UNIKEY_INVALID_PASSWORD 201 Found UniKey dongle, but Basic passwords are incorrect<br>ERROR_UNIKEY_INVALID_PASSWORD_OR_ID 202 Wrong password or UniKey HID
&nbsp;
[[Category:UniKey_APIs]]

Revision as of 14:05, 10 April 2012


Find a UniKey dongle

API Prototype
long UniKey_Find( WORD* pHandle ,
DWORD* pSetting1 ,
DWORD* pSetting2 ) ;

Description
Check if a specific UniKey is attached to the USB port. This is the first API to start a UniKey session.

Parameters
Parameter Meaning
*pHandle [out] Dongle handle
*pSetting1 *[in] Working Mode (UniKey PRO only), useless for UniKey STD
[out] Hardware ID
*pSetting2 *[in] Access Mode (UniKey PRO only), useless for UniKey STD(UniKey PRO only)
[out] Number of dongle attached , useless for UniKey STD

Return values
Marco Value Meaning
SUCCESS 0 Success
ERROR_UNIKEY_NO_UNIEKY 200 No UniKey dongle


Find the Next UniKey dongle

API Prototype
Long UniKey_Find_Next( WORD* pHandle ,
DWORD* pSetting1 ,
DWORD* pSetting2 ) ;

Description
Check if another UniKey is attached to the USB port.

Parameters
Parameter Meaning
*pHandle [out] Dongle handle
*pSetting1 *[in] Working Mode (UniKey PRO only), useless for UniKey STD
[out] Hardware ID
*pSetting2 *[in] Access Mode (UniKey PRO only), useless for UniKey STD(UniKeyPro only)
[out] Number of dongle attached , useless for UniKey STD

Return values
Marco Value Meaning
SUCCESS 0 Success
ERROR_UNIKEY_NOMORE 214 No more dongle
ERROR_UNIKEY_NEED_FIND 215 No Find before Find_Next


Logon UniKey Dongle

API Prototype
long UniKey_User_Logon( WORD* pHandle ,
WORD* pPassword1 ,
WORD* pPassword2 ) ;
-------------------------------------------------------------------------------------------

For UniKey Drive, the API Prototype is UniKey_User_Logon (WORD* pHandle, DWORD* pPassword1, DWORD* pPassword2);
-------------------------------------------------------------------------------------------
Description
Logon a UniKey dongle with specified passwords. This API should be called in the released software in order to improve security.

Parameters
Parameter Meaning
*pPassword1 [in]Password 1
*pPassword2 [in]Password 2
*pHandle [out] Dongle handle

Return values
Marco Value Meaning
SUCCESS 0 Success
ERROR_UNIKEY_NOT_FOUND 200 No UniKey dongle
ERROR_UNIKEY_INVALID_PASSWORD 201 UniKey dongle found, but Basic passwords are incorrect
ERROR_UNIKEY_INVALID_PASSWORD_OR_ID 202 Wrong password or UniKey HID


Logon UniKey Dongle in vendor mode


API Prototype
long UniKey_Vender_Logon( WORD* pHandle ,
WORD* pPassword1 ,
WORD* pPassword2 ,
WORD* pPassword3 ,
WORD* pPassword4 ) ;
---------------------------------------------------------------------------------------------------
For UniKey Drive, the API Prototype is UniKey_Vender_Logon(WORD* pHandle, DWORD* pPassword1, DWORD* pPassword2, DWORD* pPassword3, DWORD* pPassword4);
---------------------------------------------------------------------------------------------------

Description
Logon a UniKey dongle in vendor mode with specified passwords. This API helps software vendors to logon the UniKey dongle in vendor mode, and get the full permission to UniKey dongle.
---------------------------------------------------------------------------------------------------
We do NOT advise you to enclose this API in the final released software. This API is only for software vendor’s usage.
--------------------------------------------------------------------------------------------------
If password3 or password4 is wrong while password1 and password2 is correct, the dongle is also logged on in user mode automatically.
---------------------------------------------------------------------------------------------------

Parameters
Parameter Meaning
*pPassword1 [in]Password 1
*pPassword2 [in]Password 2
*pPassword3 [in]Password 3
*pPassword4 [in]Password 4
*pHandle [out] Dongle handle

Return values
Marco Value Meaning
SUCCESS 0 Success
ERROR_UNIKEY_NOT_FOUND 200 No UniKey dongle
ERROR_UNIKEY_INVALID_PASSWORD 201 Found UniKey dongle, but Basic passwords are incorrect
ERROR_UNIKEY_INVALID_PASSWORD_OR_ID 202 Wrong password or UniKey HID