The only check it performs is for the presence of a .lic file with a text string in it, but it serves
as a good starting point. We improve on this simple scheme in the following sections by writing
a custom implementation of LicenseProvider and other related licensing classes using more
advanced cryptographic techniques.
The RsaLicense License
The License class from the System.ComponentModel namespace represents the information
used to direct the behavior of the license validation system and control feature enablement.
For our licensing system, we rely on the following information stored in our custom license class:
??? System.Type value of the control to which the license applies
??? Globally unique identifier (GUID) for the particular build of the control for licensing
purposes
??? Expiration date for the license
??? Full key string from the license file
The resulting class is simple because it is primarily a structure for information transport.
Listing 13-10 shows the full code for our RsaLicense class.
Control LicenseProviderAttribute
LicenseManager
License
LicenseProvider
License
File
CHAPTER 13 ?– P ACKAGI NG AND DEPLOYMENT 679
Listing 13-10. The RsaLicense.cs Class File
using System;
using System.
Pages:
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865