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:

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.

Setting things up

1

Creating a new 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.

2

Getting our client SDK/library

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

Testing

1

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.

2

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.

Possible customizations

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

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:

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.

Setting things up

1

Creating a new 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.

2

Getting our client SDK/library

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

Testing

1

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.

2

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.

Possible customizations

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