Idea
In order to ensure that a license key is not used on more machines than the user is entitled to, machine code locking (aka node-locked licenses) can be used. Here are some example cases:- your customer bought 1 license that should only work on two computers, their work and home computer
- all employees of your customer should have access to your software, as long as they are working on-site.
Implementation
In the dashboard
Node-locking is enforced by setting maximum number of machines to a value greater than 0. This can be done when creating a new or by modifying an existing license. Once set, each time a key verification request is performed, Cryptolens will ensure that the number of machines that have activated the license does not exceed the value that you have specified.Code
In order to get node-locking to work, you can use the same code that was shown in the key verification tutorial. For additional security, we should add a check as shown below: In C#MachineCode = Helpers.GetMachineCode()
, we need another way of identifying unique machine codes. In this case, we need to ensure every device in the on-site generates the same machine code. This could, for example, be the network name, IP address, etc.
Related articles
- User based activations - activating on a per user user rather than per machine basis.