Hymma.Lm.EndUser 1.3.0

Prefix Reserved
Suggested Alternatives

LicenseManagement.EndUser

Additional Details

use LicenseManagement.EndUser.Wpf instead

Requires NuGet 2.5 or higher.

dotnet add package Hymma.Lm.EndUser --version 1.3.0
                    
NuGet\Install-Package Hymma.Lm.EndUser -Version 1.3.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Hymma.Lm.EndUser" Version="1.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Hymma.Lm.EndUser" Version="1.3.0" />
                    
Directory.Packages.props
<PackageReference Include="Hymma.Lm.EndUser" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Hymma.Lm.EndUser --version 1.3.0
                    
#r "nuget: Hymma.Lm.EndUser, 1.3.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Hymma.Lm.EndUser@1.3.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Hymma.Lm.EndUser&version=1.3.0
                    
Install as a Cake Addin
#tool nuget:?package=Hymma.Lm.EndUser&version=1.3.0
                    
Install as a Cake Tool

LicenseManagement.EndUser

Build and Test NuGet NuGet Downloads License: MIT

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 Hymma.Lm.EndUser

Or via NuGet Package Manager:

Install-Package Hymma.Lm.EndUser

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.

Changelog

See CHANGELOG.md for version history and release notes.

License

MIT - See LICENSE for details.

Documentation

Product Compatible and additional computed target framework versions.
.NET Framework net481 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.3.0 401 12/15/2025 1.3.0 is deprecated because it is no longer maintained.
1.2.0 224 12/14/2025
1.0.6 194 12/14/2025
1.0.5 199 12/12/2025
1.0.4 178 12/12/2025
1.0.3 180 12/12/2025
1.0.2 173 12/12/2025
1.0.1 546 12/11/2025
1.0.0 476 12/11/2025

Updated to use Hymma.HttpClientFactory 1.0.8 with renamed assembly with Metadata property. Changed to List<MetadataEntry> for XML serialization compatibility. License files now saved with .lic extension with backwards compatibility.