Skip to content

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

Type: String · required

Description of the key

Type: SymmetricCipher · read-only · default: "aes256Gcm"

Encryption algorithm, which cannot be changed after the key is created

Type: SecretKey · read-only

Base64-encoded 256-bit key (for example, generated with openssl rand -base64 32), which cannot be changed after the key is created

Type: String · server-set

Fingerprint of the key, used to detect a changed key file or environment variable

The SymmetricKey object is available via the urn:stalwart:jmap capability.

This is a standard Foo/get method as defined in RFC 8620, Section 5.1.

This method requires the sysSymmetricKeyGet permission.

Terminal window
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"
]
}'

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.

This operation requires the sysSymmetricKeyCreate permission.

Terminal window
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"
]
}'

This operation requires the sysSymmetricKeyUpdate permission.

Terminal window
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"
]
}'

This operation requires the sysSymmetricKeyDestroy permission.

Terminal window
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"
]
}'

This is a standard Foo/query method as defined in RFC 8620, Section 5.5.

This method requires the sysSymmetricKeyQuery permission.

Terminal window
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.

Terminal window
stalwart-cli get SymmetricKey id1
Terminal window
stalwart-cli create SymmetricKey \
--field description=Example
Terminal window
stalwart-cli query SymmetricKey
Terminal window
stalwart-cli update SymmetricKey id1 --field description='updated value'
Terminal window
stalwart-cli delete SymmetricKey --ids id1

A secret value provided directly, from an environment variable, or from a file.

A secret value provided directly.

Type: String · required · secret

Password or secret value

A secret value read from an environment variable.

Type: String · required

Environment variable name to read the secret from

A secret value read from a file.

Type: String · required

File path to read the secret from

ValueLabel
aes256GcmAES-256-GCM
chacha20Poly1305ChaCha20-Poly1305