QXmppE2eeMetadata Class
The QXmppE2eeMetadata class contains data used for end-to-end encryption purposes. More...
| Header: | #include <QXmppE2eeMetadata.h> |
| Since: | QXmpp 1.5 |
Public Functions
| QXmppE2eeMetadata() | |
| QXmppE2eeMetadata(const QXmppE2eeMetadata &other) | |
| QXmppE2eeMetadata(QXmppE2eeMetadata &&) | |
(since QXmpp 1.18) std::optional<QXmpp::E2ee::ContentEncryption> | contentEncryption() const |
| QXmpp::EncryptionMethod | encryption() const |
(since QXmpp 1.18) QString | encryptionNamespace() const |
(since QXmpp 1.5) QDateTime | sceTimestamp() const |
(since QXmpp 1.5) QByteArray | senderKey() const |
(since QXmpp 1.18) void | setContentEncryption(std::optional<QXmpp::E2ee::ContentEncryption> contentEncryption) |
| void | setEncryption(QXmpp::EncryptionMethod encryption) |
(since QXmpp 1.18) void | setEncryptionNamespace(const QString &encryption) |
(since QXmpp 1.5) void | setSceTimestamp(const QDateTime ×tamp) |
(since QXmpp 1.5) void | setSenderKey(const QByteArray &keyId) |
| QXmppE2eeMetadata & | operator=(QXmppE2eeMetadata &&) |
| QXmppE2eeMetadata & | operator=(const QXmppE2eeMetadata &other) |
Detailed Description
Member Function Documentation
QXmppE2eeMetadata::QXmppE2eeMetadata()
Constructs a class for end-to-end encryption metadata.
QXmppE2eeMetadata::QXmppE2eeMetadata(const QXmppE2eeMetadata &other)
Copy-constructor.
QXmppE2eeMetadata::QXmppE2eeMetadata(QXmppE2eeMetadata &&)
Move-constructor.
[since QXmpp 1.18] std::optional<QXmpp::E2ee::ContentEncryption> QXmppE2eeMetadata::contentEncryption() const
Returns what has been encrypted of a received stanza: QXmpp::E2ee::ContentEncryption::Sce if all sensitive elements have been encrypted, QXmpp::E2ee::ContentEncryption::BodyOnly if only the body has been encrypted and the other elements have been received in the clear.
Elements that must be protected, e.g. trust messages, should only be used with QXmpp::E2ee::ContentEncryption::Sce. Not set if unknown, e.g. by encryptions not using the QXmpp::E2ee providers.
This function was introduced in QXmpp 1.18.
See also setContentEncryption().
QXmpp::EncryptionMethod QXmppE2eeMetadata::encryption() const
Returns the used encryption protocol.
Encryptions unknown to QXmpp are returned as QXmpp::UnknownEncryption, see encryptionNamespace().
See also setEncryption().
[since QXmpp 1.18] QString QXmppE2eeMetadata::encryptionNamespace() const
Returns the namespace of the used encryption (see QXmpp::E2ee), e.g. "urn:xmpp:omemo:2".
In contrast to encryption(), this also identifies encryptions unknown to QXmpp. Empty if not encrypted or the namespace is unknown.
This function was introduced in QXmpp 1.18.
See also setEncryptionNamespace().
[since QXmpp 1.5] QDateTime QXmppE2eeMetadata::sceTimestamp() const
Returns the timestamp affix element's content as defined by XEP-0420: Stanza Content Encryption (SCE).
The SCE timestamp is part of an encrypted stanza's SCE envelope, not an unencrypted direct child of a transmitted stanza and thus not de- / serialized by it. Instead, it is set by an encryption protocol such as XEP-0384: OMEMO Encryption after decryption. It can be used by trust management protocols such as XEP-0450: Automatic Trust Management (ATM).
This function was introduced in QXmpp 1.5.
See also setSceTimestamp().
[since QXmpp 1.5] QByteArray QXmppE2eeMetadata::senderKey() const
Returns the ID of this stanza's sender's public long-term key.
The sender key ID is not part of a transmitted stanza and thus not de- / serialized. Instead, the key ID is set by an encryption protocol such as XEP-0384: OMEMO Encryption during decryption. It can be used by trust management protocols such as XEP-0450: Automatic Trust Management (ATM).
This function was introduced in QXmpp 1.5.
See also setSenderKey().
[since QXmpp 1.18] void QXmppE2eeMetadata::setContentEncryption(std::optional<QXmpp::E2ee::ContentEncryption> contentEncryption)
Sets what has been encrypted of a received stanza to contentEncryption.
It is set when a message is decrypted by a QXmpp::E2ee::Provider.
This function was introduced in QXmpp 1.18.
See also contentEncryption().
void QXmppE2eeMetadata::setEncryption(QXmpp::EncryptionMethod encryption)
Sets the used encryption protocol.
QXmpp::UnknownEncryption keeps the namespace of an encryption unknown to QXmpp.
See also encryption().
[since QXmpp 1.18] void QXmppE2eeMetadata::setEncryptionNamespace(const QString &encryption)
Sets the namespace of the used encryption (see QXmpp::E2ee).
This function was introduced in QXmpp 1.18.
See also encryptionNamespace().
[since QXmpp 1.5] void QXmppE2eeMetadata::setSceTimestamp(const QDateTime ×tamp)
Sets the timestamp affix element's content as defined by XEP-0420: Stanza Content Encryption (SCE).
The SCE timestamp is part of an encrypted stanza's SCE envelope, not an unencrypted direct child of a transmitted stanza and thus not de- / serialized by it. Instead, it is set by an encryption protocol such as XEP-0384: OMEMO Encryption after decryption. It can be used by trust management protocols such as XEP-0450: Automatic Trust Management (ATM).
timestamp.
This function was introduced in QXmpp 1.5.
See also sceTimestamp().
[since QXmpp 1.5] void QXmppE2eeMetadata::setSenderKey(const QByteArray &keyId)
Sets the ID of this stanza's sender's public long-term key to keyId.
The sender key ID is not part of a transmitted stanza and thus not de- / serialized. Instead, it is set by an encryption protocol such as XEP-0384: OMEMO Encryption during decryption. It can be used by trust management protocols such as XEP-0450: Automatic Trust Management (ATM).
This function was introduced in QXmpp 1.5.
See also senderKey().
QXmppE2eeMetadata &QXmppE2eeMetadata::operator=(QXmppE2eeMetadata &&)
Assignment move-operator.
QXmppE2eeMetadata &QXmppE2eeMetadata::operator=(const QXmppE2eeMetadata &other)
Assignment operator.