Skip to content
Kleis
Dark theme
Contact us
How it works

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.

The parts

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.

Online

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.

  1. 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.

  2. DeviceKleis

    Challenge. The SDK creates a key pair for this installation and asks for a challenge. A challenge expires quickly and works once.

  3. 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.

  4. 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.

  5. 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.

  6. 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.

Offline

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.
Offline leaseOfflineValid
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
Day 5 of 14 without a connection9 days left
Sample data.
One lease

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.

  1. OnlineValidThe server confirmed the lease recently. Everything the license grants is available, online-only entitlements included.
  2. OfflineValidThe server has not been reached for a while. The held lease decides; online-only entitlements stop.
  3. ValidationRequiredThe lease expired, or the clock looks wrong. Protected operations are denied until the device validates once.
  4. A new lease, or the endValidation returns a new lease, or a signed notice that the license was suspended or revoked.
Air-gapped

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.

  1. On the device, the SDK writes a request file. It holds the device's public key, a nonce, and a signature.
  2. 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.
  3. 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.

Air-gapped deviceNo network
Request file Written on the device. Holds its public key and a signature. No license key.
Response file Signed by the server. Usable only with that device's private key, once.
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
Sample data.
Ending a license

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.

Why a released device may keep working for a whileA signed lease stays valid until it expires, and a device that is disconnected cannot be told otherwise. That delay is at most the offline period you chose, which is why a shorter period means faster revocation and a longer one means more freedom offline.

Try the flow with your own product.

Create a client, activate with a key, and gate one operation. The quick start has the code.

The connection to the console was lost. Reconnecting…

The connection could not be restored. Nothing you had not saved was sent.

Reload the page