libQuotient
A Qt library for building matrix clients
Quotient::QOlmSession Class Reference

Either an outbound or inbound session for secure communication. More...

#include <qolmsession.h>

Public Member Functions

QByteArray pickle (const PicklingKey &key) const
 Serialises an QOlmSession to encrypted Base64. More...
 
QOlmMessage encrypt (const QByteArray &plaintext) const
 Encrypts a plaintext message using the session. More...
 
QOlmExpected< QByteArray > decrypt (const QOlmMessage &message) const
 
QByteArray sessionId () const
 Get a base64-encoded identifier for this session. More...
 
bool hasReceivedMessage () const
 Checker for any received messages for this session. More...
 
bool matchesInboundSession (const QOlmMessage &preKeyMessage) const
 Checks if the 'prekey' message is for this in-bound session. More...
 
bool matchesInboundSessionFrom (QByteArray theirIdentityKey, const QOlmMessage &preKeyMessage) const
 Checks if the 'prekey' message is for this in-bound session. More...
 
OlmErrorCode lastErrorCode () const
 
const char * lastError () const
 

Static Public Member Functions

static QOlmExpected< QOlmSessionunpickle (QByteArray &&pickled, const PicklingKey &key)
 Deserialises from encrypted Base64 previously made with pickle() More...
 

Friends

class QOlmAccount
 
bool operator< (const QOlmSession &lhs, const QOlmSession &rhs)
 

Detailed Description

Either an outbound or inbound session for secure communication.

Definition at line 17 of file qolmsession.h.

Member Function Documentation

◆ decrypt()

QOlmExpected<QByteArray> Quotient::QOlmSession::decrypt ( const QOlmMessage message) const

Decrypts a message using this session. Decoding is lossy, meaning if the decrypted plaintext contains invalid UTF-8 symbols, they will be returned as U+FFFD.

◆ encrypt()

QOlmMessage Quotient::QOlmSession::encrypt ( const QByteArray &  plaintext) const

Encrypts a plaintext message using the session.

◆ hasReceivedMessage()

bool Quotient::QOlmSession::hasReceivedMessage ( ) const

Checker for any received messages for this session.

◆ lastError()

const char* Quotient::QOlmSession::lastError ( ) const

◆ lastErrorCode()

OlmErrorCode Quotient::QOlmSession::lastErrorCode ( ) const

◆ matchesInboundSession()

bool Quotient::QOlmSession::matchesInboundSession ( const QOlmMessage preKeyMessage) const

Checks if the 'prekey' message is for this in-bound session.

◆ matchesInboundSessionFrom()

bool Quotient::QOlmSession::matchesInboundSessionFrom ( QByteArray  theirIdentityKey,
const QOlmMessage preKeyMessage 
) const

Checks if the 'prekey' message is for this in-bound session.

◆ pickle()

QByteArray Quotient::QOlmSession::pickle ( const PicklingKey key) const

Serialises an QOlmSession to encrypted Base64.

◆ sessionId()

QByteArray Quotient::QOlmSession::sessionId ( ) const

Get a base64-encoded identifier for this session.

◆ unpickle()

static QOlmExpected<QOlmSession> Quotient::QOlmSession::unpickle ( QByteArray &&  pickled,
const PicklingKey key 
)
static

Deserialises from encrypted Base64 previously made with pickle()

Friends And Related Function Documentation

◆ operator<

bool operator< ( const QOlmSession lhs,
const QOlmSession rhs 
)
friend

Definition at line 48 of file qolmsession.h.

◆ QOlmAccount

friend class QOlmAccount
friend

Definition at line 61 of file qolmsession.h.


The documentation for this class was generated from the following file: