LicenseManagement.EndUser
2.0.0
Requires NuGet 2.5 or higher.
dotnet add package LicenseManagement.EndUser --version 2.0.0
NuGet\Install-Package LicenseManagement.EndUser -Version 2.0.0
<PackageReference Include="LicenseManagement.EndUser" Version="2.0.0" />
<PackageVersion Include="LicenseManagement.EndUser" Version="2.0.0" />
<PackageReference Include="LicenseManagement.EndUser" />
paket add LicenseManagement.EndUser --version 2.0.0
#r "nuget: LicenseManagement.EndUser, 2.0.0"
#:package LicenseManagement.EndUser@2.0.0
#addin nuget:?package=LicenseManagement.EndUser&version=2.0.0
#tool nuget:?package=LicenseManagement.EndUser&version=2.0.0
LicenseManagement.EndUser
End-user SDK for license-management.com - A license management platform for software vendors.
This library is designed for client-side applications (desktop apps, plugins, add-ins) to validate licenses, handle trials, and manage activations.
Account Required: This library requires a publisher account at license-management.com.
Free with Dev Subscription: A developer subscription is available at no cost, which provides full access to all features for development and testing purposes.
Features
- License Validation - Validate licenses at application launch
- Trial Management - Automatic trial period handling with anti-tampering
- Installation Handling - Register computers during application install
- Uninstall Support - Properly unregister computers to free seats
- Offline Support - License validation works offline after initial activation
- Digital Signatures - RSA signature verification for license files
- Time Sync Detection - Detects system clock tampering
- Hardware Identification - Secure device fingerprinting
Installation
dotnet add package LicenseManagement.EndUser
Or via NuGet Package Manager:
Install-Package LicenseManagement.EndUser
Breaking Change in v2.0.0: The package has been renamed from Hymma.Lm.EndUser to LicenseManagement.EndUser. See the Migration Guide below.
Quick Start
1. Configure Publisher Preferences
using LicenseManagement.EndUser;
var preferences = new PublisherPreferences
{
VendorId = "VDR_01ABC...", // Your vendor ID
ProductId = "PRD_01XYZ...", // Your product ID
ApiKey = "your-client-api-key", // Client API key (NOT master key)
PublicKey = "<RSAKeyValue>...</RSAKeyValue>", // For signature verification
TrialDays = 14, // Trial period duration
ValidDays = 90 // License cache validity
};
2. Handle License at Installation
// During MSI/Setup installation
var context = new LicHandlingContext(preferences);
var installHandler = new LicenseHandlingInstall(
context,
onSuccess: (ctx) => {
Console.WriteLine("License installed successfully!");
}
);
await installHandler.HandleLicenseAsync();
3. Validate License at Launch
// At application startup
var context = new LicHandlingContext(preferences);
var launchHandler = new LicenseHandlingLaunch(
context,
onLicenseHandledSuccessfully: (license) => {
Console.WriteLine($"License valid until: {license.Expires}");
},
onCustomerMustEnterProductKey: () => {
// Show product key entry dialog
return GetProductKeyFromUser();
},
onTrialValidated: () => {
Console.WriteLine("Trial period active");
return null;
},
onTrialEnded: (prefs) => {
// Show trial expired message
MessageBox.Show("Your trial has expired. Please purchase a license.");
},
onLicFileNotFound: (ctx) => {
// License file missing - may need reinstall
}
);
await launchHandler.HandleLicenseAsync();
4. Handle Uninstallation
// During uninstall to free up the license seat
var context = new LicHandlingContext(preferences);
var uninstallHandler = new LicenseHandlingUninstall(
context,
onSuccess: (ctx) => {
Console.WriteLine("Computer unregistered successfully");
}
);
await uninstallHandler.HandleLicenseAsync();
License States
| State | Description |
|---|---|
Valid |
Active paid subscription |
ValidTrial |
Within trial period |
InValidTrial |
Trial period expired |
Expired |
License has expired |
ReceiptExpired |
Subscription ended |
ReceiptUnregistered |
Computer unregistered from receipt |
Events
The LicHandlingContext provides events for handling license state changes:
context.OnCustomerMustEnterProductKey += () => { /* Show key entry UI */ };
context.OnTrialValidated += () => { /* Trial is active */ };
context.OnLicenseFileNotFound += () => { /* Handle missing license */ };
context.OnTrialEnded += () => { /* Trial expired */ };
context.OnLicenseHandledSuccessfully += () => { /* Success */ };
Custom Metadata
Attach custom metadata to licenses during installation:
preferences.BeforeLicensePost += (sender, args) => {
args.Metadata["CustomerName"] = "John Doe";
args.Metadata["OrderId"] = "ORD-12345";
};
Storage Locations
- Computer ID: Windows Registry (
HKLM\Software\Hymma\LicenseManagement) - License File:
%LocalAppData%\License-Management.com\{VendorId}\{ProductName}.lic
Exception Handling
try
{
await launchHandler.HandleLicenseAsync();
}
catch (ComputerOfflineException)
{
// No internet - but offline validation may still work
}
catch (CouldNotReadLicenseFromDiskException)
{
// License file corrupted or missing
}
catch (LicenseExpiredException)
{
// License has expired
}
catch (ReceiptExpiredException)
{
// Subscription ended
}
catch (ApiException ex)
{
// API communication error
Console.WriteLine($"API Error: {ex.StatusCode}");
}
Requirements
- .NET Framework 4.8.1
- Windows OS (uses WMI for hardware identification)
- Internet connection for initial activation (offline afterward)
Security Features
- RSA Signature Verification - Licenses are digitally signed
- Hardware Fingerprinting - CPU + Motherboard serial numbers
- Time Tampering Detection - NTP sync validation
- Secure Registry Storage - Computer ID in HKLM
Sample Applications
We provide sample applications demonstrating real-world usage patterns:
WiX Installer Custom Action
The WiX Custom Action Sample demonstrates how to integrate license management into a WiX installer:
- Register computers during installation
- Unregister computers during uninstallation
- Pass configuration via CustomActionData
// Example custom action
[CustomAction]
public static ActionResult InstallLicense(Session session)
{
var preferences = GetPreferences(session, "ProductId");
var context = new LicHandlingContext(preferences);
var handler = new LicenseHandlingInstall(context, null);
handler.HandleLicense();
return ActionResult.Success;
}
See the sample README for complete setup instructions.
Migrating from v1.x
Version 2.0.0 introduces a breaking change: the namespace has been renamed from Hymma.Lm.EndUser to LicenseManagement.EndUser.
Steps to Migrate
Update NuGet Package Reference
# Remove old package dotnet remove package Hymma.Lm.EndUser # Add new package dotnet add package LicenseManagement.EndUserUpdate Namespace Imports Replace all occurrences:
// Old using Hymma.Lm.EndUser; // New using LicenseManagement.EndUser;Update Assembly References (if using direct DLL reference)
- Old:
Hymma.Lm.EndUser.dll - New:
LicenseManagement.EndUser.dll
- Old:
What Changed
| v1.x | v2.0.0 |
|---|---|
Hymma.Lm.EndUser namespace |
LicenseManagement.EndUser namespace |
Hymma.Lm.EndUser.dll |
LicenseManagement.EndUser.dll |
NuGet: Hymma.Lm.EndUser |
NuGet: LicenseManagement.EndUser |
All classes, methods, and APIs remain unchanged - only the namespace has been updated for consistency.
Changelog
See CHANGELOG.md for version history and release notes.
License
MIT - See LICENSE for details.
Related Packages
- LicenseManagement.Client - Server-side SDK for vendors
- LicenseManagement.EndUser.Wpf - WPF UI components
Documentation
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET Framework | net481 is compatible. |
-
.NETFramework 4.8.1
- Hymma.HttpClientFactory (>= 1.0.8)
- Newtonsoft.Json (>= 13.0.3)
- System.Memory (>= 4.5.0)
- System.Threading.Tasks.Extensions (>= 4.5.2)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on LicenseManagement.EndUser:
| Package | Downloads |
|---|---|
|
LicenseManagement.EndUser.Avalonia
Avalonia UI components for license-management.com end-user SDK. Provides ready-to-use Window and UserControl components, view models, and converters for license registration and management workflows. Windows support (cross-platform requires netstandard EndUser package). |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.0 | 350 | 12/18/2025 |
BREAKING CHANGE: Renamed namespace from Hymma.Lm.EndUser to LicenseManagement.EndUser. Package ID changed from Hymma.Lm.EndUser to LicenseManagement.EndUser.