Welcome to cryptolens python’s documentation!

class licensing.methods.Key[source]

License key related methods. More docs: https://app.cryptolens.io/docs/api/v3/Key.

static activate(token, rsa_pub_key, product_id, key, machine_code, fields_to_return=0, metadata=False, floating_time_interval=0, max_overdraft=0, friendly_name=None)[source]

Calls the Activate method in Web API 3 and returns a tuple containing (LicenseKey, Message). If an error occurs, LicenseKey will be None. If everything went well, no message will be returned.

More docs: https://app.cryptolens.io/docs/api/v3/Activate

block_key(product_id, key)[source]

This method will block a specific license key to ensure that it will no longer be possible to activate it. Note, it will still be possible to access the license key using the GetKey method. To do the reverse, you can use the Unblock Key method.

More docs: https://app.cryptolens.io/docs/api/v3/BlockKey

static create_key(token, product_id, period=0, f1=False, f2=False, f3=False, f4=False, f5=False, f6=False, f7=False, f8=False, notes='', block=False, customer_id=0, new_customer=False, add_or_use_existing_customer=False, trial_activation=False, max_no_of_machines=0, no_of_keys=1, name=None, email=None, company_name=None, enable_customer_association=False, allow_activation_management=False)[source]

This method allows you to create a new license key. The license can either be standalone or associated to a specific customer. It is also possible to add a new customer and associate it with the newly created license using NewCustomer parameter. If you would like to avoid duplicates based on the email, you can use the AddOrUseExistingCustomer parameter.

The parameters “name”, “email”, “company_name”, “enable_customer_association” and “allow_activation_management” are used to create a new customer (or update an existing one) and automatically associate it with the newly created license. Please note that you need to use an access token with both “CreateKey” and “AddCustomer” permissions. Moreover, either the parameter “new_customer” or “add_or_use_existing_customer” need to be set to True.

More docs: https://app.cryptolens.io/docs/api/v3/CreateKey/

static create_trial_key(token, product_id, machine_code)[source]

Calls the CreateTrialKey method in Web API 3 and returns a tuple containing (LicenseKeyString, Message). If an error occurs, LicenseKeyString will be None. If everything went well, no message will be returned.

More docs: https://app.cryptolens.io/docs/api/v3/CreateTrialKey

static deactivate(token, product_id, key, machine_code, floating=False)[source]

Calls the Deactivate method in Web API 3 and returns a tuple containing (Success, Message). If an error occurs, Success will be False. If everything went well, Sucess is true and no message will be returned.

More docs: https://app.cryptolens.io/docs/api/v3/Deactivate

static extend_license(token, product_id, key, no_of_days)[source]

This method will extend a license by a certain amount of days. If the key algorithm in the product is SKGL, the key string will be changed if necessary. Otherwise, if SKM15 is used, the key will stay the same. More about the way this method works in Remarks.

More docs: https://app.cryptolens.io/docs/api/v3/ExtendLicense

static get_key(token, rsa_pub_key, product_id, key, fields_to_return=0, metadata=False, floating_time_interval=0)[source]

Calls the GetKey method in Web API 3 and returns a tuple containing (LicenseKey, Message). If an error occurs, LicenseKey will be None. If everything went well, no message will be returned.

More docs: https://app.cryptolens.io/docs/api/v3/GetKey

static unblock_key(token, product_id, key)[source]

This method will unblock a specific license key to ensure that it can be accessed by the Key.Activate method. To do the reverse, you can use the BlockKey method.

More docs: https://app.cryptolens.io/docs/api/v3/UnblockKey

class licensing.methods.AI[source]
static get_web_api_log(token, product_id=0, key='', machine_code='', friendly_name='', limit=10, starting_after=0, ending_before=0, order_by='')[source]

This method will retrieve a list of Web API Logs. All events that get logged are related to a change of a license key or data object, eg. when license key gets activated or when a property of data object changes. More details about the method that was called are specified in the State field.

