beautypg.com

Echelon i.LON SmartServer 2.0 User Manual

Page 165

background image

i.LON SmartServer 2.0 Programming Tools User’s Guide

151

To verify that the license key in the FPM license file is valid, your license validation routine needs to
first check the results of the Node Lock Check. If the SmartServer passed the Node Lock Check, your
license validation routine should then check the FPM license data; otherwise, it should log a license
error. To check the FPM license data, your license validation routine must call the same security
algorithm you used to create the FPM license, and it must provide the security algorithm (1) the license
data returned by the license manager and (2) the secret key assigned to the FPM in the license
configuration file (iLONLicenseGenValues.xml). The security algorithm then calculates a license
key. The license validation routine should then compare the license key stored in the FPM license file
to the one just calculated. If their sizes and values match, the license validation routine should accept
the FPM license; otherwise, it should log a license error.

Overall, to enable license validation in your FPM application, you perform the following steps:

1. Insert #include

directives for the required file LicenseMgr.h and optionally the security

algorithm files LicMgrMd5.c and LicMgrHMacMd5.c. In addition, you must redefine the name
translations the macros defined at the beginning of the LicMgrMd5.c and LicMgrHmacMd5.c
files.

2. Declare data variables for the FPM license status and for the secret key assigned to the FPM.

3. Create a license validation routine.

4. Write the license validation algorithm to do the following:

a. Define local variables for the data to be passed to and returned by the license manager and by

the security algorithm, declare that the FPM is not licensed, and declare a license structure for
the license data to be passed to and returned by the license manager.

b. Call the method in the i.LON License Manager that performs a Node Lock Check and returns

the node lock status and license data.

c. Check the results of the Node Lock Check. If the SmartServer passes the check, call a

security algorithm that calculates the license key based on the license data. Compare the
license key stored in the license file to license key returned by the security algorithm. Based
on the results of the license key evaluation, validate the FPM license, or log a license error.

5. Implement some mechanism in your FPM application that results in the license validation routine

being called. You are solely responsible for implementing this mechanism.

6. Compile your licensed FPM application.