pub struct GroupSession { /* private fields */ }
Expand description

A Megolm group session represents a single sending participant in an encrypted group communication context containing multiple receiving parties.

A group session consists of a ratchet, used for encryption, and an Ed25519 signing key pair, used for authenticity.

A group session containing the signing key pair is also known as an “outbound” group session. We differentiate this from an inbound group session where this key pair has been removed and which can be used solely for receipt and decryption of messages.

Such an inbound group session is typically sent by the outbound group session owner to each of the receiving parties via a secure peer-to-peer channel (e.g. an Olm channel).

Implementations

Construct a new group session, with a random ratchet state and signing key pair.

Returns the globally unique session ID, in base64-encoded form.

A session ID is the public part of the Ed25519 key pair associated with the group session. Due to the construction, every session ID is (probabilistically) globally unique.

Return the current message index.

The message index is incremented each time a message is encrypted with the group session.

Encrypt the plaintext with the group session.

The resulting ciphertext is MAC-ed, then signed with the group session’s Ed25519 key pair and finally base64-encoded.

Export the group session into a session key.

The session key contains the key version constant, the current message index, the ratchet state and the public part of the signing key pair. It is signed by the signing key pair for authenticity.

The session key is in a portable format, suitable for sending over the network. It is typically sent to other group participants so that they can reconstruct an inbound group session in order to decrypt messages sent by this group session.

Convert the group session into a struct which implements serde::Serialize and serde::Deserialize.

Restore a GroupSession from a previously saved GroupSessionPickle.

Trait Implementations

Returns the “default value” for a type. Read more

Converts to this type from the input type.

Converts to this type from the input type.

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.

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 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.