diff --git a/matrix_sdk_crypto/src/olm/group_sessions/mod.rs b/matrix_sdk_crypto/src/olm/group_sessions/mod.rs index 7f9ac026..a8b2137e 100644 --- a/matrix_sdk_crypto/src/olm/group_sessions/mod.rs +++ b/matrix_sdk_crypto/src/olm/group_sessions/mod.rs @@ -69,6 +69,12 @@ pub struct ExportedRoomKey { impl TryInto for ExportedRoomKey { type Error = (); + /// Convert an exported room key into a content for a forwarded room key + /// event. + /// + /// This will fail if the exported room key has multiple sender claimed keys + /// or if the algorithm of the claimed sender key isn't + /// `DeviceKeyAlgorithm::Ed25519`. fn try_into(self) -> Result { if self.sender_claimed_keys.len() != 1 { Err(()) @@ -93,6 +99,7 @@ impl TryInto for ExportedRoomKey { } impl From for ExportedRoomKey { + /// Convert the content of a forwarded room key into a exported room key. fn from(forwarded_key: ForwardedRoomKeyEventContent) -> Self { let mut sender_claimed_keys: BTreeMap = BTreeMap::new(); sender_claimed_keys.insert(