crypto: Add some more methods to the group session wrapper.

This commit is contained in:
Damir Jelić 2020-04-09 16:23:24 +02:00
parent b4de95185d
commit a5f43db859

View file

@ -172,6 +172,12 @@ impl Session {
Ok(plaintext)
}
pub fn encrypt(&mut self, plaintext: &str) -> OlmMessage {
let message = self.inner.encrypt(plaintext);
self.last_use_time = Instant::now();
message
}
pub fn matches(
&self,
their_identity_key: &str,
@ -317,6 +323,10 @@ impl OutboundGroupSession {
self.shared.store(true, Ordering::Relaxed);
}
pub fn shared(&self) -> bool {
self.shared.load(Ordering::Relaxed)
}
pub async fn session_key(&self) -> String {
let session = self.inner.lock().await;
session.session_key()