OptFieldCrypt
trait OptFieldCrypt
Trait for storage classes that store a optionally-encrypted credential fields
The encryption uses the owner account's secret-key crypto (only accessible by them)
Traits
Trait allowing objects to store fields encrypted with an account's crypto
Properties
| private | $crypto_cache | Stores fields decrypted in memory |
from FieldCrypt |
Methods
Returns the list of fields encrypted in this object
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 command usage for Create()
Returns the command usage for Edit()
Returns the printable client object of this trait
Details
in
FieldCrypt at line 19
abstract static protected array
getEncryptedFields()
Returns the list of fields encrypted in this object
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
at line 161
static string
GetFieldCryptCreateUsage()
Returns the command usage for Create()
at line 164
OptFieldCrypt
FieldCryptCreate(Input $input)
Performs cred-crypt level initialization on a new storage
at line 172
static string
GetFieldCryptEditUsage()
Returns the command usage for Edit()
at line 175
OptFieldCrypt
FieldCryptEdit(Input $input)
Performs cred-crypt level edit on an existing storage
at line 185
array
GetFieldCryptClientObject()
Returns the printable client object of this trait