SoftwareShield System Feature Guide > Expiring Licenses > Last Used Date/Time

Last Used Date/Time


You should already have a basic understanding of expiration types in the SoftwareShield System, If not please read Expiring Licenses in this reference.

If a license is currently under the effect of an expiration of any type, regardless of if it has expired or not, the license is said to be in Expire Mode. Any license in Expire Mode used the Last Used Date/Time field that is stored internally.

The Last Used Date/Time is just that - a record of exactly when the StartUp function on the ClientProtector was called, when the system clock was not detected to be rolled back and the license was in Expire Mode.  Note that this field is stored in UTC time, so is not affected by daylight savings time or time zone differences between the client machine and the server machine where Activation Codes may be generated.

Since the most common attack on an Expire Mode license is turning the system clock back to gain additional usage, the ClientProtector detects if time has moved backward since it was last started on a particular license by comparing the system date and time with the stored last used date and time. If time has somehow gone "in reverse" then the clock has been rolled back. If detected, the StartUp call will return a special code (FALSE_CLOCK_TURNED_BACK) to your software that will allow you to (optionally) prompt the user to correct their clock. Unlike other possible inconsistent states of a license, when the clock is detected to have been turned back, the license cannot be "recovered" until the clock is corrected. (See License Recovery for more information).

You can (and should) set at design time the Last Used Date/Time field of your license. When you create a license for distribution, one of the last things you should do is reset this field to the current date and time.

The first time your application is run, and the StartUp function is called, this field is compared against the actual date and time to ensure that if your customer tries to install and run the program with a system date that is before the date you issued it that they will fail. This is a common attack on a license which has a Hard Expire Date. Every time you reissue a license (especially one which expires) you should reset this to the current date and time.

Checking the expiration state of your license and clock consistency primarily occurs in the ClientProtector StartUp function. For a view of the logical flow of control, see the SoftwareShield ClientProtector Control Flow-Charts.

If you are distributing your application internationally, there is a remote chance that someone who receives this license and installs it in a time zone which is before yours in procession will receive an error due to the date being invalid. This would be extremely rare, but could conceivably happen due to the time zone difference. If you need to get around this, simply enter a date and or time a full day before the current date.

More Information

For help on actually setting the initial Last Used Date/Time in your license, see Expiration Tab in the SoftwareShield License Manager Reference.

Related Topics