Struct matrix_sdk_crypto::OwnUserIdentityData
source · pub struct OwnUserIdentityData { /* private fields */ }
Expand description
Struct representing a cross signing identity of our own user.
This is the user identity of our own user. This user identity will contain a master key, self signing key as well as a user signing key.
This identity can verify other identities as well as devices belonging to the identity.
Implementations§
source§impl OwnUserIdentityData
impl OwnUserIdentityData
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 user_signing_key(&self) -> &UserSigningPubkey
pub fn user_signing_key(&self) -> &UserSigningPubkey
Get the public user-signing key of the identity.
sourcepub fn is_identity_verified(&self, identity: &OtherUserIdentityData) -> bool
pub fn is_identity_verified(&self, identity: &OtherUserIdentityData) -> bool
Check if the given user identity has been verified.
The identity of another user is verified iff our own identity is verified and if our own identity has signed the other user’s identity.
§Arguments
identity
- The identity of another user which we want to check has been verified.
sourcepub fn mark_as_verified(&self)
pub fn mark_as_verified(&self)
Mark our identity as verified.
sourcepub fn is_verified(&self) -> bool
pub fn is_verified(&self) -> bool
Check if our identity is verified.
sourcepub fn was_previously_verified(&self) -> bool
pub fn was_previously_verified(&self) -> bool
True if we verified our own identity at some point in the past.
To reset this latch back to false
, one must call
OwnUserIdentityData::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 any more it will be reported to the user. In order to remove this notice users have to verify again or to withdraw the verification requirement.
sourcepub fn has_verification_violation(&self) -> bool
pub fn has_verification_violation(&self) -> bool
Was this identity previously verified, and is no longer?
Such a violation should be reported to the local user by the application, and resolved by
- Verifying the new identity with
OwnUserIdentity::request_verification
- Or by withdrawing the verification requirement
OwnUserIdentity::withdraw_verification
.
Trait Implementations§
source§impl Clone for OwnUserIdentityData
impl Clone for OwnUserIdentityData
source§fn clone(&self) -> OwnUserIdentityData
fn clone(&self) -> OwnUserIdentityData
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for OwnUserIdentityData
impl Debug for OwnUserIdentityData
source§impl<'de> Deserialize<'de> for OwnUserIdentityData
impl<'de> Deserialize<'de> for OwnUserIdentityData
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<OwnUserIdentityData> for UserIdentityData
impl From<OwnUserIdentityData> for UserIdentityData
source§fn from(identity: OwnUserIdentityData) -> Self
fn from(identity: OwnUserIdentityData) -> Self
source§impl PartialEq for OwnUserIdentityData
impl PartialEq for OwnUserIdentityData
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
, SelfSigningPubkey
and UserSigningPubkey
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 OwnUserIdentityData
impl RefUnwindSafe for OwnUserIdentityData
impl Send for OwnUserIdentityData
impl Sync for OwnUserIdentityData
impl Unpin for OwnUserIdentityData
impl UnwindSafe for OwnUserIdentityData
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