The life of a license, online and offline.
A license key is a secret that is used once. What a device holds afterwards is a lease: a short, signed statement from your Kleis server about what that one device may do, and until when.
Three things take part.
Your product, with the SDK
The Kleis client runs inside your application. It holds the device's key and the lease, and answers "is this allowed?" from the verified lease.
The Kleis API
The server devices talk to. It checks keys, allocates seats, and signs leases. PostgreSQL is its one source of truth.
The console and your back end
Where licenses are issued and changed: by a person in the console, or by your systems through the administration API.
Activation, step by step.
Every message a device sends after its first is signed with the device's own key, so a captured request cannot be replayed and a lease cannot be claimed by another machine.
- ConsoleKleis
Issue. You issue a license under a plan. The key is shown once and delivered to your customer; the server stores a keyed hash of it.
- DeviceKleis
Challenge. The SDK creates a key pair for this installation and asks for a challenge. A challenge expires quickly and works once.
- DeviceKleis
Activate. The device sends the license key, its public key, and the challenge signed with its private key. The server takes a seat in one transaction, so two devices racing for the last seat cannot both win.
- KleisDevice
Lease. The server returns a lease signed with Ed25519: the license and activation, the device's public key, the entitlements, and the offline expiration. The SDK verifies the signature first, then stores the lease in protected storage. The license key is not kept.
- DeviceKleis
Heartbeat and validation. In the background the SDK reports that it is alive and, at the validation interval, exchanges its lease for a new one. A heartbeat by itself renews nothing.
- KleisDevice
Changes. When an entitlement, a policy, or the license's state changes, the server tells connected devices that something changed. The device fetches a new signed lease; the hint itself grants nothing.
What happens when the network goes away.
Nothing, for a while. The lease the device already holds keeps deciding, and the client reports that it is running offline.
- The period is fixed when the lease is signed. 7, 14, 21, or 28 days, as your policy says. It does not restart with the application.
- Time is the server's. The client anchors its clock to the server's time and notices a clock that was set back.
- After the expiration, one contact is enough. The client asks for validation; a reachable server answers with a new lease or with a signed notice that the license ended.
- Signed by
lease-2027-01(Ed25519)- Trusted through
- manifest 7, root
root-2027 - Bound to
- this device's public key
- Issued
- 2027-03-14 09:20 UTC
- Offline period
- 14 days
- Expires
- 2027-03-28 09:20 UTC
The states a device moves through.
The SDK reports a status your interface can show. Decisions for protected operations come from the same verified state.
OnlineValidThe server confirmed the lease recently. Everything the license grants is available, online-only entitlements included.OfflineValidThe server has not been reached for a while. The held lease decides; online-only entitlements stop.ValidationRequiredThe lease expired, or the clock looks wrong. Protected operations are denied until the device validates once.- A new lease, or the endValidation returns a new lease, or a signed notice that the license was suspended or revoked.
A device that never connects.
The same lease reaches the device in a file. The exchange is the server's ordinary activation; only the transport differs.
- On the device, the SDK writes a request file. It holds the device's public key, a nonce, and a signature.
- On a connected machine, someone uploads the request in the console's Air-gapped devices page, or runs a helper program, and enters the license key there. The answer is a response file.
- Back on the device, the SDK imports the response, verifies the lease in it, and starts the offline period from the signed time.
The device repeats the exchange with a renewal request before each lease expires, every 7 to 28 days. A deactivation request ends the license on the device when it is written and frees the seat when it is submitted.
- Exchanged
- in the console, or by a helper program
- Lease after import
- 28 days, from the signed time
- Renew by file before
- 2027-04-11 08:00 UTC
Suspend, revoke, release.
Suspend and reactivate
A suspended license stops granting anything on connected devices at once. Reactivating restores it without a new key.
Revoke
Revocation is final. Connected devices receive a signed notice; a disconnected device stops when it reconnects or when its lease ends.
Release a device
Deactivating frees the seat. If a device is gone, an administrator releases it, and the console says how long its last lease can still run.