QXmpp: QXmppE2eeExtension Class Reference

QXmpp Version: 1.14.2

Loading...
Searching...
No Matches
QXmppE2eeExtension Class Referenceabstract
Inheritance diagram for QXmppE2eeExtension:

## Classes
struct | NotEncrypted

## Public Types
using | MessageEncryptResult = std::variant<std::unique_ptr<QXmppMessage>, QXmppError>
using | MessageDecryptResult = std::variant<QXmppMessage, NotEncrypted, QXmppError>
using | IqEncryptResult = std::variant<std::unique_ptr<QXmppIq>, QXmppError>
using | IqDecryptResult = std::variant<QDomElement, NotEncrypted, QXmppError>

## Public Member Functions
virtual QXmppTask< MessageEncryptResult > | encryptMessage (QXmppMessage &&, const std::optional< QXmppSendStanzaParams > &)=0
virtual QXmppTask< MessageDecryptResult > | decryptMessage (QXmppMessage &&)=0
virtual QXmppTask< IqEncryptResult > | encryptIq (QXmppIq &&, const std::optional< QXmppSendStanzaParams > &)=0
virtual QXmppTask< IqDecryptResult > | decryptIq (const QDomElement &)=0
virtual bool | isEncrypted (const QDomElement &)=0
virtual bool | isEncrypted (const QXmppMessage &)=0

## Detailed Description

Abstract client extension for end-to-end-encryption protocols.

Since
  QXmpp 1.5

## Member Typedef Documentation

## ◆ IqDecryptResult

using QXmppE2eeExtension::IqDecryptResult = std::variant<QDomElement, NotEncrypted, QXmppError>

Contains a deserialized IQ stanza in form of a DOM element with decrypted contents or a QXmpp::SendError in case the IQ couldn't be decrypted.

## ◆ IqEncryptResult

using QXmppE2eeExtension::IqEncryptResult = std::variant<std::unique_ptr<QXmppIq>, QXmppError>

Contains the XML serialized IQ stanza with encrypted contents or a QXmpp::SendError in case the IQ couldn't be encrypted.

## ◆ MessageDecryptResult

using QXmppE2eeExtension::MessageDecryptResult = std::variant<QXmppMessage, NotEncrypted, QXmppError>

Contains the decrypted QXmppMessage, NotEncrypted or an QXmppError.

## ◆ MessageEncryptResult

using QXmppE2eeExtension::MessageEncryptResult = std::variant<std::unique_ptr<QXmppMessage>, QXmppError>

Contains the XML serialized message stanza with encrypted contents or a QXmpp::SendError in case the message couldn't be encrypted.

## Member Function Documentation

## ◆ decryptIq()

virtual QXmppTask< IqDecryptResult > QXmppE2eeExtension::decryptIq | ( | const QDomElement & |  | ) |
| pure virtual

Decrypts an IQ from a DOM element and returns a fully decrypted IQ as a DOM element via QFuture. If the input was not encrypted, QXmppE2eeExtension::NotEncrypted should be returned.

## ◆ decryptMessage()

virtual QXmppTask< MessageDecryptResult > QXmppE2eeExtension::decryptMessage | ( | QXmppMessage && |  | ) |
| pure virtual

Decrypts a QXmppMessage and returns the decrypted QXmppMessage. In case the message was not encrypted, QXmppE2eeExtension::NotEncrypted should be returned.

## ◆ encryptIq()

virtual QXmppTask< IqEncryptResult > QXmppE2eeExtension::encryptIq | ( | QXmppIq && | ,
|  | const std::optional< QXmppSendStanzaParams > & | )
| pure virtual

Encrypts a QXmppIq and returns the serialized XML stanza with encrypted contents via QFuture.

If the IQ cannot be encrypted for whatever reason, you can either serialize the IQ unencrypted and return that or return a SendError with an error message.

## ◆ encryptMessage()

virtual QXmppTask< MessageEncryptResult > QXmppE2eeExtension::encryptMessage | ( | QXmppMessage && | ,
|  | const std::optional< QXmppSendStanzaParams > & | )
| pure virtual

Encrypts a QXmppMessage and returns the serialized XML stanza with encrypted contents via QFuture.

If the message cannot be encrypted for whatever reason, you can either serialize the message unencrypted and return that or return a SendError with an error message.

## ◆ isEncrypted() [1/2]

virtual bool QXmppE2eeExtension::isEncrypted | ( | const QDomElement & |  | ) |
| pure virtual

Returns whether the DOM element of an IQ or message stanza is encrypted with this encryption.

## ◆ isEncrypted() [2/2]

virtual bool QXmppE2eeExtension::isEncrypted | ( | const QXmppMessage & |  | ) |
| pure virtual

Returns whether the message is encrypted with this encryption.

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

- QXmppE2eeExtension.h
- QXmppE2eeExtension.cpp