LicenseManagement.Client 1.2.0

dotnet add package LicenseManagement.Client --version 1.2.0
                    
NuGet\Install-Package LicenseManagement.Client -Version 1.2.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="LicenseManagement.Client" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LicenseManagement.Client" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="LicenseManagement.Client" />
                    
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 LicenseManagement.Client --version 1.2.0
                    
#r "nuget: LicenseManagement.Client, 1.2.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 LicenseManagement.Client@1.2.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=LicenseManagement.Client&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=LicenseManagement.Client&version=1.2.0
                    
Install as a Cake Tool

LicenseManagement.Client

Build and Test NuGet NuGet Downloads License: MIT

Server-side SDK for license-management.com - A license management platform for software vendors.

Features

  • License Management - Create, retrieve, and update licenses
  • Receipt Management - Manage purchase records and subscriptions
  • Computer Tracking - Register and track end-user devices
  • Product Management - Create and manage software products
  • Webhook Support - Full webhook lifecycle management with signature validation
  • Multi-Framework - Supports .NET Standard 2.0, .NET 6.0, and .NET 8.0

Installation

dotnet add package LicenseManagement.Client

Quick Start

Basic Setup

using LicenseManagement.Client;
using Microsoft.Extensions.DependencyInjection;

// Register the client in your DI container
services.AddLicenseManagementClient(options =>
{
    options.ApiKey = "MST_01ARZ3..."; // Your master API key
    options.BaseUrl = "https://license-management.com/api";
});

Using the Client

public class LicenseService
{
    private readonly ILicenseManagementClient _client;

    public LicenseService(ILicenseManagementClient client)
    {
        _client = client;
    }

    public async Task<License?> GetLicenseAsync(string productId, string computerId)
    {
        return await _client.GetLicenseAsync(productId, computerId);
    }

    public async Task<Receipt> CreateReceiptAsync(string productId, string buyerEmail, int qty)
    {
        return await _client.CreateReceiptAsync(new CreateReceiptRequest
        {
            Product = productId,
            BuyerEmail = buyerEmail,
            Qty = qty,
            Expires = DateTime.UtcNow.AddYears(1)
        });
    }
}

API Reference

Licenses

Method Description
GetLicenseAsync(productId, computerId) Get a license by product and computer
CreateLicenseAsync(request) Create a new trial license
UpdateLicenseAsync(request) Update a license (attach/detach receipt code)

Receipts

Method Description
GetReceiptAsync(code) Get a receipt by code
CreateReceiptAsync(request) Create a new receipt
UpdateReceiptAsync(request) Update receipt (qty, expires, email)
GenerateReceiptCodeAsync(productId, email) Generate a receipt code

Products

Method Description
GetProductAsync(productId) Get a product by ID
GetProductsAsync() Get all products for vendor
CreateProductAsync(request) Create a new product

Computers

Method Description
GetComputerAsync(macAddress) Get a computer by MAC address
RegisterComputerAsync(request) Register a new computer
GetComputersAsync(receiptCode) Get all computers for a receipt

Signing Keys

Method Description
GetPublicKeyAsync(format) Get vendor's public signing key (xml/pem)

Webhooks

Method Description
GetWebhooksAsync() List all webhooks
CreateWebhookAsync(request) Create a new webhook
UpdateWebhookAsync(webhookId, request) Update webhook configuration
DeleteWebhookAsync(webhookId) Delete a webhook
RotateWebhookSecretAsync(webhookId, immediate) Rotate signing secret
GetWebhookHealthAsync(webhookId) Get webhook health status
GetWebhookStatsAsync(webhookId) Get delivery statistics
ReplayWebhookDeliveryAsync(webhookId, deliveryId) Replay a failed delivery

Webhook Signature Validation

For ASP.NET Core applications (.NET 6.0+), use the built-in filter:

// Register webhook validation
services.AddLicenseManagementWebhooks(options =>
{
    options.Secret = "whsec_...";
    options.TimestampTolerance = TimeSpan.FromMinutes(5);
});

// Apply to controller
[HttpPost("webhook")]
[EnsureIsFromLicenseManagement]
public async Task<IActionResult> HandleWebhook([FromBody] WebhookPayload payload)
{
    // Signature is automatically validated
    return Ok();
}

Error Handling

try
{
    var license = await _client.GetLicenseAsync(productId, computerId);
}
catch (LicenseManagementException ex)
{
    Console.WriteLine($"Error: {ex.StatusCode} - {ex.Message}");
    // Handle specific status codes: 400, 401, 403, 404, 409, 422
}

Configuration Options

Option Description Default
ApiKey Master API key (MST_...) Required
BaseUrl API base URL https://license-management.com/api
Timeout HTTP request timeout 30 seconds

Requirements

  • .NET Standard 2.0+ / .NET 6.0+ / .NET 8.0+
  • Master API key from license-management.com

License

MIT - See LICENSE for details.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
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.2.0 361 12/16/2025
1.1.0 277 12/16/2025
1.0.0 425 12/11/2025