Offline Signed License Leases: ECDSA Guide & Verifier Kit
Practical guide to offline-verifiable signed license leases using asymmetric ECDSA/Ed25519 keys, canonical UTF-8 JSON, and a free Python + Node starter kit.
Why this problem wastes time
Indie desktop apps, CLI tools, and developer plugins frequently break offline or in air-gapped CI networks when license checks rely on synchronous cloud API calls. Worse, rolling a homegrown license check often introduces subtle bugs: shipping a symmetric HMAC-SHA256 secret inside the client binary (allowing anyone to forge keys), ignoring UTF-8 canonical JSON key ordering across JS/Python runtimes, or letting clock skew lock out paying customers.
Step-by-step workflow
- Separate asymmetric offline clients from symmetric backend tokens: Ship only an asymmetric public key (
ECDSA P-256 / ES256orEd25519) inside distributed desktop/CLI binaries so users can verify offline leases without ever seeing the signing key. Reserve symmetricHMAC-SHA256strictly for trusted backend workers or CI runners. - Canonicalize JSON deterministically across languages: Sort nested object keys recursively while keeping raw UTF-8 strings unescaped (
ensure_ascii=Falsein Python, recursive key sorting +TextEncoderin JS), and rejectNaN/Infinityplus boolean values in integer fields likeseat_limit. - Validate strict UTC timestamps with a clock-skew window: Require explicit
Z/+00:00offsets (or integer epochs), enforceexpires_at > issued_at, and allow a bounded skew buffer (e.g.,60s) before rejecting expired leases.
Automating it in seconds
Use the live Offline Signed License Lease Sandbox to generate an ephemeral DEMO ONLY ECDSA P-256 keypair in-browser, serialize canonical UTF-8 payloads (including non-ASCII customer names), sign a base64url <payload>.<sig> lease token, and test tamper/expiry detection immediately. You can also download the free $0.00 starter kit (lease_verifier.py, sample_lease.json, test_lease_verifier.py, and a copy-paste Node.js Ed25519 snippet) via Gumroad or GitHub.