More docs: https://app.cryptolens.io/docs/api/v3/GetWebAPILog

class licensing.methods.Data[source]

Data object related methods

static increment_int_value_to_key(token, product_id, key, object_id, int_value=0, enable_bound=False, bound=0)[source]

This method will increment the int value of a data object associated with a license key.

When creating an access token to this method, remember to include “IncrementIntValue” permission and set the “Lock to key” value to -1.

More docs: https://app.cryptolens.io/docs/api/v3/IncrementIntValue (see parameters under Method 2)

class licensing.methods.PaymentForm[source]
static create_session(token, payment_form_id, currency, expires, price=None, heading=None, product_name=None, custom_field='', metadata=None)[source]

This method will create a new session for a Payment Form. It allows you to customize appearance of the form (such as price, heading, etc). You should only create new sessions from a server side (i.e. never directly from your application). Note, session will only work once and it will eventually expire depending on Expires parameter.

More docs: https://app.cryptolens.io/docs/api/v3/PFCreateSession

class licensing.methods.Message[source]
create_message(content='', channel='', time=0)[source]

This method will create a new message. This method requires Edit Messages permission.

More docs: https://app.cryptolens.io/docs/api/v3/CreateMessage

static get_messages(token, channel='', time=0)[source]

This method will return a list of messages that were broadcasted. You can create new messages here. Messages can be filtered based on the time and the channel.

More docs: https://app.cryptolens.io/docs/api/v3/GetMessages

remove_message(messageId)[source]

This method will remove a message that was previously broadcasted. This method requires Edit Messages permission.

More docs: https://app.cryptolens.io/docs/api/v3/RemoveMessage

class licensing.methods.Customer[source]
static add_customer(token, name='', email='', company_name='', enable_customer_association=False, allow_activation_management=False)[source]

This method will add new customer.

More docs: https://app.cryptolens.io/docs/api/v3/AddCustomer

class licensing.methods.Product[source]
static get_products(token)[source]

This method will return the list of products. Each product contains fields such as the name and description, as well feature definitions and data objects. All the fields of a product are available here: https://app.cryptolens.io/docs/api/v3/model/Product

More docs: https://app.cryptolens.io/docs/api/v3/GetProducts

class licensing.models.LicenseKey(ProductId, ID, Key, Created, Expires, Period, F1, F2, F3, F4, F5, F6, F7, F8, Notes, Block, GlobalId, Customer, ActivatedMachines, TrialActivation, MaxNoOfMachines, AllowedMachines, DataObjects, SignDate, Reseller, RawResponse)[source]
static load_from_string(rsa_pub_key, string, signature_expiration_interval=- 1)[source]

Loads a license from a string generated by save_as_string. Note: if an error occurs, None will be returned. An error can occur if the license string has been tampered with or if the public key is incorrectly formatted.

Parameters

signature_expiration_interval – If the license key was signed,

this method will check so that no more than “signatureExpirationInterval” days have passed since the last activation.

save_as_string()[source]

Save the license as a string that can later be read by load_from_string.

class licensing.methods.Helpers[source]
static GetMACAddress()[source]

An alternative way to compute the machine code (device identifier). This method is especially useful if you plan to target multiple platforms.

static GetMachineCode(v=1)[source]

Get a unique identifier for this device. If you want the machine code to be the same in .NET on Windows, you can set v=2. More information is available here: https://help.cryptolens.io/faq/index#machine-code-generation

static IsOnRightMachine(license_key, is_floating_license=False, allow_overdraft=False, v=1, custom_machine_code=None)[source]

Check if the device is registered with the license key. The version parameter is related to the one in GetMachineCode method.

class licensing.models.ActivatedMachine(IP, Mid, Time, FriendlyName='', FloatingExpires='')[source]
class licensing.models.Response(license_key, signature, result, message)[source]

Indices and tables