Skip to content

Certificate

Defines a TLS certificate and its associated private key.

This object can be configured from the WebUI under Settings › TLS › Certificates

Type: PublicText · required

TLS certificate in PEM format

Type: SecretText · required

Private key in PEM format

Type: String[] · server-set

Subject Alternative Names (SAN) for the certificate

Type: UTCDateTime · server-set

Expiration date of the certificate

Type: UTCDateTime · server-set

Issuance date of the certificate

Type: String · server-set

Certificate issuer

The Certificate 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 sysCertificateGet permission.

Terminal window
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:Certificate/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 create, update, and destroy operations in a single call.

This operation requires the sysCertificateCreate permission.

Terminal window
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:Certificate/set",
{
"create": {
"new1": {
"certificate": {
"@type": "Text",
"value": "Example"
},
"privateKey": {
"@type": "Text",
"secret": "Example"
}
}
}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'

This operation requires the sysCertificateUpdate permission.

Terminal window
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:Certificate/set",
{
"update": {
"id1": {
"certificate": {
"@type": "Text",
"value": "Example"
}
}
}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'

This operation requires the sysCertificateDestroy permission.

Terminal window
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:Certificate/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 sysCertificateQuery permission.

Terminal window
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:Certificate/query",
{
"filter": {
"text": "example"
}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'

The x:Certificate/query filter argument accepts the following conditions (combinable with AnyOf / AllOf / Not per RFC 8620):

ConditionKind
texttext

stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.

Terminal window
stalwart-cli get Certificate id1
Terminal window
stalwart-cli create Certificate \
--field 'certificate={"@type":"Text","value":"Example"}' \
--field 'privateKey={"@type":"Text","secret":"Example"}'
Terminal window
stalwart-cli query Certificate
stalwart-cli query Certificate --where text=example
Terminal window
stalwart-cli update Certificate id1 --field certificate='{"@type":"Text","value":"Example"}'
Terminal window
stalwart-cli delete Certificate --ids id1

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

A text value provided directly.

Type: Text · required

Text 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

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

A secret text value provided directly.

Type: Text · required · secret

Password or secret value