Certificate
Certificate
Section titled “Certificate”Defines a TLS certificate and its associated private key.
This object can be configured from the WebUI under Settings › TLS › Certificates
Fields
Section titled “Fields”certificate
Section titled “certificate”Type:
PublicText· requiredTLS certificate in PEM format
privateKey
Section titled “privateKey”Type:
SecretText· requiredPrivate key in PEM format
subjectAlternativeNames
Section titled “subjectAlternativeNames”Type:
String[]· server-setSubject Alternative Names (SAN) for the certificate
notValidAfter
Section titled “notValidAfter”Type:
UTCDateTime· server-setExpiration date of the certificate
notValidBefore
Section titled “notValidBefore”Type:
UTCDateTime· server-setIssuance date of the certificate
issuer
Section titled “issuer”Type:
String· server-setCertificate issuer
JMAP API
Section titled “JMAP API”The Certificate object is available via the urn:stalwart:jmap capability.
x:Certificate/get
Section titled “x:Certificate/get”This is a standard Foo/get method as defined in RFC 8620, Section 5.1.
This method requires the sysCertificateGet permission.
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" ] }'x:Certificate/set
Section titled “x:Certificate/set”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.
Create
Section titled “Create”This operation requires the sysCertificateCreate permission.
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" ] }'Update
Section titled “Update”This operation requires the sysCertificateUpdate permission.
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" ] }'Destroy
Section titled “Destroy”This operation requires the sysCertificateDestroy permission.
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" ] }'x:Certificate/query
Section titled “x:Certificate/query”This is a standard Foo/query method as defined in RFC 8620, Section 5.5.
This method requires the sysCertificateQuery permission.
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):
| Condition | Kind |
|---|---|
text | text |
stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.
stalwart-cli get Certificate id1Create
Section titled “Create”stalwart-cli create Certificate \ --field 'certificate={"@type":"Text","value":"Example"}' \ --field 'privateKey={"@type":"Text","secret":"Example"}'stalwart-cli query Certificatestalwart-cli query Certificate --where text=exampleUpdate
Section titled “Update”stalwart-cli update Certificate id1 --field certificate='{"@type":"Text","value":"Example"}'Delete
Section titled “Delete”stalwart-cli delete Certificate --ids id1Nested types
Section titled “Nested types”PublicText
Section titled “PublicText”A text value provided directly, from an environment variable, or from a file.
Text: Text value. Carries the fields ofPublicTextValue.EnvironmentVariable: Text value read from environment variable. Carries the fields ofSecretKeyEnvironmentVariable.File: Text value read from file. Carries the fields ofSecretKeyFile.
PublicTextValue
Section titled “PublicTextValue”A text value provided directly.
Type:
Text· requiredText 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
SecretText
Section titled “SecretText”A secret text value provided directly, from an environment variable, or from a file.
Text: Secret value. Carries the fields ofSecretTextValue.EnvironmentVariable: Secret read from environment variable. Carries the fields ofSecretKeyEnvironmentVariable.File: Secret read from file. Carries the fields ofSecretKeyFile.
SecretTextValue
Section titled “SecretTextValue”A secret text value provided directly.
secret
Section titled “secret”Type:
Text· required · secretPassword or secret value