YubiHsmSharp.Client 2.7.3-alpha

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

YubiHsmSharp.Client

A .NET Aspire Client Integration that automatically configures a YubiHSM 2 client.

Registrations

The extension method AddYubiHsmClient registers the following types:

  • YubiModule - Singleton
  • YubiConnector - Scoped, pre-configured with URL
  • YubiSession - Scoped, pre-configured with Authentication Key ID and Password

The method also registers the following internal types, used to enhance observability, but not exposed to the application:

  • A health check that verifies connectivity and authentication for the corresponding YubiSession, unless DisableHealthChecks=true.
  • A background service that pulls metrics and logs from the corresponding YubiSession, unless both DisableMetrics=true and DisableDeviceLogs=true.

Example

The following code registers a YubiSession that is configured with a URL, Authentication Key ID, and Password retrieved from app configuration.

var builder = WebApplication.CreateBuilder(args);

builder.AddYubiHsmClient("yubihsm");

var app = builder.Build();

app.MapHealthChecks("/healthz");

app.MapPost("/blink", async (YubiSession session, int seconds) => {
    session.BlinkDevice(TimeSpan.FromSeconds(seconds));
    return Results.NoContent();
});

app.Run();

Demo

See YubiHsmSharp.Demo for a demo of this library.

Product Compatible and additional computed target framework versions.
.NET 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.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.7.3-alpha 0 6/14/2026