Sunday, February 12, 2012



Licensing a product with the help of Licenser


Introduction:


This article explains the importance of why licensing a product/application is important. Also explains how we can re-use open source License Manager Tools in our application.

Consider a scenario where in you have developed a small application for a customer. At first you may not be thinking about licensing part. You may have developed as a prototype or a proof of concept and deliver it to the customer. She/he may be happily using all the features that you have provided in your application. The customer may also install and use your application in more than one system.




Eventually as the product/ application features get enhanced, one has to think about how we can license a feature so that we can restrict the clients from being using that. Or you can think about selling your product based upon some features. This is where product or application licensing by features comes into picture and it is very much important for a product/ application developer or an organization.



We shall see how to license our applications with the help of one Open Source codeplex tool named Licenser which is located at http://licenser.codeplex.com/



The Licenser package has the following things:

1. Licenser / Production – A license production tool

2. Licenser / API – An API for checking a license
3. Licenser / Identification – A tool that is used one-time by the end-user to display the computer id.
  
The first thing which is required for licensing is the client computer id. Ask your client to run LicenserIdentification.exe and send the computer id.


Creating a License File:

Once you receive the customer Id you are ready to go with generating a license for your client. Run LicenserProduction.exe , Click on File -> New


Fill in the customer details and save it.
Right click on the customer and click on New License


You need to fill in the following details and click on OK button to save the information
1.     Product name: Name of the product for which you want to license.
2.     License Type:
a.  Node Locked License: You are licensing based upon the computer Id.
b.  Demo license: Used for demo purpose and not in production.
3.     Password: The password with which you want to license you client. You can choose any password and send it across to your client. The client will make use of this while using the product. The LicenserAPI will validate based upon the License file, password and Feature name.
4.     Computer Ids: Computer Id of the client for which you want to generate a license.

Adding product features for licensing

In the Feature grid, key in the Feature Name. You have an option to make it either time dependent or not. If ‘IsTimeDependent’ is checked then you will have to provide the Expiration date.
Click on ‘Generate’ button to generate the License file. A Save dialog will be opened with a default file name. Just select the location where you wish to save the license file.



Test License

Now we will see how we can test the license by product feature from the LicenserProduction tool.

Under Customer -> Right click and select Test License. Below is the screen which pops up.


Testing the license file requires the following.

1.  Selecting the License file.
2.  Key in the password that you have chosen while generating the license for your customer.
3.  Enter the Feature name for which you want to test.

Click on ‘Test’ button to verify whether the LicenserAPI validates with the information which you have provided.

So now you got the license file, it has the list of features with which you can validate for a client to see if we can allow him to use a feature or not.                                                 

You will have to use this information in your application to validate the client and provide access to use only those features which are meant for him.


Behind the scene of a Licenser Tool:


The produced license file is digitally signed and it’s also specific for the licensed computer.
·  
   In order to enhance security, the application has to pass to the licenser a PASSCODE during run-time.
·  
   There are no restrictions for the number of features being licensed for the product.
·  
  The feature information, as well as the licensed computer identification together with the PASSCODE is encrypted into a digital signature that is written in the license file. So any tampering done to the license file say by modifying the information within it will invalidate the license.

No comments:

Post a Comment