Skip to content

uMonitor/vaultmanager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

https://www.nuget.org/packages/vaultmanager/

vaultsharp

  • .net API to manage access to WindowsCredentialManager. Wrapper implementation around native apis.

WindowsCredentialManager class

public enum CredentialPersistence: uint
{
    Session = 1,
    LocalMachine = 2,
    Enterprise = 3
}
    
public static void WriteCredentials(string applicationName, string userName, string secret, int credentialPersistence);
public static Credential ReadCredential(string applicationName);
public static List<Credential> EnumerateCredentials();

List credentials

var credentials = WindowsCredentialManager.EnumerateCredentials();
foreach (var cred in credentials)
{
    Trace.WriteLine(cred);
}

Read a credential to the credential manager

var credential = WindowsCredentialManager.ReadCredential("git:https://github.com");
Trace.WriteLine(credential);

Note, the password is written out as base64 string.

Write a credential

WindowsCredentialManager.WriteCredential("applicationName",
                                         "username", "password", 
                                         (int)CredentialPersistence.LocalMachine);

Note, that password encryption is up to the caller to set it. If password is set in clear, then it can be read in clear.

About

WindowsCredential reader/writer

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages