C# license key validation
Validate license keys in C# and .NET: signed server answers, device binding, offline leases and update checks for WinForms, WPF, console apps and Unity.
Guides
Practical guides to adding license keys to software your customers install: how a license check works, how to validate keys in C#, C++, Python and Node.js, and how offline use, device binding, key security and subscription billing fit together. Each guide explains the technique first, then shows how Velsigil implements it.
Last updated
The basics
Most license systems for installed software follow the same loop. The details differ; the parts are the same.
The customer gets a key when they buy. Your server keeps the record behind it: plan, expiry, features and how many devices may use it.
When your application starts, it sends the key and an identifier of the device to your license server.
The server decides and signs its answer with a private key only it holds. The application verifies the signature with the public key built into it, so a fake server or an edited answer is rejected.
The first check from a new device activates it, up to the license’s device limit. A secret the server issues to the device lets it recognize the same device later.
A successful answer can carry a signed, time-limited lease, so the application keeps working for a while when the server cannot be reached.
Validate license keys in the language you ship in. Each guide covers installation from source, the startup check, results, offline use, updates and hardening for that ecosystem.
Validate license keys in C# and .NET: signed server answers, device binding, offline leases and update checks for WinForms, WPF, console apps and Unity.
Validate license keys in C++17: Ed25519-signed answers via libsodium, device binding, offline leases and static Windows builds with CMake and vcpkg.
Add license key validation to a Python app: verify signed server answers, bind devices, cache offline leases and know the limits of bytecode obfuscation.
Validate license keys in Node.js and Electron: signed answers, device secrets, offline leases, and why the check belongs in the main process.
How the parts of a license check work, what they protect against and where their limits are.
How software checks a license without internet: signed offline leases, signed license files, grace periods, clock tampering and what each one trusts.
How hardware-locked licenses bind a key to a device: machine IDs per OS, why hardware IDs can be spoofed, device secrets, limits and customer resets.
How license keys get shared, forged or replayed, and the defenses that work: signed answers, replay protection, hashed keys, device secrets, rate limits.
Operating your own license server and connecting it to how you sell.
What a self-hosted license key server does, what it needs to run, and how to decide between building, renting or running one yourself on Linux or Windows.
Tie license keys to Stripe subscriptions: paid renewals extend the license, cancellations let it lapse, and full refunds or lost disputes revoke it.
Scope
These guides are about license keys for software that customers install and run: desktop applications, command-line tools, plugins and self-hosted server software. Some licensing models are out of scope, because Velsigil does not implement them.
Early access
Early access is free. In exchange, we ask for your feedback while we prepare the paid launch. Spots are limited, and we reply to every request by email.
Early access ends when paid subscriptions launch; we will tell members by email before then. To keep using Velsigil after that, you need a subscription. The 30% discount applies to the first 12 months of either plan, paid monthly or yearly.
Opens your email app with a short template: company, what you sell, your platforms and languages, expected license volume and how you plan to deploy. You can also write to hello@velsigil.com.