Spiffe 0.0.3
Prefix Reserveddotnet add package Spiffe --version 0.0.3
NuGet\Install-Package Spiffe -Version 0.0.3
<PackageReference Include="Spiffe" Version="0.0.3" />
<PackageVersion Include="Spiffe" Version="0.0.3" />
<PackageReference Include="Spiffe" />
paket add Spiffe --version 0.0.3
#r "nuget: Spiffe, 0.0.3"
#:package Spiffe@0.0.3
#addin nuget:?package=Spiffe&version=0.0.3
#tool nuget:?package=Spiffe&version=0.0.3
C# SPIFFE Library
Overview
The C# SPIFFE library provides functionality to interact with the Workload API to fetch X.509 and JWT SVIDs and Bundles.
C# implementation of spiffe/go-spiffe.
This library requires .NET 8.0 or higher.
Quick Start
Start SPIRE or another SPIFFE Workload API implementation.
To create an mTLS Kestrel server:
WebApplicationBuilder builder = WebApplication.CreateBuilder();
using GrpcChannel channel = GrpcChannelFactory.CreateChannel("unix:///tmp/agent.sock");
IWorkloadApiClient client = WorkloadApiClient.Create(channel);
using X509Source x509Source = await X509Source.CreateAsync(client);
builder.WebHost.UseKestrel(kestrel =>
{
kestrel.Listen(IPAddress.Any, 8443, listenOptions =>
{
listenOptions.UseHttps(new TlsHandshakeCallbackOptions
{
// Configure mTLS server options
OnConnection = ctx => ValueTask.FromResult(
SpiffeSslConfig.GetMtlsServerOptions(x509Source, Authorizers.AuthorizeAny())),
});
});
});
To dial an mTLS server:
GrpcChannel channel = GrpcChannelFactory.CreateChannel("unix:///tmp/agent.sock");
IWorkloadApiClient client = WorkloadApiClient.Create(channel);
X509Source x509Source = await X509Source.CreateAsync(client);
HttpClient http = new(new SocketsHttpHandler()
{
// Configure mTLS client options
SslOptions = SpiffeSslConfig.GetMtlsClientOptions(x509Source, Authorizers.AuthorizeAny()),
});
The client and server obtain X509-SVIDs and X.509 bundles from the SPIFFE Workload API. The X509-SVIDs are presented by each peer and authenticated against the X.509 bundles. Both sides continue to be updated with X509-SVIDs and X.509 bundles streamed from the Workload API (e.g. secret rotation).
Examples
The samples directory contains examples for a variety of circumstances.
| Product | Versions 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 is compatible. 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. |
-
net10.0
- Google.Protobuf (>= 3.32.1)
- Grpc.Net.Client (>= 2.71.0)
- Microsoft.IdentityModel.JsonWebTokens (>= 8.14.0)
-
net8.0
- Google.Protobuf (>= 3.32.1)
- Grpc.Net.Client (>= 2.71.0)
- Microsoft.IdentityModel.JsonWebTokens (>= 8.14.0)
-
net9.0
- Google.Protobuf (>= 3.32.1)
- Grpc.Net.Client (>= 2.71.0)
- Microsoft.IdentityModel.JsonWebTokens (>= 8.14.0)
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 |
|---|---|---|
| 0.0.3 | 837 | 1/18/2026 |
| 0.0.2 | 488 | 9/8/2025 |
| 0.0.1 | 887 | 4/15/2025 |
| 0.0.1-beta.11 | 107 | 2/26/2025 |
| 0.0.1-beta.10 | 209 | 11/6/2024 |
| 0.0.1-beta.9 | 87 | 11/6/2024 |
| 0.0.1-beta.6 | 84 | 8/27/2024 |
| 0.0.1-beta.5 | 102 | 4/7/2024 |
| 0.0.1-beta.4 | 111 | 3/23/2024 |
| 0.0.1-beta.3 | 105 | 3/23/2024 |
| 0.0.1-beta.2 | 106 | 3/23/2024 |
| 0.0.1-beta.1 | 106 | 3/23/2024 |