pub struct OtherUserIdentity { /* 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 wraps a read-only version of the struct and allows verifications to be requested to verify our own device with the user identity.
Implementations§
Source§impl OtherUserIdentity
impl OtherUserIdentity
Sourcepub fn is_verified(&self) -> bool
pub fn is_verified(&self) -> bool
Is this user identity verified.
Sourcepub async fn verify(&self) -> Result<SignatureUploadRequest, SignatureError>
pub async fn verify(&self) -> Result<SignatureUploadRequest, SignatureError>
Manually verify this user.
This method will attempt to sign the user identity using our private cross signing key.
This method fails if we don’t have the private part of our user-signing key.
Returns a request that needs to be sent out for the user to be marked as verified.
Sourcepub fn request_verification(
&self,
room_id: &RoomId,
request_event_id: &EventId,
methods: Option<Vec<VerificationMethod>>,
) -> VerificationRequest
pub fn request_verification( &self, room_id: &RoomId, request_event_id: &EventId, methods: Option<Vec<VerificationMethod>>, ) -> VerificationRequest
Create a VerificationRequest
object after the verification request
content has been sent out.
Sourcepub fn verification_request_content(
&self,
methods: Option<Vec<VerificationMethod>>,
) -> KeyVerificationRequestEventContent
pub fn verification_request_content( &self, methods: Option<Vec<VerificationMethod>>, ) -> KeyVerificationRequestEventContent
Send a verification request to the given user.
The returned content needs to be sent out into a DM room with the given user.
After the content has been sent out a VerificationRequest
can be
started with the OtherUserIdentity::request_verification()
method.
Sourcepub async fn pin_current_master_key(&self) -> Result<(), CryptoStoreError>
pub async fn pin_current_master_key(&self) -> Result<(), CryptoStoreError>
Pin the current identity (public part of the master signing key).
Sourcepub fn identity_needs_user_approval(&self) -> bool
pub fn identity_needs_user_approval(&self) -> bool
Has the identity changed in a way that requires approval from the user?
A user identity needs approval if it changed after the crypto machine has already observed (“pinned”) a different identity for that user, unless it is an explicitly verified identity (using for example interactive verification).
This situation can be resolved by:
- Verifying the new identity with
OtherUserIdentity::request_verification
, or: - Updating the pin to the new identity with
OtherUserIdentity::pin_current_master_key
.
Sourcepub async fn withdraw_verification(&self) -> Result<(), CryptoStoreError>
pub async fn withdraw_verification(&self) -> Result<(), CryptoStoreError>
Remove the requirement for this identity to be verified.
Sourcepub fn has_verification_violation(&self) -> bool
pub fn has_verification_violation(&self) -> bool
Was this identity verified since initial observation and is not anymore?
Such a violation should be reported to the local user by the application, and resolved by
- Verifying the new identity with
OtherUserIdentity::request_verification
- Or by withdrawing the verification requirement
OtherUserIdentity::withdraw_verification
.
Methods from Deref<Target = 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 OtherUserIdentity
impl Clone for OtherUserIdentity
Source§fn clone(&self) -> OtherUserIdentity
fn clone(&self) -> OtherUserIdentity
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for OtherUserIdentity
impl Debug for OtherUserIdentity
Source§impl Deref for OtherUserIdentity
impl Deref for OtherUserIdentity
Source§impl DerefMut for OtherUserIdentity
impl DerefMut for OtherUserIdentity
Source§impl From<OtherUserIdentity> for UserIdentity
impl From<OtherUserIdentity> for UserIdentity
Source§fn from(i: OtherUserIdentity) -> Self
fn from(i: OtherUserIdentity) -> Self
Auto Trait Implementations§
impl Freeze for OtherUserIdentity
impl !RefUnwindSafe for OtherUserIdentity
impl Send for OtherUserIdentity
impl Sync for OtherUserIdentity
impl Unpin for OtherUserIdentity
impl !UnwindSafe for OtherUserIdentity
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