SquidStd.Secrets.Aws 0.27.0

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

<h1 align="center">SquidStd.Secrets.Aws</h1>

AWS adapters for the two SquidStd secret seams: an ISecretProtector that envelope-encrypts payloads with AWS KMS data keys, and an ISecretStore backed by AWS Secrets Manager. Drop either into the container in place of the file-backed defaults to push key custody and secret storage into AWS-managed services, keeping the rest of the application unchanged.

Install

dotnet add package SquidStd.Secrets.Aws

Usage

using SquidStd.Secrets.Aws.Extensions;

// KMS-backed ISecretProtector (envelope encryption)
container.RegisterKmsSecretProtector(o =>
{
    o.KeyId    = "alias/my-app";   // KMS key id, ARN, or alias
    o.Aws.Region = "eu-west-1";
});

// Secrets Manager-backed ISecretStore
container.RegisterAwsSecretsManagerStore(o =>
{
    o.NamePrefix = "my-app/";       // optional logical namespace
    o.Aws.Region = "eu-west-1";
});

Both seams are then resolved like any other SquidStd secret service:

var protector = container.Resolve<ISecretProtector>();
byte[] sealed   = protector.Protect(payload);
byte[] restored = protector.Unprotect(sealed);

var store = container.Resolve<ISecretStore>();
await store.SetAsync("db/main", connectionString);
string? value = await store.GetAsync("db/main");
await foreach (var name in store.ListNamesAsync("db/")) { /* ... */ }

Key types

Type Purpose
KmsSecretProtector ISecretProtector using AWS KMS data keys (envelope encryption).
AwsSecretsManagerStore ISecretStore backed by AWS Secrets Manager.
KmsSecretProtectorOptions KMS key id/ARN/alias, region and credentials.
AwsSecretsManagerOptions Optional name prefix, region and credentials.

Notes

  • Envelope encryption - KmsSecretProtector calls GenerateDataKey per Protect, encrypts the payload locally with AES-256-GCM, and frames the KMS-wrapped data key alongside the ciphertext. The plaintext data key is zeroed immediately after use; Unprotect calls Decrypt to unwrap it. KMS never sees the payload, and large payloads are not bound by the 4 KB KMS direct-encrypt limit.
  • NamePrefix - AwsSecretsManagerStore prepends NamePrefix to every secret id, giving each application its own namespace inside a shared account. ListNamesAsync strips the prefix so callers always see logical names. Delete returns false for a missing secret.
  • Credentials - when Aws.AccessKey / Aws.SecretKey are omitted, the AWS SDK default credential chain is used (environment, shared profile, EC2/ECS role). Set Aws.ServiceUrl to target LocalStack or another compatible endpoint.
  • Tested against LocalStack - the KMS and Secrets Manager adapters are covered by integration tests running on a localstack/localstack container.

License

MIT - part of SquidStd.

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.

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.27.0 42 7/7/2026
0.26.0 34 7/7/2026
0.25.0 88 7/6/2026
0.24.1 85 7/6/2026
0.24.0 90 7/6/2026
0.23.0 91 7/4/2026
0.22.0 87 7/4/2026
0.21.0 90 7/3/2026
0.20.0 85 7/3/2026
0.19.0 90 7/3/2026
0.18.0 91 7/3/2026
0.17.0 95 7/3/2026
0.16.0 98 7/3/2026
0.15.0 90 7/2/2026
0.14.1 98 7/2/2026
0.14.0 93 7/2/2026
0.13.0 89 7/2/2026
0.12.0 93 7/2/2026
0.11.0 93 7/2/2026
0.10.0 94 6/30/2026
Loading failed