UniKey RTC API Protection Solution: Difference between revisions

From SecuTech Wiki
Jump to navigationJump to search
No edit summary
Bao (talk | contribs)
Minor rewording and spelling fixes, added alt tags
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[category:UniKey RealTimeClock Protection Solution]]
[[category:UniKey Application Solutions]]


= Introduction<br>  =
== Introduction ==


UniKey Time provides Real Time Clock feature and this article will introduce how to integrate UniKey Time APIs with your own projects and how to use the features UniKey Time provides for us.  
UniKey Time provides a real-time clock (RTC) and this article will introduce how to integrate UniKey Time APIs with your own projects, and how to use the features UniKey Time provides. Each Unikey Time has an embedded battery, this provides the UniKey Time with a real-time clock. This means that clock inside of the UniKey is unique and independent from the computer’s system time. The protected software will expire on time, even if the user changes their system time. Each UniKey Time has 16 Time Modules, each UniKey Time Module can be used to set the duration of the protected software.


<br>
For example, I could set the start and end time for Time Module Number 0. Then bind my software with Time Module No.0, after this step, my software will have a limited start and end time. If the time inside of the dongle reaches the expired date, then the software will not run.


<br>Each Unikey Time has a real battery embedded; this provides the UniKey Time dongle the Real Time Clock feature. This means that clock inside of the UniKey is unique and independent from the computer’s system time. The protected software will be expired on time and even the user changes his system time, the protected software still won’t work for him.
== Setting Expiration Date for Software ==


<br>
Users can refer to the following steps on integrating UniKey Time APIs.


<br>Each UniKey Time has 16 Time Modules; each UniKey Time Module can be used for setting the duration time of the protected software. <br>
[[Image:UniKey_Time_RTC_API_Protection_Pic01.jpg|alt=UniKey Time set start and end time or duration]]


<br>
=== Set Module Start Time and End Time  ===


For example, I could set start time and end time for Time Module No.0. Then binding my software with Time Module No.0, after this step, my software will be limited within the start time and end time. If the time inside of the dongle reaches the expired date, that is end time, the software will not work again.  
In order to set the start and end time, we need to use two UniKey APIs.  


<br>  
<code>
UniKey_Set_Time_Module_Start_Time(Handle, Module, Year, Month, Day, Hour);


<br>  
UniKey_Set_Time_Module_End_Time(Handle, Module, Year, Month, Day, Hour);
</code>


= Setting Expired Date for Software  =
After setting the start and end time for a specific UniKey Time Module (one of 16 Time Modules), our protected software has limited use within this time period.


Users could refer the following steps on integrating UniKey Time APIs.
=== Set Module Start Time and Duration Period  ===


<br>
In order to set the start time and duration, we need to use two UniKey APIs.


[[Image:UniKey_Time_RTC_API_Protection_Pic01.jpg]]
<code>
UniKey_Set_Time_Module_Start_Time(Handle, Module, Year, Month, Day, Hour);


<br>  
UniKey_Set_Time_Module_Duration(Handle, Module, Days, Hours);
</code>


== Set Module Start Time &amp; End Time  ==
This is another way to limit software run-time besides setting an end time directly.


In order to use the start time and end time to set the limit time period, we need to use two UniKey APIs.
=== Checking if Software has Expired  ===


<br>'''''UniKey_Set_Time_Module_Start_Time(Handle, Module, Year, Month, Day, Hour);'''''
We need to use one UniKey Time API to check if software has expired.


'''''<br>And'''''
<code>UniKey_Check_Time_Module_Now(Handle, Module, RemainDays, RemainHours);</code>


'''''<br>UniKey_Set_Time_Module_End_Time(Handle, Module, Year, Month, Day, Hour);'''''
This API will use the current time inside of the UniKey Time dongle to compare with the expiry date stored within the specified Time Module and then return the remaining days and hours for us. Letting us know if our protected software has expired, or how many days and hours left.


<br>After setting the start time and end time for a specific UniKey Time Module(one of its 16 Time Modules), our protected software is limited within this time period.
== Definition of UniKey Time APIs ==


<br>  
* <code>UniKey_Set_Time(Handle, Year, Month, Day, Hour, Minute, Second);</code> is used for setting a specific time for the UniKey Time dongle.


== Set Module Start Time &amp; Duration Period  ==
* <code>UniKey_Set_Time_Now(pHandle);</code> is used to set the UniKey Time's real-time clock to the current system time.


