RegKeeper - e-Sales Tracking Software

Automatic Key Generation

In order to automatically generate unlock keys, RegKeeper can use an external plug-in. The generated unlock codes can be inserted into an e-mail notification message sent to a customer.

Developers can write their own plug-ins to implement their own key generating algorithms, or can use a sample plug-in distributed with RegKeeper.

Key Generation Plug-in Requirements

If one global plug-in used for all products, the following applies:

The key generation plug-in should be named rkkeygen.dll and should be placed in one of the following locations: RegKeeper program folder, Windows system folder or any directory included in the PATH environment variable.

If a custom plug-in for each product is used, the file name indicated by the product's Custom key generator field should exist.

The plug-in should export the key generating routine, which should be declared as follows:

C++ syntax

typedef struct {
    char * ProductID;
    char * ProductName;
    char * UserFName;
    char * UserMName;
    char * UserLName;
    char * UserCompany;
    char * UserEmail;
    char * RegistrationName;
    int Quantity;
    char * AllFields;
    char * FieldsToModify;
    bool FailOrder;
    char * UserFNameUTF8;
    char * UserMNameUTF8;
    char * UserLNameUTF8;
    char * UserCompanyUTF8;
  } TKeyGenRecord;

__declspec(dllexport) __stdcall void GenerateKey(TKeyGenRecord * KeyGenInfo, char * UnlockCode, char * FileToAttach)

Pascal syntax

type
  PKeyGenRecord = ^TKeyGenRecord;
  TKeyGenRecord = packed record
    ProductID,
    ProductName,
    UserFName,
    UserMName,
    UserLName,
    UserCompany,
    UserEmail,
    RegistrationName: PChar;
    Quantity: Integer;
    AllFields: PChar;
    FieldsToModify: PChar;
    FailOrder: Boolean;
    UserFNameUTF8,
    UserMNameUTF8,
    UserLNameUTF8,
    UserCompanyUTF8: PChar;
  end;
  
procedure GenerateKey(KeyGenInfo: PKeyGenRecord; var UnlockCode: PChar; var FileToAttach: PChar); export; stdcall;

where

ProductID - product identifier,
ProductName - product name,
UserFName - customer's first name,
UserMName - customer's middle name,
UserLName - customer's last name,
UserCompany - customer's company,
UserEmail - customer's e-mail,
RegistrationName - name that was used as Registration Name,
AllFields - the list containing names and values of all available fields,
FieldsToModify - returns the list containing names and values for fields that need to be modified,
FailOrder - indicates to fail this order being processed. The key generator can set this to True to indicate that this order must be failed,
UnlockCode - unlock code returned,
FileToAttach - attachment file name returned,
UserFNameUTF8 - customer's first name UTF8 encoded,
UserMNameUTF8 - customer's middle name UTF8 encoded,
UserLNameUTF8 - customer's last name UTF8 encoded,
UserCompanyUTF8 - customer's company UTF8 encoded.

Fields with UTF8 suffix contains UTF-8 encoded Unicode values. Use them in your key generator if any of the respective customer's field may contain characters that don't map to your default locale. Also please note that your software must be able to handle UTF-8 encoded values if your key generator includes them into generated key.

AllFields passed to the key generator filled with the currently available values. FieldsToModify passed empty and key generator must fill it with only fields that need to be modified. AllFields and FieldsToModify format is following:

  edOrderID=1234
  edInvoiceID=
  edTransactionID=SCDV8990RT
  ...
  customedSomeCustomField=

Meaning of prefixes:

Generating file to attach

If your application uses key files to unlock, you can generate the file which should be attached to the order processing e-mail message inside your Key Generator function, and return its name in the FileToAttach variable. You don't need to delete this file after after the order has been processed. RegKeeper will store it in the database, and delete from the local drive.

Please note, that by default RegKeeper allocates a buffer of 4096 bytes for the generated unlock code. You can change the default buffer length, modifying the HKEY_CURRENT_USER\ Software\ SiComponents\ RegKeeper\ Options\ KeySize registry key value.

Copyright © 2002-2008 by Igor Siticov, SiComponents. All rights reserved.