Struct matrix_sdk_crypto::OtherUserIdentityData
source · pub struct OtherUserIdentityData { /* private fields */ }
Expand description
Struct representing a cross signing identity of a user.
This is the user identity of a user that isn’t our own. Other users will only contain a master key and a self signing key, meaning that only device signatures can be checked with this identity.
This struct also contains the currently pinned user identity (public master key) for that user and a local flag that serves as a latch to remember if an identity was verified once.
The first time a cryptographic user identity is seen for a given user, it will be associated with that user (“pinned”). Future interactions will expect this identity to stay the same, to avoid MITM attacks from the homeserver.
The user can explicitly pin the new identity to allow for legitimate identity changes (for example, in case of key material or device loss).
As soon as the cryptographic identity is verified (i.e. signed by our own
trusted identity), a flag is set to remember it (previously_verified
).
Future interactions will expect this user to stay verified, in case of
violation the user should be notified with a blocking warning when sending a
message.
Implementations§
source§impl OtherUserIdentityData
impl OtherUserIdentityData
sourcepub fn master_key(&self) -> &MasterPubkey
pub fn master_key(&self) -> &MasterPubkey
Get the public master key of the identity.
sourcepub fn self_signing_key(&self) -> &SelfSigningPubkey
pub fn self_signing_key(&self) -> &SelfSigningPubkey
Get the public self-signing key of the identity.
sourcepub fn was_previously_verified(&self) -> bool
pub fn was_previously_verified(&self) -> bool
True if we verified this identity (with any own identity, at any point).
To set this latch back to false, call
OtherUserIdentityData::withdraw_verification()
.
sourcepub fn withdraw_verification(&self)
pub fn withdraw_verification(&self)
Remove the requirement for this identity to be verified.
If an identity was previously verified and is not anymore it will be reported to the user. In order to remove this notice users have to verify again or to withdraw the verification requirement.
Trait Implementations§
source§impl Clone for OtherUserIdentityData
impl Clone for OtherUserIdentityData
source§fn clone(&self) -> OtherUserIdentityData
fn clone(&self) -> OtherUserIdentityData
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for OtherUserIdentityData
impl Debug for OtherUserIdentityData
source§impl<'de> Deserialize<'de> for OtherUserIdentityData
impl<'de> Deserialize<'de> for OtherUserIdentityData
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 From<OtherUserIdentityData> for UserIdentityData
impl From<OtherUserIdentityData> for UserIdentityData
source§fn from(identity: OtherUserIdentityData) -> Self
fn from(identity: OtherUserIdentityData) -> Self
source§impl PartialEq for OtherUserIdentityData
impl PartialEq for OtherUserIdentityData
source§fn eq(&self, other: &Self) -> bool
fn eq(&self, other: &Self) -> bool
The PartialEq
implementation compares several attributes, including
the user ID, key material, usage, and, notably, the signatures of
the master key.
This approach contrasts with the PartialEq
implementation of the
MasterPubkey
, and SelfSigningPubkey
types,
where the signatures are disregarded. This distinction arises from our
treatment of identity as the combined representation of cross-signing
keys and the associated verification state.
The verification state of an identity depends on the signatures of the
master key, requiring their inclusion in our PartialEq
implementation.
Auto Trait Implementations§
impl Freeze for OtherUserIdentityData
impl RefUnwindSafe for OtherUserIdentityData
impl Send for OtherUserIdentityData
impl Sync for OtherUserIdentityData
impl Unpin for OtherUserIdentityData
impl UnwindSafe for OtherUserIdentityData
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
)§impl<T> CompatExt for T
impl<T> CompatExt for T
source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
source§fn consume_handle(handle: Handle) -> Arc<T>
fn consume_handle(handle: Handle) -> Arc<T>
Arc<>
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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