Skip to content

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

Type: EmailAddress · required

Address 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

Type: String?

Description of the key

Type: ExternalPublicKeyStatus · default: "active"

Whether the key is used

Type: Boolean · default: false

Never replace this key automatically

Type: Boolean · default: false

All 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.

Type: KeySource · default: {"@type":"Manual"}

Where the key comes from; it cannot be changed once the key is created

Type: KeyTrust · server-set

Trust level derived from the source and certificate validation

Type: PublicKeyKind? · server-set

Type of key, taken from the key itself

Type: String? · server-set

Type of key and its encryption algorithms, taken from the key itself

Type: String? · server-set

Fingerprint of the key or certificate used for encryption

Type: Set<PublicKeyCapability> · server-set

Encryption features supported by the key

Type: Set<SmimeCipher> · server-set

Content encryption algorithms advertised by the recipient in signed S/MIME messages

Type: Boolean · server-set · default: false

Whether the recipient advertised support for RSA-OAEP in signed S/MIME messages

Type: UTCDateTime? · server-set

Signing time of the message the S/MIME capabilities were learned from

Type: UTCDateTime · server-set

When the key was first stored

Type: UTCDateTime · server-set

When the key was last seen in a discovery result or received message

Type: UTCDateTime? · server-set

When the key was last confirmed by its discovery method or certificate check

Type: UTCDateTime? · server-set

When the key is next fetched or checked

Type: UTCDateTime? · server-set

When the key stops being used: its own expiration date or, for keys from DNSSEC, the end of the DNS TTL

Type: Text? · server-set

Replacement key waiting for approval, or for the current key to expire

Type: String? · server-set

Type of the replacement key and its encryption algorithms

Type: String? · server-set

Fingerprint of the replacement key

Type: Set<PublicKeyCapability> · server-set

Encryption features supported by the replacement key

Type: UTCDateTime? · server-set

Expiration date of the replacement key

Type: Set<String> · server-set

Fingerprints of keys that were revoked or rejected and are not accepted again

The ExternalPublicKey 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 sysExternalPublicKeyGet permission.

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

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 sysExternalPublicKeyCreate permission.

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

This operation requires the sysExternalPublicKeyUpdate permission.

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

This operation requires the sysExternalPublicKeyDestroy permission.

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

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

This method requires the sysExternalPublicKeyQuery permission.

Terminal window
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):

ConditionKind
emailAddresstext

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

Terminal window
stalwart-cli get ExternalPublicKey id1
Terminal window
stalwart-cli create ExternalPublicKey \
--field 'source={"@type":"Manual"}'
Terminal window
stalwart-cli query ExternalPublicKey
stalwart-cli query ExternalPublicKey --where emailAddress=example
Terminal window
stalwart-cli update ExternalPublicKey id1 --field key='updated value'
Terminal window
stalwart-cli delete ExternalPublicKey --ids id1

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 of KeySourceAutomatic.
  • 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.

Discovery method that keeps an external public key up to date.

Type: KeyDiscoverySource · required

Where the key is fetched from

ValueLabel
activeActive
disabledDisabled
pendingApprovalPending approval (the current key stays in use)
rejectedReject the replacement key
ValueLabel
dnssecDNS (OPENPGPKEY and SMIMEA, DNSSEC required)
wkdWeb Key Directory
vkskeys.openpgp.org
hkpKeyservers (HKP)
ValueLabel
manualManual
verifiedVerified (CA chain or DNSSEC)
discoveredFetched from WKD or keys.openpgp.org
harvestedHarvested from authenticated mail without a CA chain
unverifiedUnverified
ValueLabel
openPgpOpenPGP
smimeS/MIME
ValueLabel
aeadAuthenticated encryption
postQuantumPost-quantum
ValueLabel
aes128CbcAES-128-CBC
aes192CbcAES-192-CBC
aes256CbcAES-256-CBC
aes128GcmAES-128-GCM
aes192GcmAES-192-GCM
aes256GcmAES-256-GCM
chaCha20Poly1305ChaCha20-Poly1305