mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-18 21:52:30 -04:00
ffi: Expose ed25519/curve25519 keys in bindings (#3420)
This commit is contained in:
@@ -213,6 +213,18 @@ impl From<encryption::VerificationState> for VerificationState {
|
||||
|
||||
#[uniffi::export(async_runtime = "tokio")]
|
||||
impl Encryption {
|
||||
/// Get the public ed25519 key of our own device. This is usually what is
|
||||
/// called the fingerprint of the device.
|
||||
pub async fn ed25519_key(&self) -> Option<String> {
|
||||
self.inner.ed25519_key().await
|
||||
}
|
||||
|
||||
/// 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<String> {
|
||||
self.inner.curve25519_key().await
|
||||
}
|
||||
|
||||
pub fn backup_state_listener(&self, listener: Box<dyn BackupStateListener>) -> Arc<TaskHandle> {
|
||||
let mut stream = self.inner.backups().state_stream();
|
||||
|
||||
|
||||
@@ -613,6 +613,12 @@ 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<String> {
|
||||
self.client.olm_machine().await.as_ref().map(|o| o.identity_keys().curve25519.to_base64())
|
||||
}
|
||||
|
||||
/// Get the status of the private cross signing keys.
|
||||
///
|
||||
/// This can be used to check which private cross signing keys we have
|
||||
|
||||
Reference in New Issue
Block a user