QXmpp: QXmppEncryptedFileSource.h Source File

QXmpp Version: 1.14.3

Loading...
Searching...
No Matches
QXmppEncryptedFileSource.h
1// SPDX-FileCopyrightText: 2022 Linus Jahn <lnj@kaidan.im>
2// SPDX-FileCopyrightText: 2022 Jonah Brüchert <jbb@kaidan.im>
3//
4// SPDX-License-Identifier: LGPL-2.1-or-later
5
6#ifndef QXMPPENCRYPTEDFILESOURCE_H
7#define QXMPPENCRYPTEDFILESOURCE_H
8
9#include "QXmppGlobal.h"
10#include "QXmppHash.h"
11#include "QXmppHttpFileSource.h"
12
13#include <QSharedDataPointer>
14#include <QUrl>
15#include <QVector>
16
17class QXmppEncryptedFileSourcePrivate;
18
19// exported for tests
20 class QXMPP_EXPORT QXmppEncryptedFileSource
21{
22public:
23 QXmppEncryptedFileSource();
24 QXMPP_PRIVATE_DECLARE_RULE_OF_SIX(QXmppEncryptedFileSource)
25
26 QXmpp::Cipher cipher() const;
27 void setCipher(QXmpp::Cipher newCipher);
28
29 const QByteArray &key() const;
30 void setKey(const QByteArray &newKey);
31
32 const QByteArray &iv() const;
33 void setIv(const QByteArray &newIv);
34
35 const QVector<QXmppHash> &hashes() const;
36 void setHashes(const QVector<QXmppHash> &newHashes);
37
38 const QVector<QXmppHttpFileSource> &httpSources() const;
39 void setHttpSources(const QVector<QXmppHttpFileSource> &newHttpSources);
40
42 static constexpr std::tuple XmlTag = { u"encrypted", QXmpp::Private::ns_esfs };
43 bool parse(const QDomElement &el);
44 void toXml(QXmlStreamWriter *writer) const;
46
47private:
48 QSharedDataPointer<QXmppEncryptedFileSourcePrivate> d;
49};
50
51#endif // QXMPPENCRYPTEDFILESOURCE_H
QXmppEncryptedFileSource::cipher
QXmpp::Cipher cipher() const
Returns the cipher that was used to encrypt the data in this file source.
Definition QXmppEncryptedFileSource.cpp:59
QXmppEncryptedFileSource::setKey
void setKey(const QByteArray &newKey)
Sets the key that was used to encrypt the data in this file source.
Definition QXmppEncryptedFileSource.cpp:77
QXmppEncryptedFileSource::setCipher
void setCipher(QXmpp::Cipher newCipher)
Sets the cipher that was used to encrypt the data in this file source.
Definition QXmppEncryptedFileSource.cpp:65
QXmppEncryptedFileSource::setIv
void setIv(const QByteArray &newIv)
Sets the initialization vector that was used to encrypt the data in this file source.
Definition QXmppEncryptedFileSource.cpp:89
QXmppEncryptedFileSource::iv
const QByteArray & iv() const
Returns the Initialization vector that can be used to decrypt the data in this file source.
Definition QXmppEncryptedFileSource.cpp:83
QXmppEncryptedFileSource::key
const QByteArray & key() const
Returns the key that can be used to decrypt the data in this file source.
Definition QXmppEncryptedFileSource.cpp:71
QXmppEncryptedFileSource::httpSources
const QVector< QXmppHttpFileSource > & httpSources() const
Returns the http sources that can be used to retrieve the encrypted data.
Definition QXmppEncryptedFileSource.cpp:107
QXmppEncryptedFileSource::setHashes
void setHashes(const QVector< QXmppHash > &newHashes)
Sets the hashes of the file contained in this file source.
Definition QXmppEncryptedFileSource.cpp:101
QXmppEncryptedFileSource::setHttpSources
void setHttpSources(const QVector< QXmppHttpFileSource > &newHttpSources)
Sets the http sources containing the encrypted data.
Definition QXmppEncryptedFileSource.cpp:113
QXmppEncryptedFileSource::hashes
const QVector< QXmppHash > & hashes() const
Returns the hashes of the file contained in this file source.
Definition QXmppEncryptedFileSource.cpp:95
QXmpp::Cipher
Cipher
Definition QXmppGlobal.h:172