Struct olm_rs::inbound_group_session::OlmInboundGroupSession[][src]

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

An in-bound group session is responsible for decrypting incoming communication in a Megolm session.

Implementations

Creates a new instance of OlmInboundGroupSession.

C-API equivalent

olm_init_inbound_group_session

Errors

  • InvalidBase64 if session key is invalid base64
  • BadSessionKey if session key is invalid

Import an inbound group session, from a previous export.

C-API equivalent

olm_import_inbound_group_session

Errors

  • InvalidBase64 if session key is invalid base64
  • BadSessionKey if session key is invalid

Serialises an OlmInboundGroupSession to encrypted Base64.

C-API equivalent

olm_pickle_inbound_group_session

Panics

  • OutputBufferTooSmall for OlmInboundGroupSession’s pickled buffer
  • on malfromed UTF-8 coding of the pickling provided by libolm

Deserialises from encrypted Base64 that was previously obtained by pickling an OlmInboundGroupSession.

C-API equivalent

olm_unpickle_inbound_group_session

Errors

  • BadAccountKey if the key doesn’t match the one the session was encrypted with
  • InvalidBase64 if decoding the supplied pickled string slice fails

Decrypts ciphertext received for this group session. Decoding is lossy, meaing if the decrypted plaintext contains invalid UTF-8 symbols, they will be returned as U+FFFD (�).

Returns both plaintext and message index.

C-API equivalent

  • olm_group_decrypt

Errors

  • InvalidBase64 if the message is invalid base64
  • BadMessageVersion if the message was encrypted with an unsupported version of the protocol
  • BadMessageFormat if the message headers could not be decoded
  • BadMessageMac if the message could not be verified
  • UnknownMessageIndex if we do not have a session key corresponding to the message’s index (ie, it was sent before the session key was shared with us)

Panics

  • OutputBufferTooSmall for decrypted ciphertext

Export the base64-encoded ratchet key for this session, at the given index, in a format which can be used by import

C-API equivalent

  • olm_export_inbound_group_session

Errors

  • UnkownMessageIndex if we do not have a session key corresponding to the given index (ie, it was sent before the session key was shared with us)

Panics

  • OutputBufferTooSmall for export buffer
  • on malformed UTF-8 coding of the exported session provided by libolm

Get the first message index we know how to decrypt.

C-API equivalent

  • olm_inbound_group_session_first_known_index

Get a base64-encoded identifier for this session.

C-API equivalent

  • olm_inbound_group_session_id

Panics

  • OutputBufferTooSmall for session ID buffer
  • on malformed UTF-8 coding of the session ID provided by libolm

Check if the session has been verified as a valid session.

(A session is verified either because the original session share was signed, or because we have subsequently successfully decrypted a message.)

This is mainly intended for the unit tests (in libolm), currently.

C-API equivalent

  • olm_inbound_group_session_is_verified

Trait Implementations

Executes the destructor for this type. Read more

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.

Performs the conversion.

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.