SymmetricKey
Defines a symmetric key used to encrypt blobs at rest. Blobs encrypted with a key cannot be read without it, so keys can only be deleted by the recovery administrator.
This object can be configured from the WebUI under Settings › Encryption › Symmetric Keys
Fields
Section titled “Fields”description
Section titled “description”Type:
String· requiredDescription of the key
cipher
Section titled “cipher”Type:
SymmetricCipher· read-only · default:"aes256Gcm"Encryption algorithm, which cannot be changed after the key is created
Type:
SecretKey· read-onlyBase64-encoded 256-bit key (for example, generated with
openssl rand -base64 32), which cannot be changed after the key is created
fingerprint
Section titled “fingerprint”Type:
String· server-setFingerprint of the key, used to detect a changed key file or environment variable
JMAP API
Section titled “JMAP API”The SymmetricKey object is available via the urn:stalwart:jmap capability.
x:SymmetricKey/get
Section titled “x:SymmetricKey/get”This is a standard Foo/get method as defined in RFC 8620, Section 5.1.
This method requires the sysSymmetricKeyGet permission.
curl -X POST https://mail.example.com/jmap/ \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:SymmetricKey/get", { "ids": [ "id1" ] }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'x:SymmetricKey/set
Section titled “x:SymmetricKey/set”This is a standard Foo/set method as defined in RFC 8620, Section 5.3.
Supports the following operations in a single call: create, update, destroy.
Create
Section titled “Create”This operation requires the sysSymmetricKeyCreate permission.
curl -X POST https://mail.example.com/jmap/ \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:SymmetricKey/set", { "create": { "new1": { "description": "Example" } } }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'Update
Section titled “Update”This operation requires the sysSymmetricKeyUpdate permission.
curl -X POST https://mail.example.com/jmap/ \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:SymmetricKey/set", { "update": { "id1": { "description": "updated value" } } }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'Destroy
Section titled “Destroy”This operation requires the sysSymmetricKeyDestroy permission.
curl -X POST https://mail.example.com/jmap/ \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:SymmetricKey/set", { "destroy": [ "id1" ] }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'x:SymmetricKey/query
Section titled “x:SymmetricKey/query”This is a standard Foo/query method as defined in RFC 8620, Section 5.5.
This method requires the sysSymmetricKeyQuery permission.
curl -X POST https://mail.example.com/jmap/ \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:SymmetricKey/query", { "filter": {} }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.
stalwart-cli get SymmetricKey id1Create
Section titled “Create”stalwart-cli create SymmetricKey \ --field description=Examplestalwart-cli query SymmetricKeyUpdate
Section titled “Update”stalwart-cli update SymmetricKey id1 --field description='updated value'Delete
Section titled “Delete”stalwart-cli delete SymmetricKey --ids id1Nested types
Section titled “Nested types”SecretKey
Section titled “SecretKey”A secret value provided directly, from an environment variable, or from a file.
Value: Secret value. Carries the fields ofSecretKeyValue.EnvironmentVariable: Secret read from environment variable. Carries the fields ofSecretKeyEnvironmentVariable.File: Secret read from file. Carries the fields ofSecretKeyFile.
SecretKeyValue
Section titled “SecretKeyValue”A secret value provided directly.
secret
Section titled “secret”Type:
String· required · secretPassword or secret value
SecretKeyEnvironmentVariable
Section titled “SecretKeyEnvironmentVariable”A secret value read from an environment variable.
variableName
Section titled “variableName”Type:
String· requiredEnvironment variable name to read the secret from
SecretKeyFile
Section titled “SecretKeyFile”A secret value read from a file.
filePath
Section titled “filePath”Type:
String· requiredFile path to read the secret from
SymmetricCipher
Section titled “SymmetricCipher”| Value | Label |
|---|---|
aes256Gcm | AES-256-GCM |
chacha20Poly1305 | ChaCha20-Poly1305 |