Available on crate feature
e2e-encryption only.Expand description
High-level interface for Dehydrated Devices (MSC3814).
A dehydrated device is a virtual device the homeserver keeps on the user’s behalf while no live device is online. Senders can encrypt to it using the same Olm session establishment as for any other device. When a new device comes online it rehydrates: it pulls the private parts of the virtual device back down, decrypts them with a pickle key, drains the queued to-device events, and imports the room keys they carry.
§Lifecycle
is_supported: cheap probe of the homeserver.create: build a fresh dehydrated device and upload it. The pickle key is supplied by the caller; storage and rotation of the pickle key are an application concern.rehydrate: pull the existing dehydrated device, decrypt with the pickle key, absorb queued to-device events, and delete the device.delete: remove the current dehydrated device without rehydrating.
§Example
let dehydrated = client.encryption().dehydrated_devices();
if !dehydrated.is_supported().await? {
return Ok(());
}
// The pickle key comes from Secret Storage: only the key that encrypted
// the existing device can rehydrate it. `start` manages that round trip.
dehydrated.rehydrate(&pickle_key).await?;
dehydrated.create(None, &pickle_key).await?;Structs§
- Dehydrated
Devices - High-level handle returned by
Encryption::dehydrated_devices. - Start
Dehydration - Named future returned by
DehydratedDevices::start.
Enums§
- Dehydrated
Device Error - Errors that can occur while managing dehydrated devices.
- Dehydrated
Device Event - Lifecycle events emitted by
DehydratedDevices.