Install
dotnet add package Meziantou.Framework.Win32.Lsa --version 2.0.20
| Product | Versions |
|---|---|
| .NET |
README
Meziantou.Framework.Win32.Lsa
.NET wrapper to get or set private data stored in Local Security Authority (LSA).
Usage
The LSA (Local Security Authority) private data storage is a secure Windows storage area that can be used to store sensitive data like credentials, secrets, and other private information. This library provides a simple .NET API to interact with LSA private data.
Note: Administrator privileges are required to set or remove values in LSA private data storage.
Store a value
using Meziantou.Framework.Win32;
// Requires administrator privileges
LsaPrivateData.SetValue("MySecretKey", "MySecretValue");
Retrieve a value
using Meziantou.Framework.Win32;
string? value = LsaPrivateData.GetValue("MySecretKey");
if (value != null)
{
Console.WriteLine($"Retrieved value: {value}");
}
else
{
Console.WriteLine("Key not found");
}
Remove a value
using Meziantou.Framework.Win32;
// Requires administrator privileges
LsaPrivateData.RemoveValue("MySecretKey");
Additional Resources
Changes from Previous Version
v2.0.19v2.0.20
Added Frameworks
net11.0
Adoption Assessment
A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.
Compatibility metadata lists 4 target frameworks; confirm the exact target used by your application.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.