pub struct OwnUserIdentity { /* private fields */ }
Expand description
Struct representing a cross signing identity of a user.
This is the user identity of a user that is 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 the OwnUserIdentityData
type and allows a verification
to be requested to verify our own device with the user identity.
Implementations§
Source§impl OwnUserIdentity
impl OwnUserIdentity
Sourcepub async fn verify(&self) -> Result<SignatureUploadRequest, SignatureError>
pub async fn verify(&self) -> Result<SignatureUploadRequest, SignatureError>
Mark our user identity as verified.
This will mark the identity locally as verified and sign it with our own device.
Returns a signature upload request that needs to be sent out.
Sourcepub async fn request_verification(
&self,
) -> Result<(VerificationRequest, OutgoingVerificationRequest), CryptoStoreError>
pub async fn request_verification( &self, ) -> Result<(VerificationRequest, OutgoingVerificationRequest), CryptoStoreError>
Send a verification request to our other devices.
Sourcepub async fn request_verification_with_methods(
&self,
methods: Vec<VerificationMethod>,
) -> Result<(VerificationRequest, OutgoingVerificationRequest), CryptoStoreError>
pub async fn request_verification_with_methods( &self, methods: Vec<VerificationMethod>, ) -> Result<(VerificationRequest, OutgoingVerificationRequest), CryptoStoreError>
Send a verification request to our other devices while specifying our supported methods.
§Arguments
methods
- The verification methods that we’re supporting.
Sourcepub async fn trusts_our_own_device(&self) -> Result<bool, CryptoStoreError>
pub async fn trusts_our_own_device(&self) -> Result<bool, CryptoStoreError>
Does our user identity trust our own device, i.e. have we signed our own device keys with our self-signing 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.
Methods from Deref<Target = 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 OwnUserIdentity
impl Clone for OwnUserIdentity
Source§fn clone(&self) -> OwnUserIdentity
fn clone(&self) -> OwnUserIdentity
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for OwnUserIdentity
impl Debug for OwnUserIdentity
Source§impl Deref for OwnUserIdentity
impl Deref for OwnUserIdentity
Source§impl DerefMut for OwnUserIdentity
impl DerefMut for OwnUserIdentity
Source§impl From<OwnUserIdentity> for UserIdentity
impl From<OwnUserIdentity> for UserIdentity
Source§fn from(i: OwnUserIdentity) -> Self
fn from(i: OwnUserIdentity) -> Self
Auto Trait Implementations§
impl Freeze for OwnUserIdentity
impl !RefUnwindSafe for OwnUserIdentity
impl Send for OwnUserIdentity
impl Sync for OwnUserIdentity
impl Unpin for OwnUserIdentity
impl !UnwindSafe for OwnUserIdentity
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§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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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