diff --git a/matrix_sdk_crypto/src/olm/group_sessions/inbound.rs b/matrix_sdk_crypto/src/olm/group_sessions/inbound.rs index 121a9017..78aa9878 100644 --- a/matrix_sdk_crypto/src/olm/group_sessions/inbound.rs +++ b/matrix_sdk_crypto/src/olm/group_sessions/inbound.rs @@ -188,6 +188,11 @@ impl InboundGroupSession { .expect("Can't export at the first known index") } + /// Get the sender key that this session was received from. + pub fn sender_key(&self) -> &str { + &self.sender_key + } + /// Export this session at the given message index. pub async fn export_at_index(&self, message_index: u32) -> Option { let session_key = diff --git a/matrix_sdk_crypto/src/olm/session.rs b/matrix_sdk_crypto/src/olm/session.rs index 8d031f63..dafe9fcb 100644 --- a/matrix_sdk_crypto/src/olm/session.rs +++ b/matrix_sdk_crypto/src/olm/session.rs @@ -77,6 +77,11 @@ impl Session { Ok(plaintext) } + /// Get the sender key that was used to establish this Session. + pub fn sender_key(&self) -> &str { + &self.sender_key + } + /// Encrypt the given plaintext as a OlmMessage. /// /// Returns the encrypted Olm message.