diff options
| author | Linus Jahn <lnj@kaidan.im> | 2021-08-22 22:00:46 +0200 |
|---|---|---|
| committer | Linus Jahn <lnj@kaidan.im> | 2021-09-28 17:08:08 +0200 |
| commit | 5849459af181d686c6e0b8ccca3a685e44a81582 (patch) | |
| tree | 821308f9c162ec9127ddf51d1406ab8e0283d136 /src/client/QXmppE2eeExtension.cpp | |
| parent | 48d3eb28ab8f115ce999c2264303925f9c7ce2a7 (diff) | |
| download | qxmpp-5849459af181d686c6e0b8ccca3a685e44a81582.tar.gz | |
QXmppClient: Add encryption hooks
Diffstat (limited to 'src/client/QXmppE2eeExtension.cpp')
| -rw-r--r-- | src/client/QXmppE2eeExtension.cpp | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/src/client/QXmppE2eeExtension.cpp b/src/client/QXmppE2eeExtension.cpp new file mode 100644 index 00000000..d4e9f9ca --- /dev/null +++ b/src/client/QXmppE2eeExtension.cpp @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2008-2021 The QXmpp developers + * + * Authors: + * Linus Jahn + * + * Source: + * https://github.com/qxmpp-project/qxmpp + * + * This file is a part of QXmpp library. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + */ + +#include "QXmppE2eeExtension.h" + +/// +/// \class QXmppE2eeExtension +/// +/// Abstract client extension for end-to-end-encryption protocols. +/// +/// \warning THIS API IS NOT FINALIZED YET! +/// +/// \since QXmpp 1.5 +/// + +/// +/// \struct QXmppE2eeExtension::NotEncrypted +/// +/// Indicates that the input was not encrypted and so nothing could be decrypted. +/// +/// \since QXmpp 1.5 +/// + +/// +/// \typedef QXmppE2eeExtension::EncryptMessageResult +/// +/// Contains the XML serialized message stanza with encrypted contents or a +/// QXmpp::SendError in case the message couldn't be encrypted. +/// + +/// +/// \typedef QXmppE2eeExtension::IqEncryptResult +/// +/// Contains the XML serialized IQ stanza with encrypted contents or a +/// QXmpp::SendError in case the IQ couldn't be encrypted. +/// + +/// +/// \typedef 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. +/// + +/// +/// \fn QXmppE2eeExtension::encryptMessage +/// +/// 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. +/// + +/// +/// \fn QXmppE2eeExtension::encryptIq +/// +/// 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. +/// + +/// +/// \fn QXmppE2eeExtension::decryptIq +/// +/// 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. +/// |
