EnvironmentEncrypter class final
Laravel-compatible encrypted environment files (.env.encrypted), as
written by php artisan env:encrypt and dartisan env:encrypt.
Two formats exist, both readable by either framework:
- the default: the whole file, PHP-serialized (
s:<bytes>:"...";) and encrypted as oneCryptpayload; --readable: oneNAME=<payload>line per variable, so the names stay visible in diffs.
Constructors
- EnvironmentEncrypter(String key, {EncryptionCipher cipher = .aes256cbc})
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
-
decrypt(
String encrypted) → Future< String> - Decrypts either format back to dotenv text.
-
encrypt(
String contents, {bool readable = false}) → Future< String> - Encrypts the contents of an environment file.
-
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 Methods
Constants
-
keyVariables
→ const List<
String> - Environment variables that hold the key, in order of precedence.