Getting Started Guide

Cryptolens is a powerful platform that accommodates many different use cases, application types, licensing models, and additional licensing features.

Here are all of the steps you need to take to implement a basic software licensing system:

  1. Create a product and license key in our dashboard
  2. Get our Client API
  3. Paste the key verification code snippet into your code
    1. Find your RSA Public Key and paste it into the code snippet
    2. Find your Access Token and paste it into the code snippet
    3. Find your Product ID and paste it into the code snippet
    4. Paste a license key string into the code snippet (for testing purposes only)
  4. Run the application and see if it returns that the license key is valid

After license key verification is set up in your code, you can customize the licensing system to suit your unique use case using our detailed guides.

Dashboard Overview

1. Creating a product and license key

You first need to create a product using our dashboard. Each product gets its own product ID which is displayed on the product page, and this is important for a later step. You can keep all of the default values when creating your first product.

After you have created a product, you can start to create license keys for that specific product. As you can see, a license key in Cryptolens consists of a 20-character-long identifier that you then can distribute out to customers. All default values can be kept when creating your first license key, but this is where you would later specify the characteristics of the license key, such as the expiry date.

Code Implementation

2. Getting our Client SDK

Web API is a channel that can be used to talk to Cryptolens from external applications. It contains a wide range of methods that will respond to different information depending on input parameters. For example, these methods allow you to activate keys, generate new ones, get a list of activated machines, and so much more. It’s always possible to talk to the Web API directly, however, you will most likely use an existing SDK that simplifies that task.

You can find information about how to download our SDKs in your programming language here.

3. Adding a code snippet to your code

After you have installed our Client API, the next step is to paste a code snippet into your own product. This is the code that we will modify slightly in later steps. You can find code examples in your programming language here. We also have YouTube videos featuring how to set up key verifications in different languages.

After pasting the key verification code snippet into your own code, there are three parameters that you need to replace:

  • Your RSA Public Key
  • Your Access Token (called token or auth in code examples)
  • Your Product ID

3.1 Finding the RSA Public Key

Navigate to the bottom of this page to find your RSA Public Key. If you are logged in, you can view it below:

Please log in to view your RSA Public key here. Click here to view it.

You can now replace the RSA Public Key in the key verification code snippet with your own.

3.2 Finding the Access Token

For testing purposes, you can use the Access Token that is listed at the bottom of this page. If you are logged in, it will also show up below:

Please log in to view your access token here. Click here to view it.

However, when you begin to sell your product, we recommend that you create your own Access Tokens with the correct permissions for your unique use case. You can create access tokens here.

Regardless if you use the pre-made Access Token or create your own, you need to paste your Access Token into the key verification code snippet in your product.

3.3 Finding the Product ID

One of the first steps in this guide was to create a product and license key in our dashboard. You can now copy the Product ID from the product page and paste it into the key verification code snippet.

Testing the Licensing System

3.4 Pasting the License Key (for testing purposes only)

Now that you have specified your unique RSA Public Key, Access Token, and Product ID, you can start to test the licensing system.

In production, you need to have a way for the customer to provide their license key, and that value should be pasted in the license key parameter. For testing purposes, you can simply copy the license key string that you created in our dashboard earlier and paste it into the license key field in the code snippet. The code will now check if that specific license key is valid.

Many of our code examples include a call to IsOnRightMachine method. If you created a license key without changing any of the properties, please remove this check. For this check to work, the maximum number of machines property needs to be set to a value greater than 0.

4. Testing the Licensing System

After doing the changes we listed above, the key verification code should now work if you run the code. The code should return a message saying that the license key is valid. Relevant information such as the status of certain feature flags can also be displayed, and you can now program your code to act the way you want it to based on the status of the license key.

Customization Options

You have now set up a very basic software licensing system! There are several ways to change the setup to accommodate your unique requirements. Here are guides you can use as the next step so that your licensing system works the way you want it to:

  1. Licensing Models
    1. Subscriptions
    2. Pay per Use (usage-based licensing)
    3. Node-Locking
    4. Floating Licenses
    5. SDK Licensing
    6. Account-Based Licensing
  2. Offline Licensing (License Server)
  3. Setting up Payments
  4. Automation with Zapier
  5. Integrations
  6. Additional Features