Nops.Core.Vault 1.1.0

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Nops.Core.Vault --version 1.1.0
                    
NuGet\Install-Package Nops.Core.Vault -Version 1.1.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="Nops.Core.Vault" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Nops.Core.Vault" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Nops.Core.Vault" />
                    
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 Nops.Core.Vault --version 1.1.0
                    
#r "nuget: Nops.Core.Vault, 1.1.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 Nops.Core.Vault@1.1.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=Nops.Core.Vault&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Nops.Core.Vault&version=1.1.0
                    
Install as a Cake Tool

Nops.Core.Vault

HashiCorp Vault Transit master key provider for Nops - in-process SOPS decryption.

Installation

dotnet add package Nops.Core.Vault

Usage

Vault Transit Secrets Engine

using Nops.Core;
using Nops.Core.Keys;

// Option 1: With Vault token
var masterKey = new VaultTransitMasterKey(
    address: "https://vault.example.com:8200",
    mountPath: "transit",
    keyName: "my-transit-key",
    token: "s.vault-token-here"
);

// Option 2: With custom HttpClient (e.g., for mTLS)
var httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.Add("X-Vault-Token", "s.vault-token-here");

var masterKey2 = new VaultTransitMasterKey(
    address: "https://vault.example.com:8200",
    mountPath: "transit",
    keyName: "my-transit-key",
    httpClient: httpClient
);

// Use with SopsFile
var result = await SopsFile.DecryptTreeAsync(
    fileBytes: File.ReadAllBytes("secrets.sops.yaml"),
    fileKind: "yaml",
    options: new SopsOptions
    {
        MasterKeys = new[] { masterKey }
    });

Authentication

Local Development with vault dev

# Start local Vault server
vault dev

# The token will be printed in the output, e.g.:
# Token: s.abcd1234efgh5678
export VAULT_TOKEN="s.abcd1234efgh5678"
export VAULT_ADDR="http://127.0.0.1:8200"

# Create a transit key
vault secrets enable transit
vault write -f transit/keys/sops-key

Production Authentication

  • Token: Pass X-Vault-Token header directly
  • AppRole: Use vault login -method=approle to get a token
  • Kubernetes: Use Kubernetes auth method
  • TLS/mTLS: Configure client certificates on the HttpClient

Vault Transit Setup

# Enable transit secrets engine (if not already enabled)
vault secrets enable transit

# Create a transit key
vault write -f transit/keys/sops-wrapping-key

# Grant permissions to your identity (decrypting needs "update" on the decrypt path)
vault policy write sops-policy - <<EOF
path "transit/decrypt/sops-wrapping-key" {
  capabilities = ["update"]
}
EOF

Running Tests

The unit tests need no Vault server. They use a mock HttpClient, plus a file written by real sops against a mock transit engine (see tests/Nops.Core.Vault.Tests/Fixtures/README.md):

dotnet test tests/Nops.Core.Vault.Tests

License

MIT - see LICENSE.

sops' hckms key type is Huawei Cloud KMS, which Nops does not support.

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
1.1.1 117 10/25/2026
1.1.0 106 10/25/2026
1.0.0 106 10/25/2026
1.0.0-preview.1 70 10/10/2026