Skip to main content

Python client for go-license license verification

Project description

python-licverify

Python client for go-license license verification.

python-licverify allows you to verify .lic files generated by the licforge CLI or Go library entirely from Python, including:

  • RSA-SHA256 signature validation
  • Hardware binding checks (MAC address, disk ID, hostname)
  • Expiry validation
  • Simple CLI utility

Installation

pip install python-licverify  # or uv pip install python-licverify

Depend on cryptography and psutil. Wheels are provided for Python 3.12+, no extra build tools required.

Usage

Library API

from licverify import Verifier

PUBLIC_KEY_PEM = open("public.pem").read()
verifier = Verifier(PUBLIC_KEY_PEM)

license = verifier.load_license("license.lic")

try:
    license.verify(verifier)  # raises on failure
except Exception as exc:
    print(f"License invalid: {exc}")
else:
    print("License is valid!")

Command-line

After installation a licverify command is available:

licverify --public-key public.pem --license license.lic

Exit status 0 ⇒ valid, status 1 ⇒ invalid.

Examples

See examples/basic_usage.py.

Development

git clone https://github.com/luhtfiimanal/python-licverify
cd python-licverify
uv sync  # install dev deps (optional)
uv run -m pip install -e .

Run tests (to be added soon):

pytest -q

License

This project is licensed under the MIT License – see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_licverify-0.2.1.tar.gz (13.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_licverify-0.2.1-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file python_licverify-0.2.1.tar.gz.

File metadata

  • Download URL: python_licverify-0.2.1.tar.gz
  • Upload date:
  • Size: 13.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.21

File hashes

Hashes for python_licverify-0.2.1.tar.gz
Algorithm Hash digest
SHA256 c5f617d3e74c38059b24dda1a72d6c6fe9ada2148858ff75d67acc3827c92ca7
MD5 97b3cf9facd23d1952fec68920d9b8aa
BLAKE2b-256 fd922ff0b52ef9dc3c4af778c36e9c39298f34f51efe3b108a8c59212d9b4d95

See more details on using hashes here.

File details

Details for the file python_licverify-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for python_licverify-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8665263d6dafa239f6a1da515f8989060b0313eb1713a21dc68b941aafe8b424
MD5 c0465bf5eb03bf0879c8d91ba6747e22
BLAKE2b-256 d8c2b520a2ad083ba44e1d55c9a7bb4e8052ef9df15fac8e7a4b10c3ebf408cb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page