Start free trial

C++ licensing library: license keys and offline validation for native apps

The Carcha Seal C++ SDK is a header-only layer, carcha/seal.hpp, over a native library. It activates a license key once, validates a signed lease on the computer at every start, with or without a network, and tells your app which features the customer paid for. It is a CMake package you download from the console.

Reading time
3 min
Updated
11 November 2026
Sections
5
On this page
Install and requirementsCheck at every start, activate onceMethodsWhat the SDK checksWhat it does not do

Install and requirements

find_package(CarchaSeal 0.4 REQUIRED)        # cmake -DCMAKE_PREFIX_PATH=/path/to/carcha-seal-cpp-<version>
target_link_libraries(my_app PRIVATE CarchaSeal::seal)
carcha_seal_copy_runtime(my_app)             # the native library next to the app in the build folder
Get itThe console, Integrate page; CMake find_package(CarchaSeal)
LanguageC++17, CMake 3.16 or later
PlatformsWindows (x64, x86, ARM64), macOS 11 and later, Linux x64 and ARM64 (glibc 2.34 or later)
ShippingThe native library next to the executable (macOS: Contents/Frameworks)
NetworkSystem certificates and HTTPS_PROXY; options.transport to use Qt, libcurl or WinHTTP

Check at every start, activate once

Your server address, product code and public keys (the current and the next, so the signing key can rotate without an app update) are on the console's Integrate page.

#include <carcha/seal.hpp>
namespace seal = carcha::seal;

seal::Options options;
options.product = "example-studio";
options.server_url = "https://licenses.example.com";
options.public_keys = kPublicKeys;      // the current and next key, in your code
options.storage_dir = app_data_dir;     // license.dat is kept here
options.app_version = "2.4.0";

seal::Client client(options);
seal::State state = client.check();     // at every start; offline from the saved lease
if (state.status == seal::Status::Unlicensed) state = client.activate(key_the_user_typed);
if (state.has_feature("export-pdf")) export_pdf();

Activating binds the license to this computer and stores a lease signed with Ed25519. check works from that lease when the network is down; by default the app checks in every 72 hours and keeps working 7 more days without the server.

Methods

activate(key, machine_name)Takes a seat, stores the lease. machine_name is what the console shows.
check()Checks in and stores the new lease; offline, decides from the stored one. At start and every few hours.
deactivate()Frees the seat and deletes the lease.
offline_request(key)Offline step 1: the request file (JSON) for a computer with no network.
activate_offline(file)Offline step 2: verifies and saves the license file.
deactivate_offline()Removes the license, returns the deactivation file for the offline page or the console.
decrypt(feature, data)Opens data encrypted for a feature, offline. The content key stays in the native library.
state.has_feature(name)True only for Valid and Grace states that include the feature.

States are seal::Status::Valid, Grace and the rest; one operation at a time per Client. Full reference: documentation.

What the SDK checks

  • The signature. The lease is a compact JWS signed with Ed25519; the app holds only public keys, chosen by key id.
  • The computer. The lease names a hash of the operating system's machine ID and the product code; the raw ID never leaves the computer.
  • Time. Expiry, the end of updates, the check-in deadline and grace; a clock turned back by more than a day is reported as clock_suspect.
  • Features. Only features listed in the lease are granted, and data encrypted for a feature opens only with a lease that includes it.

The SDK also takes seats of floating licenses, counted per computer, running copy, user, or user per computer, in the native library it shares with the .NET SDK.

What it does not do

  • Stop someone who controls the computer. A check in your code can be patched out. Code or data encrypted for a feature, opened with decrypt, is what a patched app is missing.
  • Revoke an offline app at once. A computer that stays offline learns of a revoked license at its next check-in, after grace.
  • Floating seats without a connection. A floating seat needs your server while the app runs; a license server at the customer's site is not in version 1.

Sources

Checked on 11 November 2026 against the published SDKs and the documentation.

License your app in an afternoon.

14-day trial, no card. Your own server address and signing key from the first minute.