TArtLicense v1.2
TArtLicense - very simple nonvisual Delphi component useful for shareware
program developing.
It uses crypted license files containing information about exe file (size and crc),
expired date and any additional information.
As TArtLicense uses RSA asymmetric algorithm and TArtLicense knows only decryption key,
nobody can change information inside license file.
Archive also includes source code of ArtLicGenerator (program to generate license files compatible with TArtLicense).
Warning! TArtLicense Component v1.1 is not understand license files, created for previous version.
Properties:
propertyLicInfo : TArtLicInfo; - Contains decrypted license information.
TArtLicInfo = record date : TDatetime; - expired date size : LongWord; - exe file size crc : LongWord; - crc of exe file code : string; - license code data : string; - any additional data end;
Published properties:
property LicFile : string; - specifies license file name.
property Message : string; - message to show if license is invalid and Action property set to etShowMessageAndTerminate;
property Action : TArtLicErrType; - specifies what Test procedure should do if license file is invalid.
type TArtLicErrType = (etSilent, etException, etTerminate, etShowMessageAndTerminate);
property Code : string; - license code
property UseSize : boolean; - test size and crc of exe file and specified in license file
property UseDate : boolean; - test date specified by TestDate property and license expired date
property TestDate : TDateTime; - date to test with license expired date
property Key : string; - decryption key (hex string).
property Data : string; - returns data contained in license file as string (same as GetDataString)
property ExData : string; - returns additional (not encrypted) data contained in license file as string (same as GetExDataString)
Methods:
function Test : boolean; - Test license file specified by LicFile property
function GetInfo : TArtLicInfo; - returns decrypted license information (equal to LicInfo).
function GetDataString : string; - returns data contained in license file as string (same as Data)
function GetDateSize : integer; - returns size of additional data in license file
procedure GetData(var buff); - write data to buffer of any type.
function GetExDataString : string; - returns additional (not encrypted) data contained in license file as string (same as Data)
function GetExDateSize : integer; - returns size of additional (not encrypted) data in license file
procedure GeExtData(var buff); - write additional (not encrypted) data to buffer of any type.
Set LicFile property to license file name. Specify license code. License code can contain any information and should coincide with one in license file. For example it can determine application version license intended for or depends on hardware configuration (n.b. you can use THDDInfo component to obtain s/n of hard drive). In last case license file will be bound to the specific computer and can't be used on other one.
If you want to test exe file size and crc number set UseSize property to true. This verifies that exe file is unchanged.
If you want test expired date, set TestDate property to current date (or any other desirable value) and UseDate property to true.
Set Key property to decryption key.
Call Test method to verify license. If license file contains valid information (code, date, file size and crc) Test method returns true. Depending on value of Action property Test method can simply return false (Action = etSilent), raise exception of EArtLicViolation type (etException), terminate program (etTerminate) or show message specified by Message property and then terminate program (etShowMessageAndTerminate).
To get license information use LicInfo or Data property or GetInfo and GetDataString methods. If information in license file is not of string type, you can use GetDateSize method to obtain size of data and GetData method to copy data into buffer of any type.
License file can contain additional (not encrypted) data. To obtane additional data use ExData property or ExGetInfo and ExGetDataString methods. If additional information is not of string type, you can use GetExDateSize method to obtain size of additional data and GetExData method to copy data into buffer of any type. Of corse to protect your data you can store all you additional information inside Data field, but as symmetric encryption algorithms are much faster than RSA, it is reasonable to encrypt additional data with symmetric encryption algorithm and place only the key into Data field of license file. See Demo for example of implementing this scheme.
To create license file use ArtLicGenerator program.
Artem V. Parlyuk, e-mail:info@artsoft.name, http://artsoft.name
RSA implementation is made by Walied Othman, to contact him mail to Walied.Othman@Student.KULeuven.ac.be or Triade@ace.Ulyssis.Student.KULeuven.ac.be
Crc32 unit by Andrew Rubin
IMPORTANT - READ CAREFULLY
This license and disclaimer statement constitutes a legal agreement ("License Agreement") between you (either as an individual or a single entity) and Artem Parlyuk (the "Author"), for this software product in this particular case TArtLicense Delphi component ("Software"), including any software, media, and accompanying on-line or printed documentation.
BY DOWNLOADING, INSTALLING, COPYING, OR OTHERWISE USING THE SOFTWARE, YOU AGREE TO BE BOUND BY ALL OF THE TERMS AND CONDITIONS OF THIS LICENSE AND DISCLAIMER AGREEMENT. If you do not agree with the terms and conditions of this agreement, you must promptly cease all use of the software and destroy all copies of this software and all of its component parts in your possession or under your control.
This Software is owned by Author and is protected by copyright law and international copyright treaty.
This Software is freeware. You are granted the permission to use Software in your own applications for private or commercial purposes, provided your software contains the copyright notice "TArtLicense Delphi component Copyright (c) by Artem Parlyuk" and link to the Author site (http://artsoft.name) and Author e-mail (mailto:info@artsoft.name) .
You can freely distribute copies of the main archive as long as no alterations are made to the contents and no charge is raised except a reasonable fee for distributing costs. You may not remove copyright notices from copies of the Software. You may not claim this Software as written by anyone but Author, Artem Parlyuk.
The author has taken all possible care to ensure the software is error-free, however the author disavows any potential liability arising from any use of the software. This software is provided "as is" and without any warranties expressed or implied, including, but not limited to, implied warranties of fitness for a particular purpose, and non-infringement. You expressly acknowledge and agree that use of the Software is at your sole risk.
In no event shall the author be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use this software or documentation, even if the author has been advised of the possibility of such damages.
Any feedback given to the Author will be treated as non-confidential. The Author may use any feedback free of charge without limitation.