Encrypt
Encrypt a value and return the ciphertext.
The result is bound to an encryption context. Without with role, that context is your own user account, and nobody else can decrypt the result. With with role, the context is the role, so anyone holding that role can decrypt it.
Choose the context when you encrypt: a value encrypted under your user cannot later be decrypted under a role, or by another user, even an administrator.
To store a named value for commands to substitute at runtime, use a secret instead — Magpie encrypts those for you.
Syntax
encrypt "<value>" [with role <role reference>]
Parameters
value
String — The value to encrypt. May be given as a quoted string or, for values spanning lines, as a triple-quoted string.
role reference
String — Name of the role to encrypt under. Omit it to encrypt under your own user account.
Security
You must hold the role you name. Naming a role you do not hold fails with You are not authorized to use role "…".