HmacManager 2.10.0

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

HmacManager

NuGet Version NuGet Downloads .NET

HMAC request authentication for ASP.NET Core. Sign outgoing requests, verify incoming ones, or both — against named policies, with replay protection built in.

Targets net8.0 and net10.0.

📖 Documentation

Install

dotnet add package HmacManager

Verify incoming requests

AddHmac registers an authentication handler, so a request that fails verification never reaches your endpoint.

builder.Services
    .AddAuthentication()
    .AddHmac(options =>
    {
        options.AddPolicy("MyPolicy", policy =>
        {
            policy.UsePublicKey(Guid.Parse("00000000-0000-0000-0000-000000000001"));
            policy.UsePrivateKey("zvg29s2cQ4idOqbUJWETOw==");
            policy.UseMemoryCache(maxAgeInSeconds: 300); // nonce / replay window
        });
    });

var app = builder.Build();
app.UseAuthentication();
app.UseAuthorization();

Sign outgoing requests

Attach the handler to a named HttpClient and every request it sends is signed.

builder.Services
    .AddHttpClient("api", client => client.BaseAddress = new Uri("https://api.example.com"))
    .AddHmacHttpMessageHandler("MyPolicy");

Documentation

The full documentation lives at jzills.github.io/hmac-manager:

Registration AddHmacManager versus AddHmac, and schemes
Authorization Requiring a specific policy or scheme per endpoint
Configuration binding Policies from an IConfigurationSection
HttpClient Automatic signing, and why to prefer it
Events OnValidateKeys, OnAuthSuccess, OnAuthFailure
Dynamic policies Policies from a database, or changed at runtime
Custom signing content Replacing the default signing string
Logging Categories, levels, and diagnosing a mismatch

Concepts shared with the Kubernetes verifier and the TypeScript client — policies, schemes, signing content, nonce and replay — are documented once, under Concepts.

Logging at a glance

Every component writes to ILogger with no configuration required, and falls back to NullLogger when logging is not set up. Event ids are stable across releases and are listed in the event reference.

{
  "Logging": {
    "LogLevel": {
      "HmacManager": "Debug"
    }
  }
}

Private keys are never logged at any level, and a test asserts that over the full sign/verify path with every level enabled.

Source

github.com/jzills/hmac-manager

Product Compatible and additional computed target framework versions.
.NET 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 is compatible.  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. 
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
2.10.0 90 8/26/2026
2.9.0 102 8/15/2026
2.8.0 107 8/5/2026
2.7.0 122 7/3/2026
2.6.0 131 4/22/2026
Loading failed