I am saving the credentails to the windows vault store using the credential manager API . But i need to keep it secure and also what is the maximum password limit length to do so.
Core Code to save and retrieve the credentails in the windows vault folder as below:
- //save password to the windows vault store using Credential Manager
- public void SavePassword(string password)
- {
- try
- {
- using (var cred = new Credential())
- {
- cred.Password = password;
- cred.Target = PasswordName;
- cred.Type = CredentialType.Generic;
- cred.PersistanceType = PersistanceType.LocalComputer;
- cred.Save();
- }
- }
- catch(Exception ex)
- {
- }
- }
- //retrieve password from the windows vault store using Credential Manager
- public string GetPassword()
- {
- try {
- using (var cred = new Credential())
- {
- cred.Target = PasswordName;
- cred.Load();
- return cred.Password;
- }
- }
- catch (Exception ex)
- {
- }
- return "";
- }
Venu Madhav DeeviPosted Dec 16, 2019, 11:14 PM
Uvaraja C, Did you got any solution for storing credentials in to "Windows Credentials" in stead of storing in "Generic Credentials"? We do have similar requirement and didn't get any solution from web.... When used the nuget provided in this post it is storing in "Generic Credentials".....
If anyone in the communitiy has achieved, please post that solution which will be useful for us to store the credentials in to "Windows Credentials" of Credential Manager store.....
J AlvarezPosted Jan 24, 2019, 4:52 PM
Uvaraja CPosted Jan 9, 2019, 7:18 AM