Watch the Video
Introduction
In this article, we will explain how to add the licensing capability to your application code. We appreciate there are many different ways to do this and many IDEs, we are picking to show Windows below but of course, we work with all major OS and IDEs available.
Zentitle supports many popular programming languages. You use the same basic process for any platform you happen to be using and you will find an example project for a range of languages C, C++, JAVA, VB and more in the "Application Integration" section of the documentation.
If you don't see what you need just contact us at https://support.nalpeiron.com (login required).
How Zentitle Licensing Works
The way Zentitle licensing works is to triangulate between your code, our library, and our licensing cloud. In order to connect your application to our infrastructure, all you have to do is add one of our code projects to your application and make a call to our library.
The key connection between everything is your CustomerID and your ProductID.
These unique Zentitle generated numbers are encrypted within the Zentitle license codes we generate on your behalf, the library you generated in the previous step, and finally your own application code. This "triangulation" of the same values enables the security to link the components.
All of the infrastructure is set up and managed for you by Nalpeiron, so once you connect to it using the calls to the library we handle all the rest for you.
Integrating With Your Application Code
To use Zentitle Licensing, all you need to do is "call" our library (DLL/Dylib) from your application. In our example code projects, you can see how we achieve this or even just use our sample code within your own application with the changes below.
To get started will need the CustomerID and ProductID you were sent when you signed up for a trial. You can also find these on the Configure page on the Zentitle dashboard (Wrench icon->Configure.)
Note the use of the ProductID: With the ProductID you only input the last 5 digits, excluding leading zeros, into your code i.e. 6563300100 becomes 100 and 1234567890 becomes 67890.
The basic concept
Simply edit 2 variables (CustomerID and ProductID) which will be available to your application Load event and set them to the values for your NSA/NSL product in your code.
Then edit the values for the "security constants" (these are the three values you will have set when creating the library).
This basic concept is the same when editing any sample project (or your own code) no matter if it's for a Windows, Mac, Linux, ARM, or Android (JAVA) application.
How to integrate an application using C# as an example
Please note there are many examples of how to code for non-Windows environments found in the "Application Integration" section of the documentation.
Edit the Visual Studio Example Project Solution (ShaferExample.sln) on your Test Client Machine having downloaded it from the example application page.
Edit the ShaferExample.cs file in the solution or the other code examples with your editor.
Change the following values to the Customer/Product IDs you noted from your own library you created earlier.
Then edit the values for the "security constants" to match your library values.
public partial class ShaferExample: Form
{
Shafer oShafer = new Shafer();
int ShaferError = 0;
string Username = "";
int CustomerID = 3183; //**** REPLACE WITH YOUR CUSTOMERID
int ProductID = 100; //**** REPLACE WITH YOUR PRODUCTID
UInt32 SecurityConstantX = 100; //**** REPLACE WITH YOUR Security Constant X
UInt32 SecurityConstantY = 600; //**** REPLACE WITH YOUR Security Constant Y
UInt32 SecurityConstantZ = 400; //**** REPLACE WITH YOUR Security Constant Z
Simply replace the example placeholders with your own values - Remember that the ProductID is only 5 digits, not the whole number.
Save the project.
As you can see from the code example above it's a simple and quick procedure to change the values to your own.
Remember that the ProductID is only 5 digits, not the whole number, excluding leading zeros, into your code i.e. 6563300100 becomes 100 and 1234567890 becomes 67890.
All that's required in your own application is to call the form load event etc. We show this within the various example code projects to save you time and effort. Each sample code project has a variation on this theme, but now you understand the fundamentals you should be able to code any application to enable license management.