Skip to main content
Python 3 package licensing 0.54. Reviewed source revision.
You normally receive this object from Key.activate, Key.get_key or LicenseKey.load_from_string. Constructing or parsing a license object yourself does not establish that its signature is valid.

Properties

from_response

Decode a response envelope into a license object.

Parameters

Result

Returns a LicenseKey object, including converted dates and activation objects. Raises for rejected, malformed or incomplete data, including timestamps outside the platform’s supported range.

Checks

Decodes and parses the data; it does not verify the signature. Use Key.activate, Key.get_key or load_from_string when you need the SDK to verify it.

save_as_string

Serialize the license’s original signed response.

Result

Returns a JSON string that can be saved and later passed to load_from_string. Requires a usable raw_response; an object constructed without it can raise an exception.

Checks

Preserves the original signed response and signed timestamp. It does not create a new signature or restart the offline allowance.

Example

After successful activation, license_key is the first item of the result. This example saves its original signed response.

load_from_string

Load and verify a previously saved signed response.

Parameters

Result

Returns a LicenseKey object, or None when it cannot load and verify the data. Returns None for malformed data, an invalid RSA key, a failed signature, a parsing failure, or a response older than a positive age limit.

Checks

Verifies the license signature. A positive signature_expiration_interval also checks age from the signed timestamp using the device clock; the default -1 disables that age check. It does not enforce license expiry, machine binding, product or feature requirements.

Example

Replace the RSA public key placeholder with your account’s key. Here, 3 is the maximum signed-response age in days.

FAQ

No. The age check uses the signed timestamp in the response. Copying or saving the file does not change that timestamp.
No. The signature protects the timestamp from being edited, but the SDK compares it with the device clock. Changing that clock can affect the age check. See offline verification for the limitation and the other checks your application needs.
Python SDK Reference