To implement a simple license key generator, you can use the following:
In the following example, you can see how a simple license key generator can be implemented in PHP:
To understand more about the basic concept, see the following:
In this example, the PHP license key generation environment includes the class
cbNotification to easily extract information from the XML notification.
PHP offers a simple way to handle the XML document used in key generation. PHP versions 5 and above also include XPATHing based on the following:
By default, XML Processing with ASP.NET does not accept FORM data that contains HTML/XML tags. This causes an error message when we call your ASP.NET license key generator with our XML data. This applies to ASP.NET versions 1.1 and above.
You can find additional information on this topic at:
To circumvent this problem, add the following line to your ASP.NET script:
<%@ Page validateRequest="false" %>
You can offer licenses in the following ways:
To designate a license as a text license, the license key generator has to set the HTTP header
text/plain. The cleverbridge system includes the license information in the order confirmation pageThe confirmation page is displayed after a customer makes a purchase. The confirmation page contains the order confirmation and delivery information. and the confirmation email sent to the customer.
A license key generator can create a license that the customer must download as a file. A license file is triggered by any HTTP
Content-Type other than
text/plain. To ensure that a download process is initiated when the customer clicks the license, we recommend a
When returning a file license, the license key generator also returns the file name of the license in the HTTP header. This is done with the HTTP header
Use the following format for the
<filename> with the file name you want to use. The file name can only contain alphanumeric characters (no umlauts) and the following special characters:
. _ -
The maximum file size for file licenses is 100 Kb. If you require a bigger file license response, contact Client Experience.
If you need to provide instructions with your license key, you have two options:
Return Instructions as Part of License:
Because cleverbridge forwards the license information to the customer, you can also simply return these instructions as part of the license. A drawback to this approach is that the key cannot be used later for additional processing by cleverbridge (for example, printing it on a backup CD/DVD).
Define a Template:
Enter the instructions in a template. For more information, see Define a License Key Template.
cleverbridge considers any content that is returned with a HTTP response code
200 to be a valid license key. If you have technical problems when generating the license key, you should provide a response code in the
500 range. If cleverbridge receives a response code in this range, we will inform the customer that the completion of the transaction will be delayed. After that, we will initiate a retry once the license key generation issue has been resolved.
There are two ways to secure your license key generator:
cleverbridge recommends that you protect your license key generator URL with a username and password. If you choose this method, you must specify this information when you configure your license key generator in the Commerce Assistant. For more information, see Add a License Key Generator in the Commerce Assistant.
cleverbridge does not recommend protecting your license key generator by restricting IP addresses. This only offers limited security and can create problems when requested changes cannot be completed in time. However, you can limit the IP range from which your license key generator can be accessed. cleverbridge accesses from the network
89.1.11.xxx. This IP range is subject to change, but we will alert you in advance of any alterations.