Skip to content

Vendor guide

A license check is only as strong as what hangs on it. This guide is about getting real protection from Noctix, and about being honest on what it cannot do.

What a check can and cannot do

A program that runs on a customer's machine can be modified by someone with enough time. A check that only runs inside the program, then flips a switch, can be removed. No SDK changes that. What you can change is how much a removed check is worth.

Noctix therefore works in layers, strongest first:

  1. Value on the server. The server contributes something on every use. Without a valid license the function does not exist.
  2. Signed, short-lived proof checked locally. Stops sharing keys and casual tampering.
  3. Device binding and limits. Stops one key running on many machines.
  4. Updates only for valid licenses. Works for every app, even a fully local one.
  5. Hardening of your own code. Delays attackers; never sufficient alone.

Layer 1 is the one that matters.

Put value on the server

Tie the most valuable part of your product to a valid license, wherever you can:

Kind of value Example Why a copy of the app is not enough
Computation on your server Analysis, export, an AI feature in your backend The result never exists on the device
Data that keeps changing Databases, content, signatures, rates A copy goes stale
Services Sync, accounts, collaboration They only exist online
Updates New versions only for valid licenses A modified copy stays on its old version

Loading the whole app from the server after the check is not a substitute. Whatever is fully on the device once can be copied, and Noctix never delivers native code from the server.

A purely local app with no server part cannot get layer 1. That is fine: use layers 2 to 4 and say so to yourself. Updates are your strongest lever then.

Check where the feature runs

Do not check once at startup and keep a flag.

Weak:    at start: pro = check();            ... anywhere: if (pro) { ... }
Better:  at the point of use: require_entitlement("export") before the export runs
Best:    your backend verifies the token before it does the work
  • Read entitlements from the verified token (claims.ent), at the place the feature runs.
  • Check in more than one place. A single if is a single patch.
  • If your app already talks to your own backend, send the license token with the request and verify it there with the Node SDK. Server-side checks cannot be patched out of a copy.
  • Treat entitlement values by type: true is a flag, a number is a limit (seats, exports per month), a string is a variant ("edition": "studio").

Handle every state

Plan for the result of check, activate and validate, not just "valid".

Result Do
Fresh Run normally
Grace Run normally, renew in the background. Optionally remind the user after a few days
not_activated Show the activation dialog
server_unreachable Keep running on the stored token; do not block users because your network is down
token_expired Offline period over: ask the user to connect
license_expired, license_suspended, license_paused, license_revoked Show what happened and how to resolve it. Say who to contact
device_limit_reached Tell the user to deactivate another device or contact you
version_outdated Offer the update
session_limit_reached Tell the user how many sessions the plan allows; the token stays
account_blocked Your account with us is blocked, usually for an unpaid invoice. The token stays and keeps working offline; pay or contact us
device_code_expired The device code ran out or was used: show a new one
invalid_credentials Email, password or code is wrong, or the sign-in expired: let the user sign in again
totp_required Ask for the code from the authenticator app and sign in again with it
clock_rollback Ask the user to correct the system time

Show messages in your own words. The message field of an error is English, meant for logs.

Be generous where you can afford it. Strict rules also hit honest customers: a laptop swapped after a failure, a company reimaging machines. Offline tolerance, device limit and reset rules are per plan so you can balance them for each audience.

Keep the minimum version moving

Set a minimum version per product. A client below it gets version_outdated and should offer the update. Release often and raise the minimum when you fix a weakness or retire an old behavior. Without a minimum, an old, patched build lives forever.

Pass your real version as app_version, from your build, not a constant you forget.

Harden your own binary, and know what it is worth

This is layer 5: it delays an attacker and is never sufficient alone. It pays off most when a removed check also loses layer 1 value, or shows up in detection on the server. Spend effort here only after layers 1 to 4 are in place.

  • Make one check into many. Scatter independent entitlement checks through your code, each at the point of use, so there is no single switch to flip. Tie each to real value (an asset the token decrypts, a server call) so removing it also removes the feature.
  • Bind assets to the license. Ship a valuable asset encrypted and open it with the key the Client API hands your device, not with if (valid). The patched branch then opens nothing. See Assets.
  • Turn on attestation where you have it. On iOS and Android, App Attest and Play Integrity let the server refuse a token to a modified app or a tampered device. This is the one client-side signal an attacker cannot simply forge, because the server checks it. See Kotlin and Swift.
  • Harden the build you ship, not the SDK source. The SDKs are open source, so hiding their code buys nothing. Strip symbols, enable LTO and static linking, and avoid leaving license strings in the clear in your own binary. This raises the bar for a casual patcher; a determined one still gets through.
  • Let the server decide. Anti-debugging and tamper checks inside a shipped program can be removed, and heavy-handed ones hurt honest users and can break store rules. Where Noctix adds such signals they stay optional, off by default, and feed the server's detection rather than block on the device.

Honest limits: a purely local app with no server part can always be modified with enough effort, and no client hardening stops someone who rewrites a client from scratch. The internal concept and the roadmap for these measures are in docs/hardening.md.

Keep your secrets secret

  • The product ID and public keys are public. Ship them in your app.
  • mk_ API keys are secrets. Server only, from environment variables or a secrets manager, never in a repository, a client, or a log.
  • Give each key the least scope it needs and an expiry date. One key per service, so you can revoke one without touching the rest.
  • Use an Idempotency-Key on writes, so a retry after a timeout never creates a second license.
  • Rotate signing keys with a two-key window (concepts).

Do not do these

  • Do not put a Management API key into an app, an installer, or a config file you ship.
  • Do not decode a token yourself and trust its fields. Verify the signature, or use the SDK.
  • Do not store license state in a plain file the user can edit. The SDK uses the operating system's secure storage; if you pass your own store, protect it likewise.
  • Do not read extra hardware data for your own purposes next to the SDK and call it "license enforcement". Privacy law judges each purpose separately, see privacy texts.
  • Do not rely on a single check for anything valuable.

Before you release

  • Entitlements are checked where each feature runs
  • Every result in the table above has a message in your app
  • The live product ID and the live public key are in the build, not the test ones
  • A second public key is planned for rotation
  • The minimum version is set
  • No mk_ key in the build, the repository history or the logs
  • Privacy text modules are in your privacy notice and license terms
  • You tried suspend, offline and reset on a test license (quickstart, step 3)