VaultaX 1.1.2
Requires NuGet 6.0 or higher.
dotnet add package VaultaX --version 1.1.2
NuGet\Install-Package VaultaX -Version 1.1.2
<PackageReference Include="VaultaX" Version="1.1.2" />
<PackageVersion Include="VaultaX" Version="1.1.2" />
<PackageReference Include="VaultaX" />
paket add VaultaX --version 1.1.2
#r "nuget: VaultaX, 1.1.2"
#:package VaultaX@1.1.2
#addin nuget:?package=VaultaX&version=1.1.2
#tool nuget:?package=VaultaX&version=1.1.2

VaultaX
HashiCorp Vault Integration for .NET 10+
VaultaX is a comprehensive .NET library for seamless HashiCorp Vault integration. It provides transparent secret management where Vault secrets automatically overlay your appsettings.json values, automatic token renewal, and support for multiple secret engines including KV, Transit (for signing/encryption), and PKI.
Built exclusively for .NET 10 with C# 14, VaultaX leverages modern language features and offers a clean, fluent API that integrates naturally with ASP.NET Core and the Microsoft.Extensions ecosystem.
π Support the Project
VaultaX is a passion project, driven by the desire to provide a truly modern Vault integration for the .NET community. Maintaining this library requires significant effort: staying current with each .NET release, addressing issues promptly, implementing new features, keeping documentation up to date, and ensuring compatibility with HashiCorp Vault updates.
If VaultaX has helped you build better applications or saved you development time, I would be incredibly grateful for your support. Your contributionβno matter the sizeβhelps me dedicate time to respond to issues quickly, implement improvements, and keep the library evolving alongside the .NET platform.
I'm also looking for sponsors who believe in this project's mission. Sponsorship helps ensure VaultaX remains actively maintained and continues to serve the .NET community for years to come.
Of course, there's absolutely no obligation. If you prefer, simply starring the repository or sharing VaultaX with fellow developers is equally appreciated!
β Star the repository on GitHub to raise its visibility
π¬ Share VaultaX with your team or community
β Support via Donations:
β¨ Features
- Transparent Configuration: Vault secrets automatically overlay
appsettings.json - Multiple Authentication Methods: Token, AppRole, Kubernetes, LDAP, JWT, AWS, Azure, and more
- Secret Engines: KV v1/v2, Transit (signing & encryption), PKI (certificates)
- Automatic Token Renewal: Background service keeps tokens fresh
- Hot Reload: Configuration updates without restart via
IOptionsMonitor - Health Checks: Built-in ASP.NET Core health check integration
- Configuration Options: appsettings.json or Fluent API
- Environment Variables: Use
env:VARIABLE_NAMEfor sensitive values
π What's New in 1.1.0
- Transit certificate chain support β associate X.509 certificate chains with Transit signing keys and retrieve the end-entity serial at signing time. Designed for regulatory signing flows (e.g., STP/Banxico) that require the cert serial to travel alongside the Vault-produced signature.
ITransitEngine.SetCertificateChainAsync(keyName, pem, keyVersion?)ITransitEngine.GetCertificateChainAsync(keyName, version?)β PEM string ornullITransitEngine.GetCertificateSerialAsync(keyName, version?, SerialFormat.Decimal | SerialFormat.Hex)TransitKeyInfo.CertificateChainβ populated automatically byGetKeyInfoAsync
- Raw HTTP escape hatch β
IVaultClient.SendRawRequestAsync<TResponse>(method, relativePath, body?)for Vault endpoints not covered by VaultSharp. 404 βnull; other non-success βVaultOperationException.
See the full changelog for details.
π Getting Started
Integrating VaultaX into your .NET 10+ application is straightforward.
1. Install the NuGet Package:
dotnet add package VaultaX
2. Configure appsettings.json:
{
"VaultaX": {
"Enabled": true,
"Address": "https://vault.example.com:8200",
"MountPoint": "secret",
"BasePath": "production",
"Authentication": {
"Method": "AppRole",
"RoleId": "env:VAULT_ROLE_ID",
"SecretId": "env:VAULT_SECRET_ID"
},
"Mappings": [
{
"SecretPath": "database",
"Bindings": {
"connectionString": "ConnectionStrings:DefaultConnection"
}
}
]
}
}
3. Register in Program.cs:
var builder = WebApplication.CreateBuilder(args);
// Add Vault as configuration source (secrets override appsettings)
builder.Configuration.AddVaultaX();
// Register VaultaX services
builder.Services.AddVaultaX(builder.Configuration);
// Add health checks
builder.Services.AddHealthChecks()
.AddVaultaX();
var app = builder.Build();
app.MapHealthChecks("/health");
app.Run();
4. Use Secrets Transparently:
public class MyService(IConfiguration configuration)
{
// This value comes from Vault if configured, otherwise from appsettings.json
private readonly string _connectionString = configuration.GetConnectionString("DefaultConnection");
}
π Secret Engines
Key-Value Engine
public class SecretService(IKeyValueEngine kvEngine)
{
public async Task<string> GetApiKeyAsync()
{
var secrets = await kvEngine.GetSecretAsync("api-keys");
return secrets["apiKey"]?.ToString();
}
}
Transit Engine (Signing & Encryption)
The Transit engine keeps private keys secure in Vault:
public class DocumentSigningService(ITransitEngine transitEngine)
{
public async Task<string> SignDocumentAsync(byte[] documentHash)
{
var response = await transitEngine.SignAsync(new TransitSignRequest
{
KeyName = "document-signing-key",
Data = documentHash,
HashAlgorithm = TransitHashAlgorithm.Sha256,
Prehashed = true
});
return response.Signature;
}
public async Task<string> EncryptAsync(string plaintext)
{
var data = Encoding.UTF8.GetBytes(plaintext);
return await transitEngine.EncryptAsync("encryption-key", data);
}
}
Certificate Chain Support (v1.1.0+)
When your signing flow needs to expose the X.509 serial of the cert associated with the Transit key (e.g., Banxico/STP requires the serial alongside every signed payment), associate the PEM chain once and read the serial at signing time:
// Associate the cert chain with the key (one-time setup, or after each key rotation)
await transitEngine.SetCertificateChainAsync(
keyName: "document-signing-key",
pemCertificateChain: pemChain);
// At signing time β resolve the serial dynamically
var signResponse = await transitEngine.SignAsync(signRequest);
var certSerial = await transitEngine.GetCertificateSerialAsync(
keyName: "document-signing-key",
version: signResponse.KeyVersion,
format: SerialFormat.Decimal); // "Hex" also available
Returns null if no certificate has been associated with the key (or Vault is older than 1.16). Consider caching the serial per (keyName, keyVersion) β it only changes when the key is rotated.
PKI Engine (Certificates)
public class CertificateService(IPkiEngine pkiEngine)
{
public async Task<PkiCertificateResponse> IssueCertificateAsync(string commonName)
{
return await pkiEngine.IssueCertificateAsync(new PkiCertificateRequest
{
RoleName = "web-server",
CommonName = commonName,
Ttl = "720h"
});
}
}
π Versioning & .NET Support Policy
VaultaX follows a clear versioning strategy aligned with .NET's release cadence:
Version History
| VaultaX | .NET | C# | Status |
|---|---|---|---|
| 1.x | .NET 10 | C# 14 | Current |
Future Support Policy
VaultaX will always support the current LTS version plus the next standard release:
| VaultaX | .NET | Notes |
|---|---|---|
| 1.x | .NET 10 | LTS only |
| 2.x | .NET 10 + .NET 11 | LTS + Standard |
| 3.x | .NET 12 | New LTS (drops .NET 10/11) |
π Documentation
Comprehensive guides to help you master VaultaX:
Getting Started
- Getting Started - Installation, basic setup, and first configuration
- Configuration - Complete configuration reference
Core Features
- Authentication - All authentication methods explained
- Secret Engines - KV, Transit, and PKI engines
- Signing - Document signing with Transit engine
Advanced Topics
- Hot Reload - Automatic configuration updates
- Health Checks - Monitoring and health endpoints
- Migration - Migrating from other Vault libraries
- Troubleshooting - Common issues and solutions
Examples
Check out the samples folder for complete working examples.
Tools
- Terraform Configuration - Infrastructure as Code for provisioning Vault secrets
π Acknowledgments
VaultaX is built on top of VaultSharp, an excellent low-level Vault client for .NET. VaultaX provides a higher-level abstraction focused on configuration integration and modern .NET patterns.
VaultSharp Project: VaultSharp on GitHub
| Product | Versions 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. |
-
net10.0
- Microsoft.Extensions.Configuration (>= 10.0.8)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.8)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.8)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.8)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.8)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.8)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.8)
- Microsoft.Extensions.Options (>= 10.0.8)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.8)
- VaultSharp (>= 1.17.5.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
v1.1.2 - Republish bump of 1.1.1 (version-only change). Original 1.1.1: Fix raw HTTP authentication in VaultClientWrapper.SendRawRequestAsync β GetCertificateChainAsync, GetCertificateSerialAsync, and SetCertificateChainAsync now correctly attach the Vault token for Token-based auth. Restores intended behavior of v1.1.0 certificate chain feature.