diff --git a/matrix_sdk/src/client.rs b/matrix_sdk/src/client.rs index 8b4fe692..a6d9b651 100644 --- a/matrix_sdk/src/client.rs +++ b/matrix_sdk/src/client.rs @@ -543,6 +543,17 @@ impl Client { session.as_ref().map(|s| s.device_id.clone()) } + /// Get the public ed25519 key of our own device. This is usually what is + /// called the fingerprint of the device. + #[cfg(feature = "encryption")] + #[cfg_attr(feature = "docs", doc(cfg(encryption)))] + pub async fn ed25519_key(&self) -> Option { + self.base_client + .olm_machine() + .await + .map(|o| o.identity_keys().ed25519().to_owned()) + } + /// Fetches the display name of the owner of the client. /// /// # Example