DVFieldEncryption class
How generated models reach the field cipher.
The keyring is read from the server process environment through
DVSecrets and never from anything the generator writes. That is the
whole point of the split: generated model code is compiled into the
application bundle as well as the server, so a key that lived in
generated code would ship to every visitor. Only PUBLIC_-prefixed values
reach the generated environment, and a browser has no environment to read
at all, so on the web this resolves to nothing and an encrypted field
raises rather than storing plaintext.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- isAvailable → bool
-
Whether an encrypted field can be read or written in this process.
no setter
Static Methods
-
configure(
DVFieldCipher? cipher) → void - Supplies the cipher directly, for a host that loads keys from a manager rather than the environment, and for tests.
-
decrypt(
String model, String field, String? value) → String? - Opens a stored value.
-
encrypt(
String model, String field, String? value) → String? -
Seals
valuefor storage. Null passes through, so an optional column stays empty rather than holding a ciphertext of the empty string that everyIS NULLquery would then miss. -
reset(
) → void - Drops a configured cipher and the parsed keyring.
Constants
- secretName → const String
- The environment variable holding the keyring, newest key first.