pub struct InboundGroupSession {
    pub session_id: Arc<str>,
    pub sender_key: Arc<str>,
    pub signing_keys: Arc<BTreeMap<DeviceKeyAlgorithm, String>>,
    pub room_id: Arc<RoomId>,
    /* private fields */
}
Expand description

Inbound group session.

Inbound group sessions are used to exchange room messages between a group of participants. Inbound group sessions are used to decrypt the room messages.

Fields

session_id: Arc<str>

The SessionId associated to this GroupSession

sender_key: Arc<str>

The sender_key associated to this GroupSession

signing_keys: Arc<BTreeMap<DeviceKeyAlgorithm, String>>

Map of DeviceKeyAlgorithm to the public ed25519 key of the account

room_id: Arc<RoomId>

The Room this GroupSession belongs to

Implementations

Create a new inbound group session for the given room.

These sessions are used to decrypt room messages.

Arguments
  • sender_key - The public curve25519 key of the account that sent us the session

  • signing_key - The public ed25519 key of the account that sent us the session.

  • room_id - The id of the room that the session is used in.

  • session_key - The private session key that is used to decrypt messages.

Create a InboundGroupSession from an exported version of the group session.

Most notably this can be called with an ExportedRoomKey from a previous export() call.

Create a new inbound group session from a forwarded room key content.

Arguments
  • sender_key - The public curve25519 key of the account that sent us the session

  • content - A forwarded room key content that contains the session key to create the InboundGroupSession.

Store the group session as a base64 encoded string.

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

Export this session at the first known message index.

If only a limited part of this session should be exported use export_at_index().

Get the sender key that this session was received from.

Has the session been backed up to the server.

Reset the backup state of the inbound group session.

For testing, allow to manually mark this GroupSession to have been backed up

Get the map of signing keys this session was received from.

Get the list of ed25519 keys that this session was forwarded through.

Each ed25519 key represents a single device. If device A forwards the session to device B and device B to C this list will contain the ed25519 keys of A and B.

Export this session at the given message index.

Restore a Session from a previously pickled string.

Returns the restored group session or a UnpicklingError if there was an error.

Arguments
  • pickle - The pickled version of the InboundGroupSession.

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

The room where this session is used in.

Returns the unique identifier for this session.

Get the first message index we know how to decrypt.

Decrypt an event from a room timeline.

Arguments
  • event - The event that should be decrypted.

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

Converts to this type from the input type.

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

Returns the argument unchanged.

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

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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)

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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more