pvNugsSecretManagerNc6Abstractions 6.0.0

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

pvNugs Secret Manager NC6 Abstractions

NuGet Version .NET License: MIT

A lightweight .NET 6 (LTS) abstraction library for secret management. This package exposes interfaces and contracts suitable for implementing providers that integrate with secret stores (Azure Key Vault, environment variables, vaults, etc.). It is the NC6-targeted sibling of the NC9 abstractions and intentionally keeps the API surface compatible with projects targeting .NET 6.

🔐 Features

  • Clear, minimal interfaces for static and dynamic secret retrieval
  • CancellationToken-aware methods for graceful shutdown and testing
  • Designed for easy DI registration and unit testing
  • Portable: implement your provider for Azure, AWS, HashiCorp, or custom stores
  • Focus on correctness and thread-safety for common usage patterns

📦 Installation

dotnet add package pvNugsSecretManagerNc6Abstractions

Or via Package Manager Console:

Install-Package pvNugsSecretManagerNc6Abstractions

🚀 Quick Start

  • Register your implementation with the DI container in a .NET 6 application (Program.cs):
// Program.cs (.NET 6 minimal host)
var builder = WebApplication.CreateBuilder(args);

// register your implementation
builder.Services.AddSingleton<IPvNugsStaticSecretManager, YourSecretManagerImplementation>();

var app = builder.Build();
app.Run();

Static Secret Retrieval (example)

public class DatabaseService
{
    private readonly IPvNugsStaticSecretManager _secretManager;

    public DatabaseService(IPvNugsStaticSecretManager secretManager)
    {
        _secretManager = secretManager;
    }

    public async Task<string> GetConnectionStringAsync(CancellationToken ct)
    {
        var password = await _secretManager.GetStaticSecretAsync("database-password", ct);
        return $"Server=myserver;Database=mydb;Password={password};";
    }
}

Dynamic Credential Retrieval (example)

public class SecureDataService
{
    private readonly IPvNugsDynamicSecretManager _secretManager;

    public SecureDataService(IPvNugsDynamicSecretManager secretManager)
    {
        _secretManager = secretManager;
    }

    public async Task UseDynamicCredentialAsync(CancellationToken ct)
    {
        var credential = await _secretManager.GetDynamicSecretAsync("app-db", ct);
        if (credential == null || DateTime.UtcNow >= credential.ExpirationDateUtc)
            throw new InvalidOperationException("Unable to obtain valid credentials");

        // use credential.Username and credential.Password
    }
}

🔧 Dependency Injection Setup

// Program.cs (register implementations)
services.AddSingleton<IPvNugsStaticSecretManager, YourSecretManagerImplementation>();
services.AddSingleton<IPvNugsDynamicSecretManager, YourDynamicSecretManagerImplementation>();

🛡️ Security Best Practices

  • Never log secrets in plaintext
  • Use managed identities or service principals when possible
  • Cache secrets carefully and respect expiration for dynamic credentials
  • Protect memory containing secrets and clear when finished

📋 Use Cases

  • Centralized static secret retrieval (API keys, connection strings)
  • Dynamic, short-lived database credentials
  • Multi-tenant or ephemeral environments needing credential rotation

🎯 Target Framework

  • .NET 6 (LTS) — designed for projects still running on .NET 6 while keeping the API consistent with the pvNugs ecosystem.

📚 Documentation

The package includes XML documentation for all public interfaces and members. See the repository for example implementations and tests.

🤝 Contributing

Part of the pvWayNugs ecosystem. Issues and pull requests are welcome: https://github.com/licheez/pvWayNugs

📄 License

MIT — see the LICENSE file for details.


Keywords: Secret Management, .NET 6, Abstractions, Dynamic Credentials, Static Secrets, pvWayNugs

Product Compatible and additional computed target framework versions.
.NET 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 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on pvNugsSecretManagerNc6Abstractions:

Package Downloads
pvNugsCsProviderNc6MsSql

Package Description

pvNugsSecretManagerNc6Azure

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
6.0.0 203 11/6/2025

Initial