Struct matrix_sdk_crypto::olm::Session[][src]

pub struct Session { /* fields omitted */ }
Expand description

Cryptographic session that enables secure communication between two Accounts

Implementations

Decrypt the given Olm message.

Returns the decrypted plaintext or an OlmSessionError if decryption failed.

Arguments

  • message - The Olm message that should be decrypted.

Get the sender key that was used to establish this Session.

Encrypt the given event content content as an m.room.encrypted event content.

Arguments

  • recipient_device - The device for which this message is going to be encrypted, this needs to be the device that was used to create this session with.

  • content - The content of the event.

Check if a pre-key Olm message was encrypted for this session.

Returns true if it matches, false if not and a OlmSessionError if there was an error checking if it matches.

Arguments

  • their_identity_key - The identity/curve25519 key of the account that encrypted this Olm message.

  • message - The pre-key Olm message that should be checked.

Returns the unique identifier for this session.

Store the session as a base64 encoded string.

Arguments

  • pickle_mode - The mode that was used to pickle the session, either an unencrypted mode or an encrypted using passphrase.

Restore a Session from a previously pickled string.

Returns the restored Olm Session or a SessionUnpicklingError if there was an error.

Arguments

  • user_id - Our own user id that the session belongs to.

  • device_id - Our own device id that the session belongs to.

  • our_idenity_keys - An clone of the Arc to our own identity keys.

  • pickle - The pickled version of the Session.

  • pickle_mode - The mode that was used to pickle the session, either an unencrypted mode or an encrypted using passphrase.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.