Show / Hide Table of Contents

Struct Password

Password field for the Unity editor.

Namespace: sttz.Trimmer.Editor
Assembly: Trimmer-Editor.dll
Syntax
[Serializable]
public struct Password
Remarks

The password field gives the user two options to store the password:

  • Plaintext in the project itself. This leaves the password unprotected but allows it to be stored in the project and e.g. checked into version control.
  • Securely and on a per-user basis in the Keychain. The password will be saved on the user's computer and can be used across Unity projects.

The plaintext password can optionally be revealed in the editor. The Keychain password can only be set but not viewed.

Storing the password in the Keychain also requires a service and user name. You need to specify them using the KeychainAttribute and pass them to GetPassword(String). It's recommended to store the Keychain info in a const string so it can be used for the attribute and method:

const string keychainInfo = "UploadDistro:blah";
[Keychain(keychainInfo)] public Password password;
password.GetPassword(keychainInfo);

Properties

| Improve this Doc View Source

PlaintextPassword

The plaintext password if sttz.Trimmer.Editor.Password.useKeychain is false.

Declaration
public string PlaintextPassword { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

UseKeychain

Wether to use Keychain or store the password in plaintext.

Declaration
public bool UseKeychain { get; set; }
Property Value
Type Description
System.Boolean

Methods

| Improve this Doc View Source

GetPassword(String)

Use this method to retrieve the password based on where it's stored.

Declaration
public string GetPassword(string keychainInfo)
Parameters
Type Name Description
System.String keychainInfo
Returns
Type Description
System.String
  • Improve this Doc
  • View Source
Back to top © 2017 Adrian Stutz