Install and requirements
dotnet add package CarchaLabs.Seal
| Package | CarchaLabs.Seal on NuGet |
|---|---|
| Frameworks | .NET 5 and later (Native AOT on .NET 10), .NET Framework 4.6.2 and later (WinForms, WPF) |
| Native library | Windows (x86, x64, ARM64), macOS (Apple Silicon, Intel), Linux (x64, ARM64), in the package |
| Network | Through HttpClient, so the app's proxy and certificate settings apply |
| Threads | One operation at a time per SealClient |
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.
using CarchaLabs.Seal;
using var client = new SealClient(new SealOptions
{
Product = "example-studio",
ServerUrl = "https://licenses.example.com",
PublicKeys = PublicKeys, // the current and next key, in your code
StorageDirectory = appDataDir, // license.dat is kept here
AppVersion = "2.4.0",
});
LicenseState state = await client.CheckAsync(); // at every start; offline from the saved lease
if (state.Status == LicenseStatus.Unlicensed) state = await client.ActivateAsync(keyTheUserTyped);
if (state.HasFeature("export-pdf")) ExportPdf();
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
ActivateAsync(key, machineName) | Takes a seat, stores the lease. machineName is what the console shows. |
CheckAsync() | Checks in and stores the new lease; offline, decides from the stored one. At start and every few hours. |
DeactivateAsync() | Frees the seat and deletes the lease. |
OfflineRequest(key) | Offline step 1: the request file (JSON) for a computer with no network. |
ActivateOffline(file) | Offline step 2: verifies and saves the license file. |
DeactivateOffline() | 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.HasFeature(name) | True only for Valid and Grace states that include the feature. |
Errors are a LicenseException with a Code; states are LicenseStatus.Valid, Grace and the rest. 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 C++ 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.