Contents - Index


4.2.1.4 Licensing a Product

After your product is registered on the end user's machine you need to license the product by issuing the user with a Licence Key.

The end user exchanges a Reference Code for the Licence Key. The Reference Code is unique to your product and the machine it is installed on and consists of 24 digits, with the first 12 digits being the machine signature, the next 4 digits being the product signature and the last 8 digits being the run-time signature.

There are two ways of authorising a licence: by using the Sheriff Administrator or by using your application:

  1. The end user will run Sheriff Administrator to generate a one-time user Reference Code and give it to you in exchange for the Licence Key. You use the Sheriff Licence Key Generator (SlsGen) to generate a Licence Key for the user, who enters the Licence Key in the Sheriff Administrator (SlsAdmin). Details can be found in the help topics for SlsAdmin and SlsGen.

  2. If you wish to present your own authorisation dialog boxes in order to keep a consistent 'look and feel' - and to make the authorisation procedure more convenient for your users - you will need to call two API functions, SLS_GetReference and SLS_SetLicence.

    SLS_GetReference is called to generate the user's Reference Code. Once the Reference Code has been exchanged for a Licence Key then SLS_Licence is called to authorise the Licence Key.

    Authorisation should take place the first time the user installs your application or any time your application detects that there is either no licence on the machine or an existing licence has become invalid (E.g. because it has expired). When your application calls SLS_Request to request a valid licence, SLS_Request returns an error if the licence requested is invalid or undefined.

    You can also call SLS_QueryLicenceInfo to obtain the current state of a licence including detailed licence policies and licence usage such as the number of days left or the number of users using the licence.