GnomeStack.Secrets.OperatingSystem 0.1.6

dotnet add package GnomeStack.Secrets.OperatingSystem --version 0.1.6
NuGet\Install-Package GnomeStack.Secrets.OperatingSystem -Version 0.1.6
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="GnomeStack.Secrets.OperatingSystem" Version="0.1.6" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add GnomeStack.Secrets.OperatingSystem --version 0.1.6
#r "nuget: GnomeStack.Secrets.OperatingSystem, 0.1.6"
#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.
// Install GnomeStack.Secrets.OperatingSystem as a Cake Addin
#addin nuget:?package=GnomeStack.Secrets.OperatingSystem&version=0.1.6

// Install GnomeStack.Secrets.OperatingSystem as a Cake Tool
#tool nuget:?package=GnomeStack.Secrets.OperatingSystem&version=0.1.6

GnomeStack.Secrets.OperatingSystem

Provides KeyTar like support for libsecret, Windows Credential Manager, and macOS Keychain for .NET.

The main class OsSecretVault does not yet support listing credential as the Darwin ("MacOS") implementation does not yet implement it. It does support setting, getting, and deleting credentials.

Similar to node-keytar, the linux implementation uses libsecret. OsSecretVault and the LibSecret class requires libsecret and the gnome-keyring schema to be installed. No promises on supporting other schemas at this time.

  • Debian/Ubuntu: sudo apt-get install libsecret-1-dev
  • Red Hat-based: sudo yum install libsecret-devel
  • Arch Linux: sudo pacman -S libsecret

The macOS implementation uses the Keychain API and windows uses the Credential Manager API. The windows implementation uses Enterprise persistence by default. If you want to use local persistence, you'll need to use the WinCredManager class directly.

Usage

using GnomeStack.Standard;

// basically service, account, password
OsSecretVault.SetSecret("myapp", "myuser", "mypassword"); // you can also pass in a byte[] instead of a string
var password = OsSecretVault.GetSecret("myapp", "myuser");

// Various options for getting the password
// such as byte and char arrays. Array values can be cleared from memory.
// Strings can not be cleared from memory as they are immutable in .NET.  
// SecureString is provided to support powershell despite Microsoft
// wanting to deprecate SecureString because of its lack of support
// for encryption on operating systems outside of Windows.
var pwBytes = OsSecretVault.GetSecretAsBytes("myapp", "myuser");
var pwChars = OsSecretVault.GetSecretAsChars("myapp", "myuser");
var secureString = OsSecretVault.GetSecretAsSecureString("myapp", "myuser");
OsSecretVault.DeleteSecret("myapp", "myuser");

You may call the os specific implementations directly or use their implementation of IOsSecretVault which is a provider for OsSecretVault.

MIT License

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  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 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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

  • net6.0

    • No dependencies.
  • net8.0

    • No dependencies.

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.6 112 1/27/2024
0.1.5 84 1/18/2024

# CHANGE LOG

## 0.1.6

- Lib GnomeStack.Core reverted Env back to older API.

## 0.1.5

- Move source to github.com/gnomestack/dotnet-std from github.com/gnomestack/dotnet
- Change library name from Os.Secrets to Gnomestack.Secrets.OperatingSystem.
- Change namespaces to well known namespaces within Gnomestack.
- Move OsSecretsVault to Standard namespace
- Move implements to GnomeStack.Secrets.{Os}

## 0.1.2 initial creation

- Initial creation with basic functionality for Linux, Windows, and MacOS.
- Implement GetSecret, SetSecret, and DeleteSecret.
- Attempt to implement basic compatibility with node-keytar.