Release notes for v4014
Add support for a license server
We added support for local license server that re-routes requests to Cryptolens. You can read more about it here.
Assuming your license server runs on localhost with port 8080 (default), you can access it by adding LicenseServerUrl
as shown below:
var licenseKey = "GEBNC-WZZJD-VJIHG-GCMVD";
var RSAPubKey = "{enter the RSA Public key here}";
var auth = "{access token with permission to access the activate method}";
var result = Key.Activate(token: auth, parameters: new ActivateModel()
{
Key = licenseKey,
ProductId = 3349,
Sign = true,
MachineCode = Helpers.GetMachineCode()
LicenseServerUrl = "http://localhost:8080/" // <- add this line
});
if (result == null || result.Result == ResultType.Error ||
!result.LicenseKey.HasValidSignature(RSAPubKey).IsValid())
{
// an error occurred or the key is invalid or it cannot be activated
// (eg. the limit of activated devices was achieved)
Console.WriteLine("The license does not work.");
}
else
{
// everything went fine if we are here!
Console.WriteLine("The license is valid!");
}
Console.ReadLine();
This works for all models, so you can do the same with eg. Deactivate.