Contents - Index


4.6.1 Sheriff ISR - Internet Software Registration

Functions

In an Internet Software Registration system, there are three main functions that can be implemented:

  1. Reference Code generation
  2. Licence Key authorisation
  3. Licence Key generation

Manual & Automatic Systems

A simple manual system implements only the third function i.e. Licence Key generation.

  • The user enters a Reference Code in a form at the publisher's web site then clicks on the submit button
  • A licence key is generated and displayed on a web page.
  • The user manually enters the licence key in their Sheriff-protected application.

In an automatic system all functions, such as entering codes, are accomplished without any user intervention. In other words, the entire process is automated so that, for example, once a credit card transaction has been completed the software will be automatically registered on the user's machine.

Please note that this documentation does not go into the details of how to set up credit card authorisation etc. Normally the user will select the desired software features from a form on the web site and on submitting this form a second form giving purchasing information will be displayed. The second form could, for example, calculate the purchase price of the software based on the user's chosen features and prompt the user to initiate a credit card transaction, however the mechanism for this will vary with the publisher's individual requirements.

Introducing Sheriff ISR

Sheriff ISR enables you to distribute licence keys via the Internet using Microsoft Internet Information Server (IIS). On the client side, Sheriff ISR provides this facility by an ActiveX control (SlsLocalComNet.dll) and on the server side by Sheriff Extended ActiveX Control (SlsLocalComEx.dll) via Active Server Pages (ASP).

Components

Name Location Type Notes
SlsLocalComNet.dll Client ActiveX Control Currently used only with Sheriff ISR.
SlsLocalComEx.dll Server Extended ActiveX Control Use with ASP.

Overview

In the following we have assumed that if you want an automatic system, however you could choose to run the Extended ActiveX control on the server in a manual system.

Steps 1-7 (in Procedure, below) explain how to implement an automatic system via ActiveX controls & Active Server Pages. A registration form enables users to select the licensing features they want to buy. An ASP page then processes the form to generate the licence keys, which it does by calling the Sheriff Extended ActiveX control.

Demo

The demo application located in the folder "SDK\ISR" shows how to implement a simple ASP page by using the Sheriff Extended ActiveX control. RegisterForm2.htm is a sample registration form and Register2.asp is the sample ASP page. The demo also shows how to automatically generate the Reference Code and authorise the user's PC with the licence key generated by the ASP page, which is done by calling the Sheriff Internet ActiveX control (SlsLocalComNet.dll) on the user's PC.

Microsoft has released useful information about ActiveX security and best practises here.

Procedure

Step 1
SlsLocalComNet.dll must be installed and registered on the client machine. Software publishers can distribute SlsLocalComNet.dll with their software packages and install & register it as part of the installation process. Alternatively, SlsLocalComNet.dll can be downloaded from Web sites and registered on the client PC by running "Regsvr32". Note that some browsers cannot run ActiveX controls.

SheriffEx.dll must be installed and registered on the server machine.

Step 2
The software publisher sets up an HTML form that enables users to select from the the various licensing options. RegisterForm2.htm is an example of this type of registration form.

Step 3
To automatically generate the Reference Code, you need to call GetReferenceCode method from the SheriffNet ActiveX control by using VBScript or JavaScript. RegisterForm2.htm calls GetReferenceCode as soon as the page is loaded, so that the Reference Code is automatically filled up. Following is the script found in the RegisterForm2.htm.

<SCRIPT LANGUAGE="JavaScript">
function loadPage()
{
  Sheriff.ProductID="9758-3050-1918-9292-6466"
  var RefCode;
  RefCode=Sheriff.GetReferenceCode()
  if(Sheriff.Succeeded())
    document.RegForm.RefCode.value=RefCode
}
</SCRIPT>

Step 4
Once the user has selected the licence options to purchase, he/she will click on the "Submit" button to submit his/her order. The contents of the form will then be transmitted to the ASP page on the server specified by the ACTION attribute in the registration form. For example, in the RegisterForm2.htm, register2.asp is specified to process the form.

Step 5
In the Register2.asp, the registration form is parsed to get the options that the user has selected together with the Reference Code

Step 6
To generate the licence key, Register2.asp calls GetLicenceKey method from the SheriffEx ActiveX control with the Reference Code and licensing options.

Step 7
Once the licence key is successfully generated, you can automatically authorise the client PC with the key. To do this, you need to call SetLicenceKey method from the SheriffNet ActiveX control that is already installed on the client PC. If you want to provide the optional "publisher data", call SetPublisherData method. Following is the script found in the Register2.asp.

<SCRIPT LANGUAGE="JavaScript">

function SetLicenceKey()
{
      Sheriff.ProductID = "9758-3050-1918-9292-6466"
      Sheriff.SetLicenceKey("<%=RefCode%>","<%=LicenceKey%>")
      if(Sheriff.Succeeded()==true)
      {
            if("<%=PubData%>"!="")
              Sheriff.SetPublisherData("<%=PubData%>");
      }

      if(Sheriff.Succeeded()==true)
      {
            alert("Your machine is successfully licensed");
      }
      else
      {
             var ErrorMessage;
             ErrorMessage=Sheriff.GetLastErrorMessage();
             alert("Error: "+ErrorMessage);
      }
}
</SCRIPT>