QXmppE2eeExtension Class

Header: #include <QXmppE2eeExtension>
Since: QXmpp 1.5
Inherits: QXmppExtension
Inherited By:

QXmppOmemoManager

Public Types

Public Functions

virtual QXmppTask<QXmppE2eeExtension::IqDecryptResult> decryptIq(const QDomElement &element) = 0
virtual QXmppTask<QXmppE2eeExtension::MessageDecryptResult> decryptMessage(QXmppMessage &&message) = 0
virtual QXmppTask<QXmppE2eeExtension::IqEncryptResult> encryptIq(QXmppIq &&iq, const std::optional<QXmppSendStanzaParams> &params) = 0
virtual QXmppTask<QXmppE2eeExtension::MessageEncryptResult> encryptMessage(QXmppMessage &&message, const std::optional<QXmppSendStanzaParams> &params) = 0
virtual bool isEncrypted(const QDomElement &) = 0
virtual bool isEncrypted(const QXmppMessage &) = 0

Detailed Description

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

Member Type Documentation

[alias] QXmppE2eeExtension::IqDecryptResult

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.

[alias] QXmppE2eeExtension::IqEncryptResult

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

[alias] QXmppE2eeExtension::MessageDecryptResult

Contains the decrypted QXmppMessage, NotEncrypted or an QXmppError.

[alias] QXmppE2eeExtension::MessageEncryptResult

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

Member Function Documentation

[pure virtual] QXmppTask<QXmppE2eeExtension::IqDecryptResult> QXmppE2eeExtension::decryptIq(const QDomElement &element)

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

[pure virtual] QXmppTask<QXmppE2eeExtension::MessageDecryptResult> QXmppE2eeExtension::decryptMessage(QXmppMessage &&message)

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

[pure virtual] QXmppTask<QXmppE2eeExtension::IqEncryptResult> QXmppE2eeExtension::encryptIq(QXmppIq &&iq, const std::optional<QXmppSendStanzaParams> &params)

Encrypts a QXmppIq iq (using the optional send params) 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.

[pure virtual] QXmppTask<QXmppE2eeExtension::MessageEncryptResult> QXmppE2eeExtension::encryptMessage(QXmppMessage &&message, const std::optional<QXmppSendStanzaParams> &params)

Encrypts a QXmppMessage message (using the optional send params) 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.

[pure virtual] bool QXmppE2eeExtension::isEncrypted(const QDomElement &)

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

[pure virtual] bool QXmppE2eeExtension::isEncrypted(const QXmppMessage &)

Returns whether the message is encrypted with this encryption.