SyntaxCircus.Credentials 0.1.1

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

SyntaxCircus.Credentials

Build NuGet License: MIT

A cross-platform desktop credential vault: Windows Credential Manager, macOS Keychain, Linux secret-tool/libsecret (with an AES-256 encrypted-file fallback when libsecret isn't available), and a factory that picks the right one for the current OS.

No support guaranteed. Published as-is and maintained on a best-effort basis. Issues and PRs are welcome, but there's no SLA — fork it or vendor what you need if that's not enough.

Setup

ICredentialStore store = CredentialStoreFactory.Create(
    new ProcessRunner(),
    loggerFactory,
    allowEncryptedFileFallback: false, // opt-in only — see below
    appName: "MyApp");

await store.SetAsync("my-service", "my-account", "secret-value");
string? secret = await store.GetAsync("my-service", "my-account");

Credentials are keyed by a (serviceId, accountId) pair, matching how OS keychains natively model credentials — serviceId is typically your app or the external service the secret belongs to, accountId the specific credential within it.

Platform behavior

  • WindowsWindows Credential Manager via Meziantou.Framework.Win32.CredentialManager. Works from a plain net10.0 TFM — no net10.0-windows multi-targeting required.
  • macOS — Keychain via the security CLI, shelled out through an injectable IProcessRunner (testable without spawning real processes).
  • Linuxsecret-tool/libsecret via the same IProcessRunner, if it's on PATH. Falls back to EncryptedFileCredentialStore automatically (with a one-time warning logged) on headless systems without a keyring daemon.
  • Anything elseCredentialStoreFactory.Create throws PlatformNotSupportedException by default. Pass allowEncryptedFileFallback: true to degrade to EncryptedFileCredentialStore instead — off by default because silently falling back to a weaker store is a decision your app should make explicitly, not one this package makes for you.

Encrypted-file fallback

EncryptedFileCredentialStore (AES-256-CBC, PBKDF2 key derivation off a machine-specific value + fixed salt) is usable directly too, not just as the Linux/unrecognized-platform fallback:

var store = new EncryptedFileCredentialStore(EncryptedFileCredentialStore.DefaultPathFor("MyApp"));

This is a last-resort store, not a substitute for a real OS keychain — the key derivation makes the file non-portable as plaintext-equivalent, not cryptographically hardened against an attacker with local account access.

Contributing

Issues and pull requests are welcome:

  • Keep changes focused, with a clear description of the behavior change.
  • Match the existing code style (see .editorconfig).
  • Call out any breaking changes to the public API in your PR description.

License

MIT — see LICENSE.txt.

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.1.1 120 8/16/2026