Class Keychain
Helper class to access secure password storage.
Inheritance
System.Object
Keychain
Namespace: sttz.Trimmer.Options
Assembly: Trimmer.dll
Syntax
public abstract class Keychain
Remarks
On macOS the system Keychain is used via the security
command
line utility. On Windows, ProtectedData is used to encrypt passwords,
which are then stored in EditorPrefs (ProtectedData uses Crypt32.dll's
CryptProtectData under the hood).
Properties
| Improve this Doc View SourceMain
Keychain instance that is backed by the system keychain.
Declaration
public static Keychain Main { get; }
Property Value
Type | Description |
---|---|
Keychain |
Methods
| Improve this Doc View SourceGetPassword(String, String)
Get a password from the Keychain.
Declaration
public abstract string GetPassword(string service, string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | service | Name of the service the password belongs to |
System.String | name | Name of the password |
Returns
Type | Description |
---|---|
System.String | The password or null if it doesn't exist in the Keychain |
SetPassword(String, String, String)
Add or update a password in the Keychain.
Declaration
public abstract void SetPassword(string service, string name, string password)
Parameters
Type | Name | Description |
---|---|---|
System.String | service | Name of the service the password belongs to |
System.String | name | Name of the password |
System.String | password | The password |