Struct matrix_sdk_crypto::olm::StaticAccountData
source · pub struct StaticAccountData {
pub user_id: OwnedUserId,
pub device_id: OwnedDeviceId,
pub identity_keys: Arc<IdentityKeys>,
pub dehydrated: bool,
/* private fields */
}
Expand description
Account data that’s static for the lifetime of a Client.
This data never changes once it’s set, so it can be freely passed and cloned everywhere.
Fields§
§user_id: OwnedUserId
The user_id this account belongs to.
device_id: OwnedDeviceId
The device_id of this entry.
identity_keys: Arc<IdentityKeys>
The associated identity keys.
dehydrated: bool
Whether the account is for a dehydrated device.
Implementations§
source§impl StaticAccountData
impl StaticAccountData
sourcepub async fn create_group_session_pair(
&self,
room_id: &RoomId,
settings: EncryptionSettings,
own_sender_data: SenderData,
) -> Result<(OutboundGroupSession, InboundGroupSession), MegolmSessionCreationError>
pub async fn create_group_session_pair( &self, room_id: &RoomId, settings: EncryptionSettings, own_sender_data: SenderData, ) -> Result<(OutboundGroupSession, InboundGroupSession), MegolmSessionCreationError>
Create a group session pair.
This session pair can be used to encrypt and decrypt messages meant for a large group of participants.
The outbound session is used to encrypt messages while the inbound one is used to decrypt messages encrypted by the outbound one.
§Arguments
-
room_id
- The ID of the room where the group session will be used. -
settings
- Settings determining the algorithm and rotation period of the outbound group session.
sourcepub fn signing_key_id(&self) -> OwnedDeviceKeyId
pub fn signing_key_id(&self) -> OwnedDeviceKeyId
Get the key ID of our Ed25519 signing key.
sourcepub fn has_signed_raw(
&self,
signatures: &Signatures,
canonical_json: &str,
) -> Result<(), SignatureError>
pub fn has_signed_raw( &self, signatures: &Signatures, canonical_json: &str, ) -> Result<(), SignatureError>
Check if the given JSON is signed by this Account key.
This method should only be used if an object’s signature needs to be checked multiple times, and you’d like to avoid performing the canonicalization step each time.
Note: Use this method with caution, the canonical_json
needs to be
correctly canonicalized and make sure that the object you are checking
the signature for is allowed to be signed by our own device.
sourcepub fn unsigned_device_keys(&self) -> DeviceKeys
pub fn unsigned_device_keys(&self) -> DeviceKeys
Generate the unsigned DeviceKeys
from this StaticAccountData
.
sourcepub fn identity_keys(&self) -> IdentityKeys
pub fn identity_keys(&self) -> IdentityKeys
Get the public parts of the identity keys for the account.
sourcepub fn creation_local_time(&self) -> MilliSecondsSinceUnixEpoch
pub fn creation_local_time(&self) -> MilliSecondsSinceUnixEpoch
Get the local timestamp creation of the account in secs since epoch.
Trait Implementations§
source§impl Clone for StaticAccountData
impl Clone for StaticAccountData
source§fn clone(&self) -> StaticAccountData
fn clone(&self) -> StaticAccountData
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for StaticAccountData
impl RefUnwindSafe for StaticAccountData
impl Send for StaticAccountData
impl Sync for StaticAccountData
impl Unpin for StaticAccountData
impl UnwindSafe for StaticAccountData
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