ExternalPublicKey
Public key of a remote recipient used by the encryption gateway, entered manually, kept up to date from a discovery method or learned from received mail.
This object can be configured from the WebUI under Settings › Encryption › External Public Keys, Settings › Encryption › Pending Key Changes
Fields
Section titled “Fields”emailAddress
Section titled “emailAddress”Type:
EmailAddress· requiredAddress the key is used for
Type:
Text?OpenPGP key or S/MIME certificate, armored, PEM, or binary encoded as base64; an S/MIME certificate may be followed by its intermediate certificates
description
Section titled “description”Type:
String?Description of the key
status
Section titled “status”Type:
ExternalPublicKeyStatus· default:"active"Whether the key is used
pinned
Section titled “pinned”Type:
Boolean· default:falseNever replace this key automatically
authenticatedEncryption
Section titled “authenticatedEncryption”Type:
Boolean· default:falseAll mail clients holding the private key can read AES-GCM with RSA-OAEP. Applies to S/MIME RSA and elliptic-curve keys. Apple Mail and Thunderbird ESR cannot read it.
source
Section titled “source”Type:
KeySource· default:{"@type":"Manual"}Where the key comes from; it cannot be changed once the key is created
Type:
KeyTrust· server-setTrust level derived from the source and certificate validation
Type:
PublicKeyKind?· server-setType of key, taken from the key itself
keyType
Section titled “keyType”Type:
String?· server-setType of key and its encryption algorithms, taken from the key itself
fingerprint
Section titled “fingerprint”Type:
String?· server-setFingerprint of the key or certificate used for encryption
capabilities
Section titled “capabilities”Type:
Set<PublicKeyCapability>· server-setEncryption features supported by the key
smimeCiphers
Section titled “smimeCiphers”Type:
Set<SmimeCipher>· server-setContent encryption algorithms advertised by the recipient in signed S/MIME messages
smimeOaep
Section titled “smimeOaep”Type:
Boolean· server-set · default:falseWhether the recipient advertised support for RSA-OAEP in signed S/MIME messages
smimeSignedAt
Section titled “smimeSignedAt”Type:
UTCDateTime?· server-setSigning time of the message the S/MIME capabilities were learned from
firstSeen
Section titled “firstSeen”Type:
UTCDateTime· server-setWhen the key was first stored
lastSeen
Section titled “lastSeen”Type:
UTCDateTime· server-setWhen the key was last seen in a discovery result or received message
lastChecked
Section titled “lastChecked”Type:
UTCDateTime?· server-setWhen the key was last confirmed by its discovery method or certificate check
nextCheckAt
Section titled “nextCheckAt”Type:
UTCDateTime?· server-setWhen the key is next fetched or checked
expiresAt
Section titled “expiresAt”Type:
UTCDateTime?· server-setWhen the key stops being used: its own expiration date or, for keys from DNSSEC, the end of the DNS TTL
nextKey
Section titled “nextKey”Type:
Text?· server-setReplacement key waiting for approval, or for the current key to expire
nextKeyType
Section titled “nextKeyType”Type:
String?· server-setType of the replacement key and its encryption algorithms
nextFingerprint
Section titled “nextFingerprint”Type:
String?· server-setFingerprint of the replacement key
nextCapabilities
Section titled “nextCapabilities”Type:
Set<PublicKeyCapability>· server-setEncryption features supported by the replacement key
nextExpiresAt
Section titled “nextExpiresAt”Type:
UTCDateTime?· server-setExpiration date of the replacement key
blockedFingerprints
Section titled “blockedFingerprints”Type:
Set<String>· server-setFingerprints of keys that were revoked or rejected and are not accepted again
JMAP API
Section titled “JMAP API”The ExternalPublicKey object is available via the urn:stalwart:jmap capability.
x:ExternalPublicKey/get
Section titled “x:ExternalPublicKey/get”This is a standard Foo/get method as defined in RFC 8620, Section 5.1.
This method requires the sysExternalPublicKeyGet permission.
curl -X POST https://mail.example.com/jmap/ \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:ExternalPublicKey/get", { "ids": [ "id1" ] }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'x:ExternalPublicKey/set
Section titled “x:ExternalPublicKey/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 sysExternalPublicKeyCreate permission.
curl -X POST https://mail.example.com/jmap/ \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:ExternalPublicKey/set", { "create": { "new1": { "emailAddress": "[email protected]", "source": { "@type": "Manual" } } } }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'Update
Section titled “Update”This operation requires the sysExternalPublicKeyUpdate permission.
curl -X POST https://mail.example.com/jmap/ \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:ExternalPublicKey/set", { "update": { "id1": { "key": "updated value" } } }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'Destroy
Section titled “Destroy”This operation requires the sysExternalPublicKeyDestroy permission.
curl -X POST https://mail.example.com/jmap/ \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:ExternalPublicKey/set", { "destroy": [ "id1" ] }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'x:ExternalPublicKey/query
Section titled “x:ExternalPublicKey/query”This is a standard Foo/query method as defined in RFC 8620, Section 5.5.
This method requires the sysExternalPublicKeyQuery permission.
curl -X POST https://mail.example.com/jmap/ \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:ExternalPublicKey/query", { "filter": { "emailAddress": "example" } }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'The x:ExternalPublicKey/query filter argument accepts the following conditions (combinable with AnyOf / AllOf / Not per RFC 8620):
| Condition | Kind |
|---|---|
emailAddress | text |
stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.
stalwart-cli get ExternalPublicKey id1Create
Section titled “Create”stalwart-cli create ExternalPublicKey \ --field 'source={"@type":"Manual"}'stalwart-cli query ExternalPublicKeystalwart-cli query ExternalPublicKey --where emailAddress=exampleUpdate
Section titled “Update”stalwart-cli update ExternalPublicKey id1 --field key='updated value'Delete
Section titled “Delete”stalwart-cli delete ExternalPublicKey --ids id1Nested types
Section titled “Nested types”KeySource
Section titled “KeySource”Where an external public key comes from.
Manual: Enter the key manually. No additional fields.Automatic: Keep the key up to date from a discovery method. Carries the fields ofKeySourceAutomatic.HarvestedSmime: Learned from an S/MIME signature. No additional fields.HarvestedPgp: Learned from an OpenPGP signature. No additional fields.Autocrypt: Learned from an Autocrypt header. No additional fields.
KeySourceAutomatic
Section titled “KeySourceAutomatic”Discovery method that keeps an external public key up to date.
method
Section titled “method”Type:
KeyDiscoverySource· requiredWhere the key is fetched from
ExternalPublicKeyStatus
Section titled “ExternalPublicKeyStatus”| Value | Label |
|---|---|
active | Active |
disabled | Disabled |
pendingApproval | Pending approval (the current key stays in use) |
rejected | Reject the replacement key |
KeyDiscoverySource
Section titled “KeyDiscoverySource”| Value | Label |
|---|---|
dnssec | DNS (OPENPGPKEY and SMIMEA, DNSSEC required) |
wkd | Web Key Directory |
vks | keys.openpgp.org |
hkp | Keyservers (HKP) |
KeyTrust
Section titled “KeyTrust”| Value | Label |
|---|---|
manual | Manual |
verified | Verified (CA chain or DNSSEC) |
discovered | Fetched from WKD or keys.openpgp.org |
harvested | Harvested from authenticated mail without a CA chain |
unverified | Unverified |
PublicKeyKind
Section titled “PublicKeyKind”| Value | Label |
|---|---|
openPgp | OpenPGP |
smime | S/MIME |
PublicKeyCapability
Section titled “PublicKeyCapability”| Value | Label |
|---|---|
aead | Authenticated encryption |
postQuantum | Post-quantum |
SmimeCipher
Section titled “SmimeCipher”| Value | Label |
|---|---|
aes128Cbc | AES-128-CBC |
aes192Cbc | AES-192-CBC |
aes256Cbc | AES-256-CBC |
aes128Gcm | AES-128-GCM |
aes192Gcm | AES-192-GCM |
aes256Gcm | AES-256-GCM |
chaCha20Poly1305 | ChaCha20-Poly1305 |