Struct olm_rs::session::OlmSession [−][src]
pub struct OlmSession { /* fields omitted */ }Expand description
Either an outbound or inbound session for secure communication.
Implementations
Retuns the identifier for this session. Will be the same for both ends of the conversation.
C-API equivalent
olm_session_id
Panics
OutputBufferTooSmallif the supplied output buffer for the ID was too small- on malformed UTF-8 coding of the session ID provided by libolm
Serialises an OlmSession to encrypted base64.
C-API equivalent
olm_pickle_session
Panics
OUTPUT_BUFFER_TOO_SMALLfor OlmSession’s pickled buffer- on malformed UTF-8 coding of the pickling provided by libolm
Deserialises from encrypted base64 that was previously obtained by pickling an OlmSession.
C-API equivalent
olm_unpickle_session
Errors
BadAccountKeyif the key doesn’t match the one the session was encrypted withInvalidBase64if decoding the suppliedpickledstring slice fails
Encrypts a plaintext message using the session.
C-API equivalent
olm_encrypt
Panics
NotEnoughRandomfor too little supplied random dataOutputBufferTooSmallfor encrypted message- on malformed UTF-8 coding of the ciphertext provided by libolm
Decrypts a message using this session. Decoding is lossy, meaing if
the decrypted plaintext contains invalid UTF-8 symbols, they will
be returned as U+FFFD (�).
C-API equivalent
olm_decrypt
Errors
InvalidBase64on invalid base64 coding for supplied argumentsBadMessageVersionon unsupported protocol versionBadMessageFormaton failing to decode the messageBadMessageMacon invalid message MAC
Panics
OutputBufferTooSmallon plaintext output buffer
Checker for any received messages for this session.
C-API equivalent
olm_session_has_received_message
pub fn matches_inbound_session(
&self,
message: PreKeyMessage
) -> Result<bool, OlmSessionError>
pub fn matches_inbound_session(
&self,
message: PreKeyMessage
) -> Result<bool, OlmSessionError>
Checks if the ‘prekey’ message is for this in-bound session.
C-API equivalent
olm_matches_inbound_session
Errors
InvalidBase64for failing to decode base64 inone_time_key_messageBadMessageVersionfor message from unsupported protocol versionBadMessageFormatfor failing to decodeone_time_key_message
pub fn matches_inbound_session_from(
&self,
their_identity_key: &str,
message: PreKeyMessage
) -> Result<bool, OlmSessionError>
pub fn matches_inbound_session_from(
&self,
their_identity_key: &str,
message: PreKeyMessage
) -> Result<bool, OlmSessionError>
Checks if the ‘prekey’ message is for this in-bound session.
C-API equivalent
olm_matches_inbound_session
Errors
InvalidBase64for failing to decode base64 inone_time_key_messageBadMessageVersionfor message from unsupported protocol versionBadMessageFormatfor failing to decodeone_time_key_message
Trait Implementations
orders by unicode code points (which is a superset of ASCII)
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more