Here is the detailed description of KeyChk Function #3:

Function #3

This function allows you to verify the presence of your Key based on the Product‑ID and Product PIN. Optionally, you may also verify the Key's Serial Number.

Additionally, this function will update the Uses Limit and User-Data based on the setting of these fields when KeyChk is called (see field details below).

If the Key is found, the following fields are returned:

  • Serial Number (if not specified).

  • Uses Limit (updated value).

  • Time Limit.

  • Expire-Date.

  • User-Data (updated value).

  • Lasered-ID.

  • Feature-Flags.

  • Registration Info (if supported by Key).

Except for the Uses Limit and User-Data, no other fields in the Key are updated by this call.

If the Key has a Time Limit and it's Timer has not yet started, this function will start the Timer ticking.

Be careful with this function! Whatever User-Data you provide in this call will overwrite the entire 16 bytes of User-Data in the Key. If you want to preserve part of the User-Data in the Key, use Function #1 first to read the existing User-Data, update the SCB with what needs to be changed and then use this function to write it back to your Key.

Before calling KeyChk setup the following SCB fields:

Error Code

6240 (hex)

It's a good programming practice to always set the Error Code to this value before calling KeyChk. If KeyChk doesn't find your SCB, it can't set the Error Code, but it will already be set to the correct value and your program will take the proper action.

Function Code

3

SCB‑ID

Kc.6” (ASCII)

Product‑ID

Set this to your Product‑ID shown on the Build Keys screen of the KeyBuild program.

This field is case sensitive.

PIN

Set this to your Product PIN shown on the Build Keys screen of the KeyBuild program. Please note that you CANNOT use the User-Data PIN here.

Product Serial Number

Normally, you will set this field to zero so the Key check will succeed as long as KeyChk finds a Key with your specific Product‑ID and Product PIN.

If you also want to verify that the Key present has a specific Product Serial Number, then set this field to the specific Serial Number that you want to verify.

Uses Limit

or

Uses Update

Set this field to zero if you do not wish to update the Uses Limit of the Key. Otherwise, set this field to a negative number equal to the number of “uses” that you wish to subtract from the Key's current Uses Limit. For example, to take one “use” away, set this field to "-1" (negative one).

Please Note: KeyChk is not allowed to ADD to the current value of the Uses Limit. This can only be done with the Renew program.

User-Data

Set this field to the 16 bytes of data that you want to store in the secure memory of your Key.

Be careful with this function! Whatever User-Data you provide here will overwrite the entire 16 bytes of User-Data in the Key. If you want to preserve part of the User-Data in the Key, use Function #1 first to read the existing User-Data, update the SCB with what needs to be changed and then use this function to write it back to your Key.

In EverKey Version 2, the last two bytes (16 bits) of this field was called the User-Data Flags.

The remaining SCB fields will be ignored by KeyChk.