diff --git a/bindings/matrix-sdk-ffi/src/encryption.rs b/bindings/matrix-sdk-ffi/src/encryption.rs index d7cb93ce1..b39c5ec14 100644 --- a/bindings/matrix-sdk-ffi/src/encryption.rs +++ b/bindings/matrix-sdk-ffi/src/encryption.rs @@ -222,7 +222,7 @@ impl Encryption { /// Get the public curve25519 key of our own device in base64. This is /// usually what is called the identity key of the device. pub async fn curve25519_key(&self) -> Option { - self.inner.curve25519_key().await + self.inner.curve25519_key().await.map(|k| k.to_base64()) } pub fn backup_state_listener(&self, listener: Box) -> Arc { diff --git a/crates/matrix-sdk/src/encryption/mod.rs b/crates/matrix-sdk/src/encryption/mod.rs index 301d85c6b..256b15dbd 100644 --- a/crates/matrix-sdk/src/encryption/mod.rs +++ b/crates/matrix-sdk/src/encryption/mod.rs @@ -57,6 +57,7 @@ use ruma::{ }; use tokio::sync::RwLockReadGuard; use tracing::{debug, error, instrument, trace, warn}; +use vodozemac::Curve25519PublicKey; use self::{ backups::{types::BackupClientState, Backups}, @@ -613,10 +614,9 @@ impl Encryption { self.client.olm_machine().await.as_ref().map(|o| o.identity_keys().ed25519.to_base64()) } - /// Get the public curve25519 key of our own device in base64. This is - /// usually what is called the identity key of the device. - pub async fn curve25519_key(&self) -> Option { - self.client.olm_machine().await.as_ref().map(|o| o.identity_keys().curve25519.to_base64()) + /// Get the public Curve25519 key of our own device. + pub async fn curve25519_key(&self) -> Option { + self.client.olm_machine().await.as_ref().map(|o| o.identity_keys().curve25519) } /// Get the status of the private cross signing keys.