HomeOffline License Activation

Offline licensing

Offline license activation for air-gapped machines

Some customers run your software where it can't reach the internet. Keymint signs a license file for that one machine, and your app checks the signature locally, with no network call.

Overview

How offline activation works

The app shows a machine code. You, or your backend, turn that code into a signed .lic file and send it to the customer, who copies it onto the machine. The app verifies the file with your public key and checks that it is for this product, this machine, and hasn't expired.

The signature is Ed25519 over a standard JWT, so a customer can't edit the file to extend it or move it to another machine without the check failing.

The flow

Four steps, no network on the customer's side

  1. 01

    Show the machine code

    The app displays its hostId, for example the SDK's installation ID, for the customer to send you.

  2. 02

    Sign a license file

    Create it in the dashboard (the license's Create offline license tab) or from your backend with POST /key/sign, passing the machine code as hostId and an optional ttl.

    Learn more
  3. 03

    Deliver the .lic file

    The customer copies license.lic onto the air-gapped machine however they move files there.

  4. 04

    Verify locally

    The app checks the Ed25519 signature against your bundled public key, then the product, machine code and expiry. Each SDK does all of it in one call.

    Learn more

Code

Sign on your server, verify in the app

Signing needs an admin key, so it never runs inside the shipped app. Verification needs only the public key.

Sign (curl)
# From your backend only: signing needs an admin key (license:sign).
curl -X POST https://api.keymint.dev/key/sign \
  -H "Authorization: Bearer YOUR_ADMIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "productId": "YOUR_PRODUCT_ID",
    "licenseKey": "A8E2K-9F1BC-3D4GH-7J2KM",
    "hostId": "MACHINE_CODE_FROM_THE_APP",
    "ttl": 2592000
  }'

# 200 OK: { "file": "{"signedDate":…,"signedKey":"eyJ…","keyId":…}" }
# Save the file string as license.lic and send it to the customer.
Verify (Node.js)
import { readFileSync } from 'fs';
import { KeyMint, verifyOfflineLicense } from 'keymint';

// The public key is safe to ship. Bundle every trusted key so a
// signing-key rotation never breaks old installs.
const license = verifyOfflineLicense(readFileSync('license.lic', 'utf8'), {
  publicKeys: [PUBLIC_KEY_PEM],
  productId: 'YOUR_PRODUCT_ID',
  machineCode: KeyMint.getOrCreateInstallationId(),
});

// Throws with a reason code when the file isn't valid here:
// expired, wrong_product, wrong_machine, bad_signature, unknown_key, ...
Verify (Python)
from keymint import identity, verify_offline_license

with open("license.lic", encoding="utf-8") as f:
    license = verify_offline_license(
        f.read(),
        public_keys=[PUBLIC_KEY_PEM],
        product_id="YOUR_PRODUCT_ID",
        machine_code=identity.get_or_create_installation_id(),
    )

Reference

What to know

Format
A JSON .lic file whose signedKey is an Ed25519 (EdDSA) JWT; keyId tells the app which public key to use.
Expiry
Every offline license expires: the TTL you ask for (60 seconds to 10 years), never past the license's own expiry or the product's maximum offline lifetime.
Activation limits
Signing uses one of the license's device activations, and that device keeps the slot until the file expires.
Revocation
Blocking a key online doesn't reach a file that is already on an offline machine, so keep TTLs short when that matters.
Key rotation
Bundle every trusted public key in the app so rotating the signing key doesn't break existing installs.
Without an SDK
Verify with any Ed25519 JWT library, for example jose in Node.js.
Plans
Offline signing is on every plan, Free included. Startup $49/mo (1,000 licenses), Standard $149/mo (5,000 licenses). No cut of your sales.

Frequently asked questions

How does the app check a license without internet?

The license file is signed with your private key, and the app carries the matching public key. Checking an Ed25519 signature is a local computation, so no server is involved.

Can a customer copy the license file to another computer?

It won't work there. The file is bound to one machine code, and verification fails with wrong_machine on any other machine.

Can I revoke an offline license?

Not before it expires, because the machine never talks to Keymint. That's why every offline license has an expiry: use short TTLs and issue a new file when the customer renews.

Is the private signing key ever on the customer's machine?

No. Keymint keeps the signing key (encrypted with AWS KMS); only the public key ships with your app, and it can't be used to create licenses.

Which plans include offline licensing?

Every plan, including the free one. You need a signing key, which you create under Developer → Public keys. Paid plans start at $49/mo.

Try it on the free plan

25 licenses, floating seats and offline licensing included. No credit card required.