A cross-platform desktop app using PyQt6 with Keymint license activation and machine binding.
pip install -r requirements.txt
cp .env.example .env # then fill in your keys
python main.pyCopy .env.example to .env and set:
| Variable | Description |
|---|---|
KEYMINT_CLIENT_API_KEY |
API key with the client scope from the Keymint Dashboard (starts with km_live_). Never ship an admin key in the app. |
KEYMINT_PRODUCT_ID |
Your product ID |
KEYMINT_PUBLIC_KEY |
Optional. Public key PEM for offline licenses |
- Activation dialog — PyQt6 dialog prompting for a license key
- Stable installation ID — the
hostIdcomes from the SDK'sidentity.get_or_create_installation_id(): a 64-character SHA-256 ID saved in~/.keymint/installation-idand reused on every launch. If it can't be read or saved, the app shows an error instead of using a shared or temporary ID. - Persistent storage — uses
QSettingsto store license state across sessions - Keymint Python SDK — uses the official
keymintpackage for API calls
For machines without internet access, the user can import a .lic file instead of entering a key ("Import offline license" in the activation dialog). The app verifies it locally with the SDK's verify_offline_license.
- Public key: copy the PEM from Developer → Public Keys in the dashboard into
KEYMINT_PUBLIC_KEY(quoted multi-line value, or line breaks written as\n). It's a public key, safe to ship. - The
.licfile: create it in the dashboard (a license's activations → Create offline license) or from your backend with the SDK'ssign_key(admin API key; never call it from the app). Sign it for the machine ID fromget_host_id(), the samehostIdused for online activation. - The file must match
KEYMINT_PRODUCT_IDand this machine. When it expires, the user imports a newly signed file.
The file is stored in QSettings and re-checked on launch. Expiry is checked against the later of the system clock and the last time a check succeeded, so setting the clock back doesn't extend it. Online activation works as before; offline is an extra path.
Tests: python -m unittest discover tests.
Earlier versions used a 16-character hash of the hardware ID as the hostId. This version uses the SDK's installation ID instead, so an existing install reports a new hostId: on next launch it activates as a new device (using another activation slot, or failing with activation_limit_reached if none is left; remove the old device from the license in the dashboard), and offline .lic files signed for the old ID must be signed again for the new one.
├── main.py # App entry point, launches activation or main window
├── license_manager.py # Keymint SDK calls, installation ID, license storage
├── offline_license.py # Offline .lic verification
├── activation_dialog.py # PyQt6 activation dialog
├── requirements.txt # Python dependencies
└── .env.example # Environment variable template
keymint— Official Keymint Python SDKPyQt6— Cross-platform GUI frameworkpython-dotenv— Environment variable loading