Enum matrix_sdk_crypto::olm::SenderData
source · pub enum SenderData {
UnknownDevice {
legacy_session: bool,
owner_check_failed: bool,
},
DeviceInfo {
device_keys: DeviceKeys,
legacy_session: bool,
},
VerificationViolation(KnownSenderData),
SenderUnverified(KnownSenderData),
SenderVerified(KnownSenderData),
}
Expand description
Information on the device and user that sent the megolm session data to us
Sessions start off in UnknownDevice
state, and progress into DeviceInfo
state when we get the device info. Finally, if we can look up the sender
using the device info, the session can be moved into
VerificationViolation
, SenderUnverified
, or
SenderVerified
state, depending on the verification status of the user.
If the user’s verification state changes, the state may change accordingly.
Variants§
UnknownDevice
We have not yet found the (signed) device info for the sending device, or we did find a device but it does not own the session.
Fields
DeviceInfo
We have the signed device info for the sending device, but not yet the cross-signing key that it was signed with.
Fields
device_keys: DeviceKeys
Information about the device that sent the to-device message creating this session.
VerificationViolation(KnownSenderData)
We have found proof that this user, with this cross-signing key, sent the to-device message that established this session, but we have not yet verified the cross-signing key, and we had verified a previous cross-signing key for this user.
SenderUnverified(KnownSenderData)
We have found proof that this user, with this cross-signing key, sent the to-device message that established this session, but we have not yet verified the cross-signing key.
SenderVerified(KnownSenderData)
We have found proof that this user, with this cross-signing key, sent the to-device message that established this session, and we have verified the cross-signing key.
Implementations§
source§impl SenderData
impl SenderData
sourcepub fn unknown() -> Self
pub fn unknown() -> Self
Create a SenderData
which contains no device info.
sourcepub fn device_info(device_keys: DeviceKeys) -> Self
pub fn device_info(device_keys: DeviceKeys) -> Self
Create a SenderData
which contains device info.
sourcepub fn sender_verification_violation(
user_id: &UserId,
device_id: &DeviceId,
master_key: Ed25519PublicKey,
) -> Self
pub fn sender_verification_violation( user_id: &UserId, device_id: &DeviceId, master_key: Ed25519PublicKey, ) -> Self
Create a SenderData
with a known but unverified sender, where the
sender was previously verified.
sourcepub fn sender_unverified(
user_id: &UserId,
device_id: &DeviceId,
master_key: Ed25519PublicKey,
) -> Self
pub fn sender_unverified( user_id: &UserId, device_id: &DeviceId, master_key: Ed25519PublicKey, ) -> Self
Create a SenderData
with a known but unverified sender.
sourcepub fn sender_verified(
user_id: &UserId,
device_id: &DeviceId,
master_key: Ed25519PublicKey,
) -> Self
pub fn sender_verified( user_id: &UserId, device_id: &DeviceId, master_key: Ed25519PublicKey, ) -> Self
Create a SenderData
with a verified sender.
sourcepub fn legacy() -> Self
pub fn legacy() -> Self
Create a SenderData
which has the legacy flag set. Caution: messages
within sessions with this flag will be displayed in some contexts,
even when we are unable to verify the sender.
The returned struct contains no device info.
sourcepub fn to_type(&self) -> SenderDataType
pub fn to_type(&self) -> SenderDataType
Return our type as a SenderDataType
.
Trait Implementations§
source§impl Clone for SenderData
impl Clone for SenderData
source§fn clone(&self) -> SenderData
fn clone(&self) -> SenderData
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for SenderData
impl Debug for SenderData
source§impl Default for SenderData
impl Default for SenderData
Used when deserialising and the sender_data property is missing. If we are deserialising an InboundGroupSession session with missing sender_data, this must be a legacy session (i.e. it was created before we started tracking sender data). We set its legacy flag to true, so we can populate it with trust information if it is available later.
source§impl<'de> Deserialize<'de> for SenderData
impl<'de> Deserialize<'de> for SenderData
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl PartialEq for SenderData
impl PartialEq for SenderData
source§fn eq(&self, other: &SenderData) -> bool
fn eq(&self, other: &SenderData) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for SenderData
impl Serialize for SenderData
impl StructuralPartialEq for SenderData
Auto Trait Implementations§
impl Freeze for SenderData
impl RefUnwindSafe for SenderData
impl Send for SenderData
impl Sync for SenderData
impl Unpin for SenderData
impl UnwindSafe for SenderData
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more