LICENSE4J License Manager User Guide
LICENSE4J License Manager User Guide
LICENSE4J License Manager User Guide
USER GUIDE
VERSION 4.6.0
LICENSE4J
www.license4j.com
Table of Contents
Getting Started ........................................................................................................................................ 4
Managing Products ................................................................................................................................. 6
Create Product ..................................................................................................................................... 6
Edit Product........................................................................................................................................... 7
Refresh, Delete Product ................................................................................................................... 8
Disable and Enable Product Use ................................................................................................... 8
Change Product Category .............................................................................................................. 10
View Key Pair...................................................................................................................................... 10
Product Update Notifications ........................................................................................................ 12
Managing Categories ........................................................................................................................... 13
Create, Edit Categories .................................................................................................................. 13
Refresh, Delete Categories ........................................................................................................... 14
Backup and Restore Products ...................................................................................................... 14
Managing Licenses ............................................................................................................................... 15
Generate New License .................................................................................................................... 18
Generate New License in Bulk ..................................................................................................... 31
View License ....................................................................................................................................... 32
Modify License.................................................................................................................................... 33
Clone License...................................................................................................................................... 33
Delete License .................................................................................................................................... 34
Export License .................................................................................................................................... 34
Export Licenses to CSV File .......................................................................................................... 34
Search License ................................................................................................................................... 35
Test License ........................................................................................................................................ 35
License Deactivation ........................................................................................................................ 37
Manage License Templates ........................................................................................................... 38
Manage Activations .......................................................................................................................... 38
Manage Online Basic Key Usage ................................................................................................. 41
Automatic License Generation Settings ................................................................................... 43
Display License Generation URL ................................................................................................. 47
Display HTML Form Source for License Generation ............................................................ 48
Getting Started
License4J License Manager supports generation of license text, license key, and
floating license text. License Manager stores all products, templates, licenses, and
settings in a database. Database can be on a local embedded Derby database or on
database servers: MySQL, PostgreSQL, and Microsoft SQL Server. Online.License4J
system is an online storage for products and licenses, it is a license hosting system.
License Manager GUI is an easy to use software to manage products and licenses.
Main GUI window includes a left tree panel for navigation on products and
categories; and the table on the right displays licenses for the selected product.
Main GUI window size and location are saved to local configuration file on
application startup, therefore next time it is started, size and location will be same.
Another setting which is saved to configuration file is license table column visibility
settings. License table columns can be selected with a pop up menu which comes
when clicked on table header.
Visible column setting and column width values is saved on application shutdown.
License table and left product tree colors and font properties are customized on the
same table header pop up menu.
Managing Products
License Manager allows definition of products to categorize and manage generated
licenses. Public and private key pair is generated when product is created, and it
cannot be changed later.
Create Product
Create New Product menu item brings a window as below for creation of a new
product in license manager. Unique ID is for license manager database usage and
generated automatically. ID is a required field because it will be used in license
validation, product cannot be created without an ID.
Available key pair algorithms are RSA and DSA with 1024 and 2048 bit key size. For
generation of license keys EC algorithm is used.
If there is a key pair saved from another product previously, it can load that key
pair from selected file. Therefore two different products with same key pair (so that
public key and private key) can be created.
Edit Product
Product information can be changed with Edit menu item. Key pair settings cannot
be changed because generated licenses for this product becomes invalid if it
changes. If ID is changed all generated licenses before will fail in license validation
since license validation checks for product id given in validate method of runtime
library.
Products can be deleted with Delete menu item; deleting a product will also delete
all licenses, activations, templates, and license generation settings for that product.
License and modification key auto generation can be completely disabled with the
first checkbox. All license activation and requests can be rejected with the second
checkbox. All license deactivation requests can be rejected with the third checkbox.
Online license key validation can be disabled with fourth checkbox. When last
checkbox is selected all license modification requests are rejected.
When any of the feature is disabled, all generated licenses are affected, so it may
be used to temporarily disable a product and make modifications, updates etc.
Following window displayed with a list of products and categories, product will be
moved to selected category.
10
When KeyPair is selected from list, Save to File button is also displayed. Saved
KeyPair file should kept in a secure place; because it includes the private key for the
product. This option can be used for backup purposes or to create more than one
products with same public key; so that same public key can be used to validate
licenses for more than one product.
11
12
Following is the window to create a new update version. Notification count is the
number of times which update notification will be displayed to user; display count is
increased and stored for each different user computer.
Managing Categories
Categories is a way for grouping products on the left tree in license manager. They
are just like standard folders.
name
is
required
field.
Unlimited
13
number
of
categories
and
Backup operation copies all settings of product, license templates defined, auto
license generation settings, generated licenses and activations to an encrypted text
file. Password for encryption is defined before performing backup.
14
Backup file is encrypted with a password when checkbox is selected on the dialog
window as in the screenshot below. Encryption may take long depending on product
data size (number of licenses, activations etc.)
Backup/Restore can be also used to transfer some products with all their settings
and licenses to different database storage or to/from Online.License4J system. If
product includes licenses and or templates with activation feature enabled; and
license generation settings; and license keys floating over internet, it cannot be
restored to a local embedded derby database.
Managing Licenses
Licenses are generated for products in license manager, so a product must be
selected on left tree to enable license menu items.
15
Comment blocks can be added before or after the license text between /***
and */ characters like in Java. Line starting with # sign should be either not
modified or completely removed. The following is also a valid license text
format.
/** This a comment block before license text */
/** Some text here.
Some more text here.
*/
25f2ca4d8070e4a7baef4b7dd5549ba520dbb305d222dd9c18cbee490709
4cef78e28fade0e235f6011182c6764a1d5344b0605a2fd2b7769f47fb75
b7badc745e56870b04b1e658ddbb6661fa53e3f53ae515af5335d724db28
cfe13f9225a4a9f893fd0493b683c7b0df9b5b547ae0364fa82059dda7af
6ef448efa121974bf1b8eb26beb795a2b77339236a9360ccb350afef372e
16
afaa2dc1cc60e998284f41b2cebac295d840c3fcd1a6d0a0a698027cb91c
27248d477bcb9929878bd66c040216c1a2c12a79af3fc47eabddd279da33
ca9c58421d6de12608ef47ed5aa1af304998fc9211823b69e83d991c0d2d
5a804b5d39a2aeec8046e72c2cd93ca8fa01e643bf6ea32753d24e67d38e
60af3bd6842092fddfffd2c32383d6ed499d0aaed60c0dde2d28afb22e85
23c8296f850dad464fa40c4bc3ba3a80b57c8177f87b4c1ddd90c4f9f39e
1ec5914e68feefd5c376bceae7c98fb68d6f0f646c04d2cb12b77948b1f7
b52cdb1954eefc9ca3fb43a1f61dd4068ec426fa4bfe570cc1306f42ca4b
3174a60d1a568275c5a9f30891cadde7d968
/** This a comment block after license text */
/** Some text here.
Some more text here.
*/
17
The first step is for template loading, if there is no templates defined for the
product, it displays a message.
18
The second step includes user information. User information like name, company, email is defined. This step is same for all license types to save user information.
License type selection is on the third step. After selecting a license type, wizard
steps changes according to selected license type.
19
When license text is selected on the third step, following fourth step displayed for
defining license text features.
20
The next step of license text generation is to define some custom signed/unsigned
features if required.
Use the buttons on right to add, remove or edit a custom feature. Following is a
screenshot of add custom feature window.
Any information can be stored in key and value pairs in license text, and can be
checked/verified after license validation; depending on custom feature value some
software features can be enabled or disabled.
21
Signed custom features are used in license validation, so they cannot be modified in
license once license is generated. Unsigned custom features can be modified since
they are not used in license validation.
In the next step online date/time check settings defined. If it is selected to run on
each run, defined NTP server, web server, and if applicable active directory server is
queried in order to get the time, so date/time changing on customers computer can
be detected. If an online date/time source is queried and the difference is more than
24 hours with customers local computer time, license validation status is set as
INCORRECT_SYSTEM_TIME.
Web server link must return a single line of time since epoch like 1365676045742.
It should be text/plain and only contain the number.
And the last step for license file generation displays defined features for the license,
after clicking on finish button license is generated.
22
If Floating License is selected on the third step, one additional step is added to
wizard and as seen on screenshot below floating license features are defined.
Floating license check performed in defined license check period times in minutes.
Floating license server check performed if defined in related field. The last allow
multiple instances feature defines whether it will be allowed a user to run multiple
copies of software on the same host computer. This feature can be used to prevent
customers using a single product license on a remote computer by running many
copies with same user id.
Superseded Floating License IDs field defines superseded floating license IDs by this
new license. This feature is used to replace floating licenses on customers servers.
If it is needed to disable a floating license usage and replace with a new one due to
adding or removing some new features to software product, license IDs should be
defined in this field while generating new license. More than one license ID can be
defined separated with space character. When a new floating license is generated
and installed on floating license server with some superseded license IDs, all defined
license IDs are searched in installed license list and when found they are disabled.
23
It is possible to supersede all older floating licenses for a specific product depending
on search selection. Product ID search is always performed, then Edition and
Version fields are searched if selected. License issue date values are compared and
older licenses are superseded with this setting.
If the license superseding some other licenses are removed from floating license
server, superseded licenses are again enabled and can be leased. Since issued and
installed licenses cannot be modified on customers floating license server, license
superseding is the only method for floating license modification and/or replacement.
License supersede feature is first added to version 4.4.0. If any license with
supersede definition is installed on a floating license server older than version 4.4.0,
it will not supersede defined licenses because older versions does not have this
feature. In order to prevent use of superseded licenses on old floating license
servers, floating license server version can be queried with runtime library on
product side. LicenseValidator.getFloatingLicenseServerVersion method sends a request
to server and returns version number. It returns 0 (zero) for all floating license
server versions older than 4.4.0. If server version is 4.4.0+, it returns version
number as integer (e.g. 440). If new license supersede feature is used, it is
recommended to check version number before floating license validation. License.
getFloatingLicenseServerVersion method can also be used after license validation to
check for server version. If version number is not 440+, leased license should be
released with License.releaseFloatingLicense method.
24
If basic license key is selected on the third step, wizard steps changes as in the
following screenshot. Only license key features can be defined. Internal hidden
string is used in basic license key generation, if it is not defined unique product id is
used, so it must be used in license validation method. Customer full name and
company name can be used in license validation if related checkbox items are
selected.
25
If Online Basic Key Floating Over Internet license type is selected on the third
step, following step is displayed.
In this step, online basic key settings are defined. License concurrent quantity
defines maximum concurrent license usage count. Allowed Usage Count defines
maximum allowed usage. With allowed usage count, it is possible to limit how many
times a software is allowed to run.
Max Inactive Period defines maximum inactivity time in minutes for a license.
License4J Runtime Library periodically connects in defined intervals to Auto License
26
If Dont Keep Released License Usage Records checkbox is selected, historical online
license key usage records are not stored; records are deleted when they are
released. By default server keeps all released online key usage records.
Special key field allows to define the key, it should be between 5 and 255 characters
long. This field is optional, if it is left blank, 25 characters long license key is
generated.
Activation step is displayed as below for both online and database storage licenses.
If license will require activation, it can be defined in this step. As in the screenshot,
allowed activation count may be defined different from license quantity thus
customer buys one license but it may activate license on his/her two computers like
27
work and home if allowed. Deactivation records are also kept if Dont Keep
Deactivation Records check box is unselected. When maximum allowed deactivation
count is defined, user can deactivate and reactivate (to move license to another
computer) for defined number of times; after limit is reached activation status
returns an error. Reject Modification Key Usage checkbox controls modification key
usage for this license, if it is selected this license cannot be modified with any
modification key usage.
While generating a license template, allowed activation count field is replaced with
another field named as coefficient number as in the screenshot below. When a
coefficient number greater than 1 is defined, licenses generated with this template
will have allowed activation number set to license quantity multiplied with coefficient
number.
Coefficient number may be used for some licensing methods which requires more
than one activations for each generated license.
28
Activation period starts from license generation date, NOT license installation date
on customers computers, because license installation date can easily be changed.
Activation return types are activation code and license text. If license text is
selected and license type on the third step is selected as a license key one
additional license file features step is added and features which will be added to
activated license can be defined. Activation code return type generates a
cryptographically secure license key to be used as activation code.
Set Activated License Generation Time to Activation Time checkbox is enabled only
when selected activation return is a license text. It is also available on license
template generation wizard. When this checkbox is selected, activated license text
which will be delivered to customer will have generation time set to same value with
activation time. This feature is useful when a single trial license to be generated; a
single trial license is generated and distributed in software or web page to all
customers, and when customer activates license its validity period starts, and works
for defined limited validity period. Also sometimes, it may be required to generate a
license which validity period starts after activation. Offset From Activation Time
setting defines some negative offset value from activation time. When it is defined
activated license text generation time is generated with calculated offset. This is
useful if users local computer time is not synchronized with a time source on
Internet; if users local computer time is ahead real time, activated license text will
be invalid until local computer time is ahead activation time.
29
Custom hardware ID can be used and enabled with Check Custom Hardware ID
checkbox. When this checkbox is selected activation server will use the custom
hardware ID supplied with autoActivateWithCustomHardwareID method.
In version 4.5.4+ custom features step is different for floating license text type
license. There is a new feature in floating license text to count custom features
usage. When Add button is clicked to add a new custom feature, following window
is displayed.
Concurrent use quantity can be defined for each signed custom feature, then it can
be checked out by LicenseValidator.checkoutFloatingLicenseTextCustomFeature(String
30
library. When it is successfully checked out the value of custom feature can be
verified with license.getLicenseText().getCustomSignedFeature(featureName)
method.
Notice: By default custom features with defined quantity is not enabled after license
validation, they must be checked out specifically.
CSV file must be encoded as UTF-8 and include following columns without a header.
Full Name, Registered To, Company, E-Mail, Street, Telephone, City, Fax, Zip Code Country, Quantity
31
View License
Generated license features are displayed with View menu item. On the bottom,
license string which will be sent to customers will also be displayed. License
information as displayed on this window can be saved to an HTML file with Save as
HTML button.
32
Modify License
There are two different modify menu items in License menu. Full modify option is
used to modify all license features but this modification also changes previously
generated license key or text. So that license string should be sent to users again.
Minimum modify option modified license features which are not directly used in
license key/text generation. The features which cannot be modified will be disabled
on minimum license modification wizard. Most of the features of license keys can be
modified including quantity, because there are only few features used in license key
generation. Only activation features can be modified for license text. Floating license
text cannot be modified.
Clone License
Cloning license is available through Clone menu item. The generate license wizard
comes with all features defined as in the source license. They can be used as is, or
can be changed. A new license with a different license ID will be generated, and the
generated license string will be different.
33
Delete License
Licenses can be deleted with delete menu item. If deleted license has activations, all
activations are also deleted. License availability on server can be checked with
LicenseValidator.checkOnlineAvailability method. When you want to blacklist a license
and stop future usage on customer computers, you can just delete or move license
to recycle-bin use checkOnlineAvailability method in your software product.
Recycle Bin folder is only displayed when View Recycle Bin menu item is selected
on the product menu. License menu and right click pop up menu includes a menu
item as Delete (move to recycle bin), when clicked selected license(s) are moved
to recycle bin. To permanently delete license(s), Delete menu item should be
used.
Export License
Licenses selected on the license manager are exported to text files with Export
menu item.
Selected licenses can also be exported to Excel (xlsx) file with current view setup.
Excel file will include only the active columns on License Manager.
34
Search License
A License key or text can be searched with Search menu item in License menu.
Single license key or any license text is searched for selected product and if found
license view window displays the found license information; found license is auto
selected on license table. It also searches for activation code and activated license,
if given license key is an activation code or given license text is license activation it
displays activation view window after finding the license and displaying activation
management window. When a modification key is searched, modification key
management window is opened and found modification key is selected then
displayed.
Test License
Generated license keys and license text can be check within License Manager GUI,
after test completes, source code is displayed and can be copied to run on any Java
IDE tool. Test is performed with all available arguments of LicenseValidator.validate
method. First test is performed with correct arguments to test that license is valid.
35
Other tests are performed with incorrect variables to demonstrate and test license
features. License and maintenance expiration features are tested with incorrect local
time if online date/time check is not enabled.
After test completed Show Source Code displays the source code for performed
tests.
36
License Deactivation
By default license deactivation is disabled. It can be enabled during license
generation in activation step or later in manage activations window. Manage
activations window actions menu has a menu item called Disable Auto Activations,
a notification is displayed on the window if it is disabled.
37
Version 4.5.4+ includes two new menu items in Actions menu. The first one is
Display validate Code; it gives license validation code for licenses generated by
using the template. The second menu item is for new easyValidate method. It gives
encrypted string to use in easyValidate method.
Manage Activations
License activation is a feature which is enabled when used with Online.License4J
storage
system
or
Auto
License
Generation
38
and
Activation
Server,
so
When activation management window opened, all activations for the license is
displayed.
On the bottom, activation count and allowed activation count is displayed. Allowed
activation count can modified with Modify Maximum Allowed Activation Count menu
item in Actions menu. Deactivation count and maximum allowed deactivation count
is also displayed if defined for license in license generation wizard; maximum
allowed deactivation can be modified in Actions menu.
39
Allow or Deny action should be selected first, then desired IP blocks can be defined
and modified with buttons on the right of window.
Auto and manual activations for selected license can be temporarily or permanently
can be disabled with related menu items in actions menu.
Manual activation is performed with Add Manual Activation menu item, as on the
following screenshot hostname (for informational only, not used in activation
creation), and hardware id should be defined. After adding activation, it can be
exported to a file to send to customer.
40
Selected activations with all database fields can be exported to CSV file with related
menu item. They can also be exported to Excel (xlsx) file as seen on License
Manager Table.
Real time online basic key used can be monitored with Manage Online Key Usage
menu item in main license menu. Following window is displayed and it is very
similar to manage activations window.
Windows displays all usage whether it is active or inactive. Inactive usage is grayed
out in table view. There are two options to remove a license lease: Remove menu
item just marks usage as deleted and license use becomes available, but
Permanently remove menu item completely deletes license usage record from
database so license use count and usage time duration values are also updated.
41
License quantity can be modified with Modify License Quantity menu item. All
changes are applied in real time. Current license usage is displayed on the bottom
of window.
License usage can be disabled with Disable New Validation and Lease menu item
in actions menu. Currently leased licenses will continue to work but new license
lease requests will be denied.
If license has a limit for maximum use, current use count and maximum value is
displayed at the information panel. Maximum allowed use count can be modified
with related menu item in actions menu. If maximum use limit is not defined for
license, window still displays current use count but does check for limits.
If maximum usage time limit is defined, usage times and maximum value will be
displayed on window. When usage time limit reached, server denies license lease
requests;
if
license
is
already
leased
defined
handler
timer
thread
(OnlineLicenseKeyCheckTimerHandler) is run.
License usage table can be refreshed with related menu item or with F5 key to see
current license usage.
Selected online key usages with all database fields can be exported to CSV file with
related menu item. They can also be exported to Excel (xlsx) file as seen on License
Manager Table.
42
43
Window includes three tabs for general, input and output settings. Also there are
predefined settings for Share-it, RegNow, SWREG, FastSpring, Avangate and PayPro
which can be loaded on the bottom of window.
44
Since auto license generation will be performed by accepting HTTP POST requests,
allowed server IPs can be defined on the first screen. Security code is for license
generation URL and check on each license generation request. Allowed domains field
is used to define domains which are allowed to send Ajax requests. Allowed domains
are used in Access-Control-Allow-Origin header.
On the input settings tab, POST variable names which any payment processors or
remote server is posting are defined. Custom features can also be defined, so it is
possible to send many features to use in license generation.
Security code parameter and Security code value is used for some payment
processors for extra security, not all payment processors support it. If a custom
license generation request sent, it can be also used for security. Generated sample
PHP script use this security code protect license generation.
45
On the output settings tab, HTTP response type, disposition content before and after
license string can be defined to support any payment processor, or any custom
license generation requests.
46
47
This URL is used to post license generation request with data in post variables. HTTP
or HTTPS can be used; HTTPS may be unsupported or slow in some cases.
It can generate three sample HTML forms. Basic HTML form just submits a form to
server and displays generated license. Ajax HTML form submits form with an Ajax
request and displays generated license on the same page without page refresh.
Finally it also generates a PHP file for secure license generation; since PHP is a
server side language, users cannot see license generation URL and security codes in
PHP script. Open in Browser button saves generated HTML file to users home folder
and open in default browser.
48
49
SMTP server settings must be defined on Mail Server Settings window which displayed
when Mail Server Options menu item clicked under Tools menu. As seen in the
screenshot below, any SMTP server with or without authentication can be used. Mail
settings are should be defined as a template. From name and e-mail address are
mandatory fields which will be used in sending e-mail. CC and BCC fields are
optional and can be used if required. Attachment field defines attached license file
name. There are two message editors available; a simple WYSIWYG editor and
HTML Source editor.
50
The keywords in curly braces will be replaced by values from the license. Supported
replacement keywords are: {Product-ID} {Product-Name} {Product-Edition}
{Product-Version} {License-ID} and {User-FullName}.
License menu and context menu when right clicked on a license or activation
includes a Send E-mail menu item. As seen in the screenshot below, all keywords
between curly braces are replaced with the values in selected license. TO field is
obtained from user e-mail setting in license. Message can be modified on this
window just before sending e-mail.
51
License Messages
Messages can be defined for licenses to be sent to license owner customers.
Runtime library has a method to check for messages for the license. If you want to
send a message to a customer after license validation, it can be added with related
menu item in License menu.
Manage License Messages window as in the screenshot below displays all messages
for the selected license. With Actions menu new messages can be created, edited or
deleted. Client Read Count column displays total number of different client
computers which message is displayed on.
52
New message window has two fields. Display Count is the number of times which
message will be displayed to user. After checkForNewMessage method, if new
message is found it is returned to user and display count is increased for the user
computer. Message is displayed until display count value is reached. If display count
is zero, message is always displayed.
53
License Tags
Each license can have maximum of three tags. Tags is used to sort licenses on the
table or on the left product tree. Each license tag will become a tree node when
View License Tags menu item is enabled on Product menu or pop up menu.
On the License menu and pop up menu, there is a menu item named as Tag;
when it is clicked a dialog is displayed to define tags.
License Use Update (last time used & total use count)
Basic license use information can be sent to server and displayed on License
Manager GUI. LicenseValidator.updateLicenseUseInfo method in runtime library
54
should be called after license validation. License Manager GUI license table includes
two
columns
named
as
Total
Use
Count
and
Last
Use
Time;
when
updateLicenseUseInfo method is called total use count is incremented and last use
time is updated. This feature can be used track actively used license and software.
key
and
values
passed
in
as
hashmap
argument
to
server.
License Manager GUI license table displays up to ten license use tracking keys. The
keys to be displayed is defined in the related menu item of table header pop up
menu.
55
Both key and value should be String in the HashMap (HashMap<String, String>).
The maximum number of characters for both key and value is 255; and the
maximum allowed number of keys is 255 for each license.
Modification keys are useful if you want to modify an already activated license for a
customer. A custom feature may be added to add a new feature to software product
or expiration date can be extended. So you do not need to generate a new license
to extend validity periods, or modify features for a customer. Once a modification
56
key is used, license is modified and new activated license text is obtained, then it
can be replaced with the old activated license text on customer computer.
Like license and activation management, all actions are available in Actions menu.
Key usage window is displayed with Manage Key Usage menu item. In this
window, key usage information is displayed, and also usage restrictions can be
applied. As in the license activations, IP block restriction, maximum usage count can
be modified, also key temporarily or permanently can be disabled.
57
If required modification keys can modify license owner information, the second step
is for user information.
58
The third step defines key type and quantity. Modification key can be used until
defined quantity reached, and it modifies defined number of licenses. Dedicated To
License ID field is used to dedicate this generated modification key to a specific
license, and it cannot be used to modify any other license. Key validity period
defines modification key expiration date. The key expires if not used with validity
period. Special key field allows to define a special modification key for a customer;
it can be anything from 5 to 255 characters.
59
The fourth step defines license text features to be modified. If defined, valid product
edition and version values replaces the same features in license. Validity period and
maintenance period definition is used with an action found in the combo box.
Add/Remove
action
adds/removes
defined
number
of
days
to
license
validity/maintenance validity periods. Replace action changes the old value to the
defined new value.
Defined number of days are added either after license expiration date or current
date. E.g. If original license validity period is set as 365 days, the license expires in
one year. If user buys extension and you generate modification key to extend
validity period after expiration date, new value for days is directly added to original
365 days. If you generate modification key to extend validity period after current
date, new value for days are added after modification key generation date (current
time); so that days passed between original license expiration date and extension
purchase date are also added to new validity period.
60
The next is step defines the custom features. As in the license generation
signed/unsigned custom features can be defined, but in this step also an action is
defined.
Add,
Remove,
Replace
actions
modifies
license
custom
accordingly.
61
features
Modification key format is defined at the second step. Disabled fields are only for
modification key usage, they cannot be used in templates.
62
License text features are defined at the third step, and they are same as in the key
generation.
63
64
Create menu item in actions menu is used to create an auto generation setting, and
it is similar to auto license generation setting. The only difference is that, output
settings are removed because it always returns a single modification key.
There are predefined settings for Share-it, RegNow, SWREG, FastSpring, Avangate
and PayPro which can be loaded on the bottom of window.
65
After an auto generation setting is created, the required URL to be used to post
values are displayed with Display Key Generation URL. A template selections is
made and URL is displayed in a dialog as in the screenshot below.
Display HTML Form Code menu item displays an HTML form source code for
automatic modification key generation with an HTTP form post. The window is same
as in license generation.
66
Customer List
Customer list is displayed for each product when View Customer List menu item is
run. E-mail address is the unique identifier for customers; so a customer line is
displayed on table for each different e-mail address. Following is a sample
screenshot for customer list.
From the actions menu or context menu, customer and license details can be
displayed; also list can be exported to a CSV or Excel file.
67
All database connections are displayed on list; when any connection is selected
details are displayed on the right. Connection to selected database is only changed
when Connect button is used.
If database server supports secure connection, SSL connection is possible if Use SSL
checkbox is selected.
When Create Database checkbox is selected and defined database name does not
exists on server then it is created. If defined database is already exists, then an
error message displayed and existing database is used.
68
Online.License4J Settings
Online.License4J login and logout is controlled with Work Online and Work Offline
menu items.
69
Account Information
Account information window displays information about current connected account,
and password can be changed by clicking on Change Password button.
70
Log Viewer
Log viewer is available only when connected to Online.License4J, and it displays
create, edit, and delete actions performed by current connected user.
71
Hardware ID Use
License Manager supports hardware ID generation from hostname, Ethernet MAC
address, disk volume serial number and disk manufacturer serial number. Any
single hardware ID or all of them can be used in hardware validation.
Version 4.4.0+ supports custom hardware IDs generated by developers. Any string
can be used as a custom hardware ID, so it is possible to use practically anything as
a hardware ID.
72
both of hardware IDs should pass the check for hardware ID validation success. OR
(||) combination checks succeed if any of the hardware ID validates.
73
74
License Action Notifications tab as in the screenshot below is used to define actions
for which to send e-mails. Server admin notification e-mails are sent to defined email addresses on first tab as From Address. They are used as server
administrators. User notification e-mails are sent to user e-mail address in license.
If an e-mail address is not defined in license, user e-mails cannot be sent.
User notifications for some cases are also not possible when license string sent by
runtime library cannot be found on license server database.
75
Only one license expire notification is sent for each license if notifications enabled.
Notifications are sent either after license or maintenance expired or defined days
left to expiration. More than one value can be defined for Days to License Expire
fields; numbers should be separated with semicolon. e.g. if defined values are
1,7,14 then expire notifications are sent before 14 days, 7 days and 1 day of
expiration date.
76
There are default user notification e-mail templates available on database; they can
be edited in e-mail template editor. Combo box lists all actions to edit. Some strings
between curly braces are replaced with values from license and product.
77
String between curly braces below are replaced by server while sending e-mails.
{Server-Admins}
{Request-ResultMessage}
{Request-FromIP}
{Request-FromHostName}
{Request-FromOS}
{Product-ID}
{Product-Name}
{Product-Version}
{Product-Edition}
{License-ID}
{License-LicenseString}
{Activation-TotalCount}
{Activation-AllowedCount}
{Deactivation-AllowedCount}
{Deactivation-TotalCount}
Deactivation count.
{License-ValidityExpiration}
{License-MaintenanceExpiration}
{License-Quantity}
License quantity.
78
{License-HardwareID}
{Activation-ID}
{Activation-LicenseString}
{Activation-HostName}
{Activation-FromIP}
{Activation-HardwareID}
{Activation-ValidityExpiration}
{ModificationKey-ID}
Expiration date for activation (if set activated license text generation
time to activation time is selected for license).
Maintenance expiration date for activation (if set activated license text
generation time to activation time is selected for license).
Unique modification key ID.
{ModificationKey-LicenseString}
{ModificationKey-DedicatedLicenseID}
{ModificationKey-AllowedUsageCount}
{User-FullName}
{User-EMail}
{User-RegisteredTo}
{User-Company}
{User-Telephone}
{User-City}
{Activation-MaintenanceExpiration}
Tools menu has another Log Viewer for License4J Auto License Generation and
Activation
Server
and
it
displays
all
successful
or
failed
license
generation/activations requests.
validation
and
activation
methods
returns
ValidationStatus
Defined constants and required conditions are listed below.
LICENSE_VALID
79
ValidationStatus
and
Applicable to all license types, and only obtained when license is valid.
LICENSE_INVALID
Applicable to all license types, and obtained when license is invalid or license
generation time is set to a future time.
LICENSE_EXPIRED
Applicable to license text, floating license text and online basic key floating
over internet. It is obtained when license validity period is over.
LICENSE_MAINTENANCE_EXPIRED
Applicable to license text, floating license text, and online basic key floating
over internet. It is obtained when license maintenance period is over and
current product release date is specified in validate method.
MISMATCH_PRODUCT_ID
Applicable to license text, floating license text, and online basic key floating
over internet. It is obtained when given product id in validate method does
not match the product id defined in license.
MISMATCH_PRODUCT_EDITION
Applicable to license text, floating license text, and online basic key floating
over internet. It is obtained when given product edition in validate method
does not match the product edition defined in license. If a product edition is
not defined in license, it will never obtained.
MISMATCH_PRODUCT_VERSION
Applicable to license text, floating license text, and online basic key floating
over internet. It is obtained when given product version in validate method
does not match the product version defined in license. If a product version is
not defined in license, it will never obtained.
80
MISMATCH_HARDWARE_ID
Applicable to license text only, and it is obtained when computer hardware id
does not match the hardware id defined in license.
FLOATING_LICENSE_SERVER_NOT_AVAILABLE
Applicable to floating license text and online basic key floating over internet.
It is obtained when validate method cannot connect to defined Floating
License Server or Auto License Generation and Activation Server.
FLOATING_LICENSE_NOT_FOUND
Applicable to floating license text and online basic key floating over internet.
It is obtained when requested license is not found in Floating License Server
or Auto License Generation and Activation Server. License is queried with
license id, product edition and product version parameters given to validate
method.
FLOATING_LICENSE_NOT_AVAILABLE_ALL_IN_USE
Applicable to floating license text and online basic key floating over internet.
It is obtained when maximum allowed usage count is reached for the license.
FLOATING_LICENSE_ALLOWED_USE_COUNT_REACHED
Applicable to only online basic key floating over internet. It is obtained when
maximum allowed use count is reached for the license.
FLOATING_LICENSE_ALLOWED_USE_TIME_REACHED
Applicable to only online basic key floating over internet. It is obtained when
maximum allowed usage time duration is reached for the license.
FLOATING_LICENSE_CLIENT_REJECTED:
Applicable to only floating license text; it is obtained when client rejected in
Floating License Server Administration GUI. See floating license server user
guide for help on client reject feature.
81
INCORRECT_SYSTEM_TIME
Applicable to license text, floating license text, and online basic key floating
over internet. It is obtained when online date/time check feature is enabled
for the license and computer time is at least 24 hours different from obtained
online time.
VALIDATION_REJECTED_IP_BLOCK_RESTRICTION,
Applicable to online basic key floating over internet. It is obtained when IP
block restrictions are defined and license requesters IP is not in allowed IP
block.
VALIDATION_REJECTED_FEATURE_DISABLED
Applicable to online basic key floating over internet. It is obtained when
validation is disabled in License Manager.
ActivationStatus
Defined constants and required conditions are listed below.
ACTIVATION_SERVER_CONNECTION_ERROR
Obtained when client cannot connect to either Online.License4J or Auto
License Generation and Activation Server.
LICENSE_NOT_FOUND_ON_ACTIVATION_SERVER
Obtained
when
license
to
be
activated
cannot
be
found
on
either
ALREADY_ACTIVATED_ON_ANOTHER_COMPUTER
Obtained when license has single activation permission and already activated
on another computer.
MULTIPLE_ACTIVATION_LIMIT_REACHED
82
Obtained when license has multiple activation permission and all are
activated.
MULTIPLE_DEACTIVATION_LIMIT_REACHED
Obtained when license has defined maximum allowed deactivation count is
reached.
ACTIVATION_COMPLETED
Obtained when license is successfully activated.
ACTIVATION_REQUIRED
Obtained before activation performed, used to test whether license requires
activation or not.
ACTIVATION_NOT_REQUIRED
Obtained before activation performed, used to test whether license requires
activation or not.
ACTIVATION_HARDWAREID_ERROR
Obtained when required hardware ID(s) cannot be generated. Required
hardware ID(s) with OR or AND operands are defined during license
generation; if AND operand is selected and at least one of the selected
hardware IDs cannot be generated this hardware ID error returns. Obtained
also if single hardware ID is required for activation and it cannot be
generated.
ACTIVATION_REJECTED_IP_BLOCK_RESTRICTION
Obtained when IP block restriction exists and client IP is now an allowed IP.
ACTIVATION_REJECTED_FEATURE_DISABLED
Obtained when activation is temporarily or permanently disabled in License
Manager GUI.
83
ACTIVATION_NOT_FOUND_ON_SERVER
Obtained when deactivation request is sent to server but activation is not
found.
DEACTIVATION_COMPLETED
Obtained when the license is successfully deactivated.
ModificationStatus
Defined constants and required conditions are listed below.
MODIFICATION_COMPLETED
Obtained when license is successfully modified.
MODIFICATION_COMPLETED_PREVIOUSLY
Obtained when license is already modified, but calling client does not have
latest license. Latest activated license returns to be saved.
MODIFICATION_KEY_INVALID
Obtained when given modification key is invalid. This status is deprecated
because beginning with version 4.4.0, key validation is not performed within
runtime library; it is directly sent to server.
SERVER_CONNECTION_ERROR
Obtained when runtime library cannot connect to defined server for license
modification.
MODIFICATION_KEY_USED_FOR_ANOTHER_LICENSE
Obtained when modification key quantity is 1 and it is already used to modify
another license.
MODIFICATION_KEY_NOT_FOUND_ON_SERVER
84
Obtained when given modification key is valid but it is not found on server. It
was deleted by server/license administrator.
MODIFICATION_KEY_USAGE_LIMIT_REACHED
Obtained when modification key quantity is more than 1, and all is used to
modify other licenses.
MODIFICATION_REJECTED_IP_BLOCK_RESTRICTION
Obtained when IP block restriction exists and client IP is now an allowed IP.
MODIFICATION_REJECTED_FEATURE_DISABLED
Obtained when modification is temporarily or permanently disabled in License
Manager GUI.
ACTIVATION_NOT_FOUND_ON_SERVER
Obtained when received activated license to be modified is not found on
server. It was deleted by server/license administrator.
MODIFICATION_STATUS_UNKNOWN
Modification status unknown; because either license is invalid or not
activated.
MODIFICATION_NOT_SUPPORTED
Modification is not supported, if activation return type is an activation code.
MODIFICATION_REJECTED_FOR_LICENSE
Obtained when modification is not allowed for the given license.
MODIFICATION_KEY_DEDICATED_FOR_ANOTHER_LICENSE
If given modification key is dedicated to a single license, and given license
mismatch this modification status is returned.
85
new
methods
in
runtime
library:
LicenseValidator.easyValidate
and
LicenseValidator.easyValidateOnStartup
license string to validate and the second is an encrypted string which includes all
parameters including license activation server if activation is enabled. This
encrypted string is generated by License Manager GUI only. To get easyValidate
86
ecrypted string which includes all required parameters for license validation and
activation if enabled.
easyValidate should be called after asking user for the license. It validates given
license and if enabled auto activates license. Finally it saves license in an encrypted
file in users home folder. The license file name is license. A directory is created by
using product name and license file is saved. easyValidateOnStartup method should
be used in software product main method. It reads license file on disk and
validates; it should be called on each software startup.
License file path should be carefully selected; it can be defined as a Java system
property if needed. easyValidate method reads a Java system property when called
to check for any custom license file path. The property name is flfp (full license file
path). It can be set with the following code.
System.setProperty("flfp", System.getProperty("user.home") + / + myLicenseFile.lic);
If a custom license file is defined with system property, it should be checked for
access permissions. If file cannot be accessed or modified, it will print an error
message. (e.g. on Windows systems, usually programs runs with standard user
privileges. If you try to save license file in Program Files folder (installation path), it
may not create/modify file.)
87
88
validation are the customer name and company name, which are defined during
license generation, but they should be included in key validation only if specified
during license generation.
If
custom
hardware
ID
is
used
while
generating
license,
As all validation methods, it returns a License object and it has the ValidationStatus
enumeration. Validation status can be checked with a switch statement.
switch (license.getValidationStatus()) {
case LICENSE_VALID:
// TODO
break;
case LICENSE_INVALID:
// TODO
break;
case MISMATCH_HARDWARE_ID:
// TODO
break;
case INCORRECT_SYSTEM_TIME:
// TODO
break;
}
89
Same License object returns after validation like in license key validation, and it has
ValidationStatus enumeration with validation results.
90
productEdition,
currentProductVersion,
currentDate,
currentProductReleaseDate,
serverHostname,
portNumber,
licenseValidHandler,
licenseInvalidHandler,
serverConnectionErrorHandler);
Product ID, edition and version are used to query for the license on floating license
server. Product ID must be defined, edition and version are optional.
After a valid license is obtained from floating license server, validate method starts
a thread to check license validity and inform server that leased license is still in use.
Valid license handler is run when obtained license is valid. Invalid handler is run
when obtained license is invalid due to e.g. expired. Server connection error handler
is run when client cannot connect to floating license server. These error handlers
are optional but they may be useful to force license usage policy. Basic default
handlers are available in Runtime Library and also interface classes is available and
can be used to implement custom handlers to manage license.
The method below is available in version 4.4.1 and later. It is simplified and a new
FloatingLicenseCheckTimerHandler is added. The advantage is over the other validate
method is that, new handler has License object; to get license object getLicense() can
be used. So it is possible to get updated license object and display to user.
LicenseValidator.validateFloatingLicenseText(
publickey,
91
productID,
productEdition,
productVersion,
serverAddress,
floatingLicenseCheckTimerHandler);
Another advantage is that more than one floating license server address can be
defined as floating license server; server addresses must be separated with
semicolon. e.g. MyFirstServer:16090;MySecondServer:16090
A handler class extending FloatingLicenseCheckTimerHandler must be created; an
example is given below. run() method of handler class is called at each timer run.
NOTE: License Server Connection Check Period value is not used in
validateFloatingLicenseText method, only license check period is used to
run a timer task.
Version 4.4.3+ includes a new method with an extra argument to send some
information about client to the server.
LicenseValidator.validateFloatingLicenseText(
publickey,
productID,
productEdition,
productVersion,
serverAddress,
floatingLicenseCheckTimerHandler,
additionalInfo);
92
93
If concurrent custom feature usage is enabled by defining quantity value for any
custom
feature,
it
must
be
checked
out
LicenseValidator.checkoutFloatingLicenseTextCustomFeature(String
licenseObject,
String
floatingLicenseServer)
then
it
with
featureName,
is
method
License
verified
by
with
LicenseValidator.releaseFloatingLicenseTextCustomFeature((String
featureName,
serverAddress,
94
onlineLicenseKeyCheckTimerHandler);
Validation status constants are same with any license text and floating license text.
Online license key has a new feature beginning with version 4.3. Key usage limit
can be defined, and users can use the key for only defined number of times so the
software product. Obtained license object has two additional values for key use
count if defined during license key generation. getUseCountAllowed() method returns
maximum allowed use count value; getUseCountCurrent() method returns current use
count. getUseTimeCurrent() and getUseTimeLimitAllowed() methods return current
usage time duration and maximum allowed time duration if enabled when
generating license.
Note: Both Floating License Text and Online License Key Floating Over Internet
must be validated once in a single JVM run because each license validation starts
timer tasks at the background to ping and check floating license servers. If more
than one call to validate occurs there will be unnecessary timer tasks running at the
background and usage information will be incorrect on server. If It is needed to
revalidate
floating
license
stopFloatingLicenseCheckTimers()
without
method
shutting
found
in
down
License
JVM,
object
first
to
stop
call
all
The method below is available in version 4.4.1 and later. It is simplified and a new
FloatingLicenseCheckTimerHandler is added. The advantage is over the other validate
method is that, new handler has License object; to get license object getLicense() can
be used. So it is possible to get updated license object and display to user.
95
LicenseValidator.validateOnlineLicenseKey (
key,
publickey,
productID,
productEdition,
productVersion,
serverHostname,
floatingLicenseCheckTimerHandler);
Another advantage is that more than one license server address can be defined be
separated with semicolon. e.g. http://MyFirstServer:8080;http://MySecondServer
96
method activates given license and modify given user information on server. There
are autoActivateWithCustomHardwareID methods for each defined method parameters
above; it is used to activate license with a custom hardware ID.
97
For the Auto License Generation and Activation Server, activation server URL
is http://yourserver.domain.com/algas/autoactivate or same URL starting with
HTTPS if your server has an SSL certificate installed.
98
HTTP(S) POST to license server. If there is a firewall or proxy software to access the
Internet, and it only allows some user agent strings which are popular web
browsers, then runtime library user-agent can be set to any string to access the
Internet. Runtime library gets a Java system variable named with name license4juser-agent, if it is defined the value of this Java system variable is used before
send HTTP(S) requests.
returns an encrypted string including license string and computer hardware IDs.
This activation request string can be displayed to users for manual activation
on https://online.license4j.com/d/manualactivation for Online.License4J system and
on http://YourServerAddress/algas/manualactivation for Auto License Generation and
Activation Server if manual activation role is enabled.
99
When a user paste and submit the form, he/she will get activated license text or
activation code based on selection during license generation.
If enabled, manual license activation will be allowed, but you should make a form
for your customers to submit activation request. Form should be submitted
to http://YourServerName/algas/manualactivate and should include a hidden value
with name action and value activate; and license activation request string in an
input area with name linfo. A sample form is given below.
methods.
First method can be used to generate manual activation request string if a custom
hardware ID is used. The second method use a custom hardware ID and user
information to modify while activating license. Another method to generate manual
activation request string with user information to modify while activating is
getManualActivationRequestStringWithUserInformation.
The
method
returns
License
object,
and
ActivationStatus
is
100
returns an encrypted string including license string and some hash codes. This
deactivation request string can be displayed to users for manual activation
on https://online.license4j.com/d/manualdeactivation for Online.License4J system and
on http://YourServerAddress/algas/manualdeactivation for Auto License Generation and
Activation Server if manual activation role is enabled.
If enabled, manual license deactivation will be allowed, but you should make a form
for your customers to submit deactivation request to your Auto License Generation
and
Activation
Server.
Form
should
be
submitted
<form action=http://YourServerName/algas/manualdeactivate
method=post>
<textarea name=linfo></textarea>
<input type=hidden name=action value=mdeactivate>
<input type=submit value=submit>
</form>
101
returns an encrypted string including license string and some hash codes. This
modification request string can be displayed to users for manual modification
on https://online.license4j.com/d/manualmodification for Online.License4J system and
on http://YourServerAddress/algas/manualmodification for Auto License Generation and
Activation Server if manual modification role is enabled.
If enabled, manual license modification will be allowed, but you should make a form
for your customers to submit modification request to your Auto License Generation
and
Activation
Server.
Form
should
be
submitted
102
int i = LicenseValidator.checkOnlineAvailability(
publicKeyString,
licenseObject,
serverAddr,
connectionTimeout);
method in License object connects to given server and checks for new update
version. It returns new (the latest available) version number as double. So that you
can display a notification window to user.
103
licenseServer);
method in License object connects to given server and checks for update notification
message for the given version number. It returns message as a string. So that you
can display a notification window to user.
method in License object connects to given server and checks for license messages
added to the license. It returns array of string including messages.
License Modification
The method below is used to modify a license. Given license activation status must
be ACTIVATION_COMPLETED.
LicenseValidator.modifyLicense(
license,
serverAddr,
modificationKey);
resulting
license
object
has
method
named
as
104
Updated values are displayed on License Manager GUI license table (if enabled at
header right click pop up menu).
Following method query license server for values given in hash map.
LicenseValidator.queryLicenseUseTrackingInfo (
publickey,
license,
hashmap,
timeoutValue);
105
Hash map is updated with the values obtained from server. It some of the given
keys in hash map does not exist on the server, then it returns null values for them.
Following code block sends 2 values in a hash map to server for the validated
license.
HashMap<String, String> map = new HashMap<String, String>();
map.put(some-key, some information);
map.put(another-key, another information);
LicenseValidator.updateLicenseUseTrackingInfo (
publickey,
license,
map,
timeoutValue);
Following code block queries information from server for the keys given in hash
map. Previously, null can be defined for the key values; after method successfully
return, values will be updated.
HashMap<String, String> map = new HashMap<String, String>();
map.put(some-key, null);
map.put(another-key, null
LicenseValidator.queryLicenseUseTrackingInfo (
publickey,
license,
map,
timeoutValue);
System.out.println(map);
106
@Override
public void checkClientTrusted(X509Certificate[] certs, String authType) {
}
@Override
public void checkServerTrusted(X509Certificate[] certs, String authType) {
}
107
}
};
// Create all-trusting host name verifier
HostnameVerifier allHostsValid = new HostnameVerifier() {
@Override
public boolean verify(String hostname, SSLSession session) {
return true;
}
};
try {
// Install the all-trusting trust manager
SSLContext sc = SSLContext.getInstance("SSL");
sc.init(null, trustAllCerts, new java.security.SecureRandom());
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
// Install the all-trusting host verifier
HttpsURLConnection.setDefaultHostnameVerifier(allHostsValid);
} catch (Exception ex) {
ex.printStackTrace();
}
108
LicenseKeyPair.KEYPAIR_ALGORITHM_RSA,
LicenseKeyPair.SIGNATURE_ALGORITHM_SHA512withRSA,
LicenseKeyPair.KEYSIZE_1024);
Key pair and signature algorithms are defined as static variables in LicenseKeyPair.
Generate License:
String licenseString = LicenseManager.generateLicenseText(keypair, licenseText);
After this three step, you will have a license string, copy it in a file and send to your
customer. License4J package also includes a small utility for reading and writing to
text files, you can write your license string to a file as below.
FileUtils.writeFile("c:\\license.txt", licenseString);
License4J Development library requires a valid license and it must set as java
system properties in source code. If License Manager GUI is run same computer,
this code can be obtained with Display Activated License button in License4J
license window in Help menu item.
If License Manager GUI is not used on computer, development library can be used
to activate the license. To install and activate the license you have to use
109
This command connects to Online.License4J and activates trial license for running
computer, and it returns license key and activated license text.
After getting your license text you have to set Java system variables which
development library checks for. The license key below is the trial license.
These properties should be set before generating license string. Finally, a complete
running example is given below.
110
If you want to use trial period for testing, click on Request Trial License button to
get your trial license and Online.License4J account online. If you do not have
internet connection contact us.
Trial period has one restriction. All licenses are created for name LICENSE4J Trial.
111
Trial request window asks for name and e-mail address for Online.License4J account
creation, your e-mail will be used as username. Trial license will be activated with
your hardware id.
After trial license is activated, licensing window will display license details.
112
When you purchase License4J License Manager, you will have a license key sent by
payment processor. Click on Change Product Key button to enter your license key.
After license key validation you have to activate your copy of License Manager
within 30 days.
When a maintenance license is purchased, you will get a modification key which you
should enter with Enter Modification Key button. It will extend maintenance period
for 1 year.
Activated license text and code to use in Development Library is displayed with
Display Activated License button.
113
On Linux and Mac OS log file is saved in the current path which License Manager
GUI is running.
114
End of document.
115