Struct matrix_sdk_crypto::UserIdentity
source · [−]pub struct UserIdentity { /* 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
sourceimpl UserIdentity
impl UserIdentity
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 async fn request_verification(
&self,
room_id: &RoomId,
request_event_id: &EventId,
methods: Option<Vec<VerificationMethod>>
) -> VerificationRequest
pub async 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 async fn verification_request_content(
&self,
methods: Option<Vec<VerificationMethod>>
) -> KeyVerificationRequestEventContent
pub async 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 request_verification()
method.
Methods from Deref<Target = ReadOnlyUserIdentity>
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.
Trait Implementations
sourceimpl Clone for UserIdentity
impl Clone for UserIdentity
sourcefn clone(&self) -> UserIdentity
fn clone(&self) -> UserIdentity
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for UserIdentity
impl Debug for UserIdentity
sourceimpl Deref for UserIdentity
impl Deref for UserIdentity
type Target = ReadOnlyUserIdentity
type Target = ReadOnlyUserIdentity
The resulting type after dereferencing.
sourceimpl From<UserIdentity> for UserIdentities
impl From<UserIdentity> for UserIdentities
sourcefn from(i: UserIdentity) -> Self
fn from(i: UserIdentity) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl !RefUnwindSafe for UserIdentity
impl Send for UserIdentity
impl Sync for UserIdentity
impl Unpin for UserIdentity
impl !UnwindSafe for UserIdentity
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more