HelperMethods.ironpython2730_legacy = True
.
Please check out our guide about common errors and how to solve them: https://help.cryptolens.io/faq/index#troubleshooting-api-errors. For Python specific errors, please review this section.
cryptolens_python2.py
file into your project folder. The entire library is contained in that file.
In the examples below, please disregard the imports and use only the following one:
RSAPubKey
- the RSA public key (can be found here, in API Keys section).token
- the access token (can be found here, in API Keys section).product_id
- the id of the product can be found on the product page.key
- the license key to be verifiedmachine_code
- the unique id of the device.Helpers.IsOnRightMachine(result[0])
will return False
. You can read more about this behaviour here.
Helpers.IsOnRightMachine(license, true, true)
needs two boolean flags to be set to true.
trial_key[0]
will contain the license key string. We then need to call Key.Activate
(as shown in the earlier examples) with the obtained license key to verify the license.
server_address
in HelperMethods, i.e.,
certifi
package to be installed.
Running a script in the Python environment
An alternative is to run script in their environment that should fix the issue. You can read more about it in this thread: https://github.com/Cryptolens/cryptolens-python/issues/65
Summary
The key takeaway is that it is better to address the issue with missing CA on the user side, since this issue will typically be user-specific. If that is not possible, you can use the code above to manually set the path to CA files. Although we have mentioned turning off SSL verification temporarily, it should not be used in production. Key.activate
takes care of signature verification internally, but some other methods do not.