UserPass
trait UserPass
Trait for storage classes that store a possibly-encrypted username and password
Traits
Trait for storage classes that store a optionally-encrypted credential fields
Trait allowing objects to store fields encrypted with an account's crypto
Properties
| private | $crypto_cache | Stores fields decrypted in memory |
from FieldCrypt |
Methods
No description
Returns all objects owned by the given account
Gets the extra DB fields required for this trait
Decrypts and returns the value of the given field
Decrypts and returns the value of the given field
Sets the value of the given field
Loads any objects for the given account and decrypts their fields
Returns the printable client object of this trait
Gets the extra DB fields required for this trait
Returns the printable client object of this trait
Returns the command usage for Create()
Performs cred-crypt level initialization on a new storage
Returns the command usage for Edit()
Returns the decrypted username
Returns the decrypted password
Sets the stored username
Sets the stored password
Details
at line 21
static protected array
getEncryptedFields()
No description
in
FieldCrypt at line 22
abstract protected Account|null
GetAccount()
Returns the account that owns this object
in
FieldCrypt at line 25
abstract static array
LoadByAccount(ObjectDatabase $database, Account $account)
Returns all objects owned by the given account
in
FieldCrypt at line 28
static array
GetFieldCryptFieldTemplate()
Gets the extra DB fields required for this trait
in
FieldCrypt at line 35
protected bool
isFieldEncrypted($field)
Returns true if the given DB field is encrypted
in
FieldCrypt at line 39
protected bool
isCryptoAvailable()
Returns true if field crypto is unlockable
in
FieldCrypt at line 55
protected string
GetEncryptedScalar(string $field)
Decrypts and returns the value of the given field
in
FieldCrypt at line 63
protected Account
RequireCrypto()
Unlocks account crypto for usage and returns it
in
FieldCrypt at line 78
protected string|null
TryGetEncryptedScalar(string $field)
Decrypts and returns the value of the given field
in
FieldCrypt at line 103
protected FieldCrypt
SetEncryptedScalar(string $field, string|null $value, bool|null $fieldcrypt = null)
Sets the value of the given field
in
FieldCrypt at line 129
protected FieldCrypt
SetEncrypted(bool $crypt)
Sets the crypto state of all stored fields
in
FieldCrypt at line 145
static void
DecryptAccount(ObjectDatabase $database, Account $account)
Loads any objects for the given account and decrypts their fields
in
OptFieldCrypt at line 161
static string
GetFieldCryptCreateUsage()
Returns the command usage for Create()
in
OptFieldCrypt at line 164
OptFieldCrypt
FieldCryptCreate(Input $input)
Performs cred-crypt level initialization on a new storage
in
OptFieldCrypt at line 172
static string
GetFieldCryptEditUsage()
Returns the command usage for Edit()
in
OptFieldCrypt at line 175
OptFieldCrypt
FieldCryptEdit(Input $input)
Performs cred-crypt level edit on an existing storage
in
OptFieldCrypt at line 185
array
GetFieldCryptClientObject()
Returns the printable client object of this trait
at line 24
static array
GetFieldTemplate()
Gets the extra DB fields required for this trait
at line 36
array
GetClientObject(bool $activate = false)
Returns the printable client object of this trait
at line 45
static string
GetCreateUsage()
Returns the command usage for Create()
at line 48
static Storage
Create(ObjectDatabase $database, Input $input, FSManager $filesystem)
Performs cred-crypt level initialization on a new storage
at line 57
static string
GetEditUsage()
Returns the command usage for Edit()
at line 71
protected string|null
TryGetUsername()
Returns the decrypted username
at line 74
protected string|null
TryGetPassword()
Returns the decrypted password
at line 81
protected UserPass
SetUsername(string|null $username)
Sets the stored username
at line 89
protected UserPass
SetPassword(string|null $password)
Sets the stored password