libQuotient
A Qt library for building matrix clients
Loading...
Searching...
No Matches
Quotient::KeyVerificationSession Class Reference

#include <keyverificationsession.h>

Inheritance diagram for Quotient::KeyVerificationSession:
Collaboration diagram for Quotient::KeyVerificationSession:

Public Types

enum  State {
  CREATED , DECL_DEPRECATED_ENUMERATOR =(WAITINGFORREADY, CREATED) , REQUESTED , DECL_DEPRECATED_ENUMERATOR =(WAITINGFORREADY, CREATED) ,
  READY , TRANSITIONED , DONE , CANCELLED ,
  CANCELED = CANCELLED , NOTFOUND
}
 
enum  SasState {
  SASSTARTED , SASACCEPTED , SASKEYSEXCHANGED , SASCONFIRMED ,
  SASDONE , SASCANCELLED , SASNOTFOUND
}
 

Signals

void stateChanged ()
 
void sasStateChanged ()
 
void sasEmojisChanged ()
 

Public Member Functions

 KeyVerificationSession (const QString &remoteUserId, const QString &verificationId, const QString &remoteDeviceId, Quotient::Connection *connection)
 
 KeyVerificationSession (Room *room, Quotient::Connection *connection, const QString &verificationId={})
 
Q_INVOKABLE void accept ()
 Accept an incoming verification session.
 
Q_INVOKABLE void sendReady ()
 
Q_INVOKABLE void confirm ()
 Confirm that the emojis shown to the user match This will mark the remote session / user as verified and send an m.key.verification.mac event Only call this after the user has confirmed the correctness of the emoji!
 
Q_INVOKABLE void sendMac ()
 
Q_INVOKABLE void startSas ()
 Start a SAS verification.
 
Q_INVOKABLE void sendStartSas ()
 
Q_INVOKABLE void cancelVerification ()
 
QVector< EmojiEntrysasEmojis ()
 
QString remoteUser () const
 
QString remoteDeviceId () const
 
QString verificationId () const
 
Quotient::Roomroom () const
 
void startMonitoring ()
 

Static Public Member Functions

static KeyVerificationSessionrequestDeviceVerification (const QString &userId, const QString &deviceId, Connection *connection)
 
static KeyVerificationSessionrequestUserVerification (Room *room, Connection *connection)
 
static KeyVerificationSessionselfVerification (const QString &verificationId, Connection *connection)
 
static KeyVerificationSessionprocessIncomingUserVerification (Room *room, const QString &eventId)
 

Properties

QString remoteUserId
 The matrix id of the user we're verifying. For device verification this is our own id.
 
QString remoteDeviceId
 The device id of the device we're verifying Does not have a specified value when verifying a different user.
 
State state
 The current state of the verification session Clients should use this to adapt their UI to the current stage of the verification.
 
SasState sasState
 The current state of the sas verification Clients should use this to adapt their UI to the current stage of the verification.
 
QList< EmojiEntrysasEmojis
 The sas emoji that should be shown to the user. Only has a specified value when the session is in TRANSITIONED state.
 

Friends

class Quotient::Connection
 

Detailed Description

A key verification session. Listen for incoming sessions by connecting to Connection::newKeyVerificationSession. Start a new session using Connection::startKeyVerificationSession. The object is delete after finished is emitted.

Definition at line 38 of file keyverificationsession.h.

Member Enumeration Documentation

◆ SasState

Enumerator
SASSTARTED 
SASACCEPTED 

The verification has been started, the protocols that should be used have been proposed and can be accepted.

SASKEYSEXCHANGED 

The verification has been accepted and both sides agreed to a set of protocols that will be used for the verification process.

SASCONFIRMED 

The public keys have been exchanged and the short auth string can be presented to the user.

SASDONE 

The verification process has been confirmed from our side, we’re waiting for the other side to confirm as well.

SASCANCELLED 

The verification process has been successfully concluded.

SASNOTFOUND 

The verification process has been cancelled.

Definition at line 59 of file keyverificationsession.h.

◆ State

Enumerator
CREATED 
DECL_DEPRECATED_ENUMERATOR 

The verification request has been newly created by us.

The verification request was received from the other party.

REQUESTED 
DECL_DEPRECATED_ENUMERATOR 

The verification request has been newly created by us.

The verification request was received from the other party.

READY 
TRANSITIONED 

The verification request is ready to start a verification flow.

DONE 

The verification request has transitioned into a concrete verification flow, e.g. into the emoji based SAS verification.

CANCELLED 