In order to use the start time and duration period to set the limit time period, we need to use two UniKey APIs.  
* <code>UniKey_Get_Time(Handle, Year, Month, Day, Hour, Minute, Second);</code> is used for getting the current date and time stored within UniKey Time dongle.


<br>'''''UniKey_Set_Time_Module_Start_Time(Handle, Module, Year, Month, Day, Hour);'''''
* <code>UniKey_Erase_Time_Module(Handle, Module);</code> is used for erasing a UniKey Time Module; this can be used after configuring a UniKey Time Module.


'''''<br>And'''''
<code>
UniKey_Set_Time_Module_Start_Time(Handle, Module, Year, Month, Day, Hour);


'''''<br>UniKey_Set_Time_Module_Duration(Handle, Module, Days, Hours);'''''
UniKey_Set_Time_Module_Start_Time_Now(Handle, Module);


<br>After setting the start time and duration period for a specific UniKey Time Module(one of its 16 Time Modules), our protected software is limited within this time period. This is another way besides setting an end time directly.
UniKey_Set_Time_Module_Start_Time_Now_PC (Handle, Module);
</code>


<br>  
* <code>UniKey_Set_Time_Module_Start_Time</code> is used to set the start time for one UniKey Time Module; it has three formats, you can define the specific date by yourself, or use the current time stored within the UniKey Time dongle, or use the current computer’s system time.


== Checking If The Software Expired or not  ==
* <code>UniKey_Set_Time_Module_End_Time(Handle, Module, Year, Month, Day, Hour);</code> is used to set the end time for one UniKey Time Module.


We need to use one UniKey Time API to check if the software expired or not, that is
* <code>UniKey_Set_Time_Module_Duration(Handle, Module, Days, Hours);</code> is used to set the duration period for one UniKey Time Module.


<br>  
<code>
UniKey_Check_Time_Module(Handle, Module, RemainDays, Year, Month, Day, Hour);


'''''UniKey_Check_Time_Module_Now(Handle, Module, RemainDays, RemainHours);'''''
UniKey_Check_Time_Module_Now(Handle, Module, RemainDays, RemainHours);


<br>  
UniKey_Check_Time_Module_Now_PC(Handle, Module, RemainDays, RemainHours);
</code>


This API will use the current time inside of the UniKey Time dongle to compare with the expired date stored within the specific Time Module and then return the RemainDays and RemainHours for us. So we could know if our protected software is expired or not, how many days and hours left.<br>  
* <code>UniKey_Check_Time_Module</code> is used to check if the protected software has expired; it has three formats, you can define the specific date by yourself, or use the current time stored within the UniKey Time dongle, or use the current computer’s system time.
 
<br>
 
= UniKey TIME APIs Explanations  =
 
<br>'''''UniKey_Set_Time(Handle, Year, Month, Day, Hour, Minute, Second);'''''
 
<br>UniKey_Set_Time is used for setting a specific time for the UniKey Time dongle.
 
<br>  
 
'''''UniKey_Set_Time_Now(pHandle);'''''
 
<br>UniKey_Set_Time_Now is used for setting the current system time to the UniKey Time dongle.
 
<br>
 
'''''UniKey_Get_Time(Handle, Year, Month, Day, Hour, Minute, Second);'''''
 
''<br>UniKey_Get_Time is used for getting the current date and time stored within UniKey Time dongle.''
 
<br>
 
'''''UniKey_Erase_Time_Module(Handle, Module);'''''
 
<br>UniKey_Erase_Time_Module is used for erasing a UniKey Time Module; this can be used after we configured one UniKey Time Module.
 
<br>'''''UniKey_Set_Time_Module_Start_Time (Handle, Module, Year, Month, Day, Hour);<br>UniKey_Set_Time_Module_Start_Time (Handle, Module);<br>UniKey_Set_Time_Module_Start_Time_Now_PC (Handle, Module);'''''
 
<br>
 
UniKey_Set_Time_Module_Start_Time is used for setting the start time for one UniKey Time Module; it has three formats, you can define the specific date by yourself, or use the current time stored within the UniKey Time dongle, or use the current computer’s system time.
 
<br>
 
'''''UniKey_Set_Time_Module_End_Time(Handle, Module, Year, Month, Day, Hour);'''''
 
<br>
 
UniKey_Set_Time_Module_End_Time is used for setting the end time for one UniKey Time Module.
 
<br>
 
'''''UniKey_Set_Time_Module_Duration(Handle, Module, Days, Hours);'''''
 
<br>
 
