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,
§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