The verification flow that was started with this request has finished.

CANCELED 

The verification process has been cancelled.

NOTFOUND 

Definition at line 45 of file keyverificationsession.h.

Constructor & Destructor Documentation

◆ KeyVerificationSession() [1/2]

Quotient::KeyVerificationSession::KeyVerificationSession ( const QString &  remoteUserId,
const QString &  verificationId,
const QString &  remoteDeviceId,
Quotient::Connection connection 
)

◆ KeyVerificationSession() [2/2]

Quotient::KeyVerificationSession::KeyVerificationSession ( Room room,
Quotient::Connection connection,
const QString &  verificationId = {} 
)

Member Function Documentation

◆ accept()

Q_INVOKABLE void Quotient::KeyVerificationSession::accept ( )

Accept an incoming verification session.

◆ cancelVerification()

Q_INVOKABLE void Quotient::KeyVerificationSession::cancelVerification ( )

◆ confirm()

Q_INVOKABLE void Quotient::KeyVerificationSession::confirm ( )

Confirm that the emojis shown to the user match This will mark the remote session / user as verified and send an m.key.verification.mac event Only call this after the user has confirmed the correctness of the emoji!

◆ processIncomingUserVerification()

static KeyVerificationSession * Quotient::KeyVerificationSession::processIncomingUserVerification ( Room room,
const QString &  eventId 
)
static

◆ remoteDeviceId()

QString Quotient::KeyVerificationSession::remoteDeviceId ( ) const

◆ remoteUser()

QString Quotient::KeyVerificationSession::remoteUser ( ) const

◆ requestDeviceVerification()

static KeyVerificationSession * Quotient::KeyVerificationSession::requestDeviceVerification ( const QString &  userId,
const QString &  deviceId,
Connection connection 
)
static

◆ requestUserVerification()

static KeyVerificationSession * Quotient::KeyVerificationSession::requestUserVerification ( Room room,
Connection connection 
)
static

◆ room()

Quotient::Room * Quotient::KeyVerificationSession::room ( ) const

◆ sasEmojis()

QVector< EmojiEntry > Quotient::KeyVerificationSession::sasEmojis ( )

◆ sasEmojisChanged

void Quotient::KeyVerificationSession::sasEmojisChanged ( )
signal

◆ sasStateChanged

void Quotient::KeyVerificationSession::sasStateChanged ( )
signal

◆ selfVerification()

static KeyVerificationSession * Quotient::KeyVerificationSession::selfVerification ( const QString &  verificationId,
Connection connection 
)
static

◆ sendMac()

Q_INVOKABLE void Quotient::KeyVerificationSession::sendMac ( )

◆ sendReady()

Q_INVOKABLE void Quotient::KeyVerificationSession::sendReady ( )

◆ sendStartSas()

Q_INVOKABLE void Quotient::KeyVerificationSession::sendStartSas ( )

◆ startMonitoring()

void Quotient::KeyVerificationSession::startMonitoring ( )

◆ startSas()

Q_INVOKABLE void Quotient::KeyVerificationSession::startSas ( )

Start a SAS verification.

◆ stateChanged

void Quotient::KeyVerificationSession::stateChanged ( )
signal

◆ verificationId()

QString Quotient::KeyVerificationSession::verificationId ( ) const

Friends And Related Symbol Documentation

◆ Quotient::Connection

friend class Quotient::Connection
friend

Definition at line 144 of file keyverificationsession.h.

Property Documentation

◆ remoteDeviceId

QString Quotient::KeyVerificationSession::remoteDeviceId

The device id of the device we're verifying Does not have a specified value when verifying a different user.

Definition at line 76 of file keyverificationsession.h.

◆ remoteUserId

QString Quotient::KeyVerificationSession::remoteUserId

The matrix id of the user we're verifying. For device verification this is our own id.

Definition at line 72 of file keyverificationsession.h.

◆ sasEmojis

QList<EmojiEntry> Quotient::KeyVerificationSession::sasEmojis
read

The sas emoji that should be shown to the user. Only has a specified value when the session is in TRANSITIONED state.

Definition at line 88 of file keyverificationsession.h.

◆ sasState

SasState Quotient::KeyVerificationSession::sasState

The current state of the sas verification Clients should use this to adapt their UI to the current stage of the verification.

Definition at line 84 of file keyverificationsession.h.

◆ state

State Quotient::KeyVerificationSession::state

The current state of the verification session Clients should use this to adapt their UI to the current stage of the verification.

Definition at line 80 of file keyverificationsession.h.


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