File indexing completed on 2025-03-09 04:54:29

0001 /*
0002    SPDX-FileCopyrightText: 2019-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "messageviewer_export.h"
0010 #include <QObject>
0011 #include <QString>
0012 #include <QStringList>
0013 namespace MessageViewer
0014 {
0015 /**
0016  * @brief The DKIMKeyRecord class
0017  * @author Laurent Montel <montel@kde.org>
0018  */
0019 class MESSAGEVIEWER_EXPORT DKIMKeyRecord
0020 {
0021 public:
0022     DKIMKeyRecord();
0023     [[nodiscard]] bool parseKey(const QString &key);
0024 
0025     [[nodiscard]] QString version() const;
0026     void setVersion(const QString &version);
0027 
0028     [[nodiscard]] QString keyType() const;
0029     void setKeyType(const QString &keyType);
0030 
0031     [[nodiscard]] QString note() const;
0032     void setNote(const QString &note);
0033 
0034     [[nodiscard]] QString publicKey() const;
0035     void setPublicKey(const QString &publicKey);
0036 
0037     [[nodiscard]] QString service() const;
0038     void setService(const QString &service);
0039 
0040     [[nodiscard]] QStringList hashAlgorithm() const;
0041     void setHashAlgorithm(const QStringList &hashAlgorithm);
0042 
0043     [[nodiscard]] QStringList flags() const;
0044     void setFlags(const QStringList &flags);
0045 
0046     [[nodiscard]] bool operator==(const DKIMKeyRecord &other) const;
0047 
0048 private:
0049     QString mVersion;
0050     QString mKeyType;
0051     QString mNote;
0052     QString mPublicKey;
0053     QString mService;
0054     QStringList mHashAlgorithm;
0055     QStringList mFlags;
0056 };
0057 }
0058 Q_DECLARE_METATYPE(MessageViewer::DKIMKeyRecord)
0059 MESSAGEVIEWER_EXPORT QDebug operator<<(QDebug d, const MessageViewer::DKIMKeyRecord &t);