Agile.net Copy Protection offers advanced copy protection solution you can use for your .NET projects. The following describes some of the general concepts used by Agile.net to protect your software.
Agile.net uses public key cryptography to generate and validate licenses, public key cryptography is a cryptographic approach which involves the use of asymmetric key algorithms where the key used to sign the license (aka 'the private key') is not the same as the key used to validate it (aka 'the public key). For each private key there is exactly one complimentary unlocking key that is used to validate the data signed. The private key is kept secret so that no other user can sign the data. The public key can then be used to decrypt that data knowing that it could only have been signed by the complimentary private key.
A license signed with a private key can be verified by anyone who has access to the public key, thereby proving that the license is authentic and has not been tampered with by a third party. Using Agile.net you'll be able to generate your own public/private key pairs, the private key will be used to generate licenses and the public key will be included in your protected assembly. During the license validation process Agile.net Copy Protection runtime component will use the public key to make sure the license was created by an authorized user.
By signing the licenses with the private key we can ensure that a license has not been modified since it was created by an authorized user. Since each assembly is associated with only one pair of keys we can also ensure that licenses created with one pair of keys cannot be used to unlock software protected with a different set of keys.
The license validation process is initiated by calling AgileDotNetLicenseProvider.Validate method, calling this method causes Agile.net runtime component to search for a valid license, first Agile.net searches the system for a license and then it validates it. A valid license is one that has a valid signature as described above and meets all the runtime restrictions as defined by the license creator.
To seamlessly integrate existing projects with Agile.net Copy Protection solution run the project wizard, to run it select the licensing tab and then press the Project Wizard button available from the main ribbon. The Project Wizard will create a public/private key pair that will be used to protect your software, it also adds a reference to the appropriate version of the AgileDotNet.Licensing.dll assembly and a code sample demonstrating how license validation code may look like. After running project wizard, open the solution file and add calls to LicenseManager.Valdiate method in each of the classes that you want to protect.
The next step is to create a license file that includes various restrictions that describe how the software may be used by the end user. The license should be placed in the protected application folder, you can also set additional folders for Agile.net to look for license files, this is done by calling AgileDotNetLicenseProvider.SearchDirectories method.
License files define which conditions should be met to allow authorize a user access to your protected software, you may restrict access to protected software completely or only to selected features if you wish to do so. A license file contains a collection of locks, lock is a term used to define a constraint or a property that can be inquired at runtime for its value at any time. Each license may contain different locks, giving different users of the software different levels of access to the protected software, each license can contain any number of locks that define exactly how the user may use the software.
When you create a license file Agile.net will sign it using a public/private key pair, using the key pair created by the Project Wizard. During the signing process the licenses are also signed using the same keys to prevent unauthorized users from tampering with the license.
During license validation each of the restrictions required by the included locks is checked to see if the current runtime environment matches the requirements defined by that lock. For instance the Time lock is added to a license to prevent the usage of the protected software after a defined period of time has ended.