UniKey_Set_Time_Module_Duration is used for setting the duration period for one UniKey Time Module.
 
<br>
 
'''''UniKey_Check_Time_Module(Handle, Module, RemainDays, Year, Month, Day, Hour);<br>UniKey_Check_Time_Module_Now(Handle, Module, RemainDays, RemainHours);<br>UniKey_Check_Time_Module_Now_PC(Handle, Module, RemainDays, RemainHours);'''''
 
<br>
 
UniKey_Check_Time_Module is used for checking if the protected software is expired or not; it has three formats, you can define the specific date by yourself, or use the current time stored within the UniKey Time dongle, or use the current computer’s system time.<br>

Latest revision as of 12:46, 9 August 2016


Introduction

UniKey Time provides a real-time clock (RTC) and this article will introduce how to integrate UniKey Time APIs with your own projects, and how to use the features UniKey Time provides. Each Unikey Time has an embedded battery, this provides the UniKey Time with a real-time clock. This means that clock inside of the UniKey is unique and independent from the computer’s system time. The protected software will expire on time, even if the user changes their system time. Each UniKey Time has 16 Time Modules, each UniKey Time Module can be used to set the duration of the protected software.

For example, I could set the start and end time for Time Module Number 0. Then bind my software with Time Module No.0, after this step, my software will have a limited start and end time. If the time inside of the dongle reaches the expired date, then the software will not run.

Setting Expiration Date for Software

Users can refer to the following steps on integrating UniKey Time APIs.

UniKey Time set start and end time or duration

Set Module Start Time and End Time

In order to set the start and end time, we need to use two UniKey APIs.

UniKey_Set_Time_Module_Start_Time(Handle, Module, Year, Month, Day, Hour);

UniKey_Set_Time_Module_End_Time(Handle, Module, Year, Month, Day, Hour);

After setting the start and end time for a specific UniKey Time Module (one of 16 Time Modules), our protected software has limited use within this time period.

Set Module Start Time and Duration Period

In order to set the start time and duration, we need to use two UniKey APIs.

UniKey_Set_Time_Module_Start_Time(Handle, Module, Year, Month, Day, Hour);

UniKey_Set_Time_Module_Duration(Handle, Module, Days, Hours);

This is another way to limit software run-time besides setting an end time directly.

Checking if Software has Expired

We need to use one UniKey Time API to check if software has expired.

UniKey_Check_Time_Module_Now(Handle, Module, RemainDays, RemainHours);

This API will use the current time inside of the UniKey Time dongle to compare with the expiry date stored within the specified Time Module and then return the remaining days and hours for us. Letting us know if our protected software has expired, or how many days and hours left.

Definition of UniKey Time APIs

  • UniKey_Set_Time(Handle, Year, Month, Day, Hour, Minute, Second); is used for setting a specific time for the UniKey Time dongle.
  • UniKey_Set_Time_Now(pHandle); is used to set the UniKey Time's real-time clock to the current system time.
  • UniKey_Get_Time(Handle, Year, Month, Day, Hour, Minute, Second); is used for getting the current date and time stored within UniKey Time dongle.
  • UniKey_Erase_Time_Module(Handle, Module); is used for erasing a UniKey Time Module; this can be used after configuring a UniKey Time Module.

UniKey_Set_Time_Module_Start_Time(Handle, Module, Year, Month, Day, Hour);

UniKey_Set_Time_Module_Start_Time_Now(Handle, Module);

UniKey_Set_Time_Module_Start_Time_Now_PC (Handle, Module);

  • UniKey_Set_Time_Module_Start_Time is used to set the start time for one UniKey Time Module; it has three formats, you can define the specific date by yourself, or use the current time stored within the UniKey Time dongle, or use the current computer’s system time.
  • UniKey_Set_Time_Module_End_Time(Handle, Module, Year, Month, Day, Hour); is used to set the end time for one UniKey Time Module.
  • UniKey_Set_Time_Module_Duration(Handle, Module, Days, Hours); is used to set the duration period for one UniKey Time Module.

UniKey_Check_Time_Module(Handle, Module, RemainDays, Year, Month, Day, Hour);

UniKey_Check_Time_Module_Now(Handle, Module, RemainDays, RemainHours);

UniKey_Check_Time_Module_Now_PC(Handle, Module, RemainDays, RemainHours);

  • UniKey_Check_Time_Module is used to check if the protected software has expired; it has three formats, you can define the specific date by yourself, or use the current time stored within the UniKey Time dongle, or use the current computer’s system time.