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
InvalidBase64if session key is invalid base64BadSessionKeyif session key is invalid
Import an inbound group session, from a previous export.
C-API equivalent
olm_import_inbound_group_session
Errors
InvalidBase64if session key is invalid base64BadSessionKeyif session key is invalid
Serialises an OlmInboundGroupSession to encrypted Base64.
C-API equivalent
olm_pickle_inbound_group_session
Panics
OutputBufferTooSmallforOlmInboundGroupSession’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
BadAccountKeyif the key doesn’t match the one the session was encrypted withInvalidBase64if decoding the suppliedpickledstring 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
InvalidBase64if the message is invalid base64BadMessageVersionif the message was encrypted with an unsupported version of the protocolBadMessageFormatif the message headers could not be decodedBadMessageMacif the message could not be verifiedUnknownMessageIndexif 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
OutputBufferTooSmallfor 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
UnkownMessageIndexif 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
OutputBufferTooSmallfor 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
OutputBufferTooSmallfor 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