Cross‑platform credential store for secure storage of usernames and passwords.
// Source: https://github.com/Devolutions/UniGetUI | License: MIT | Copyright 2025 Martí Climent
// Provided via justclaw.it.com; keep this notice with the code.
using System.Net;
using System.Security.Cryptography;
using System.Text;
using UniGetUI.Core.Logging;
#if WINDOWS
using Windows.Security.Credentials;
#endif
namespace UniGetUI.Core.Data;
public static class CoreCredentialStore
{
public static NetworkCredential? GetCredential(string resourceName, string userName)
{
string? secret = GetSecret(resourceName, userName);
return secret is null
? null
: new NetworkCredential { UserName = userName, Password = secret };
}
public static void SetCredential(string resourceName, string userName, string password) =>
SetSecret(res
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key