File indexing completed on 2024-12-22 05:05:20

0001 // SPDX-FileCopyrightText: 2002-2003 Karl-Heinz Zimmer <khz@kde.org>
0002 // SPDX-FileCopyrightText: 2003 Marc Mutz <mutz@kde.org>
0003 // SPDX-License-Identifier: GPL-2.0-or-later
0004 
0005 #pragma once
0006 
0007 #include <QDateTime>
0008 #include <QStringList>
0009 #include <gpgme++/context.h>
0010 #include <gpgme++/verificationresult.h>
0011 
0012 namespace MimeTreeParser
0013 {
0014 
0015 class PartMetaData
0016 {
0017 public:
0018     PartMetaData()
0019         : isSigned(false)
0020         , isGoodSignature(false)
0021         , isEncrypted(false)
0022         , isDecryptable(false)
0023         , inProgress(false)
0024         , technicalProblem(false)
0025         , isEncapsulatedRfc822Message(false)
0026         , isCompliant(false)
0027         , keyRevoked(false)
0028     {
0029     }
0030 
0031     GpgME::Signature::Summary sigSummary = GpgME::Signature::None;
0032     QString signClass;
0033     QString signer;
0034     QStringList signerMailAddresses;
0035     QByteArray keyId;
0036     GpgME::Signature::Validity keyTrust = GpgME::Signature::Validity::Unknown;
0037     QString status; // to be used for unknown plug-ins
0038     int status_code = 0; // = GPGME_SIG_STAT_NONE; to be used for i18n of OpenPGP and S/MIME CryptPlugs
0039     QString errorText;
0040     QDateTime creationTime;
0041     QString decryptionError;
0042     QString auditLog;
0043     QString compliance; // textual representation of compliance status; empty if compliance isn't enforced
0044     GpgME::Error auditLogError;
0045     bool isSigned : 1;
0046     bool isGoodSignature : 1;
0047     bool isEncrypted : 1;
0048     bool isDecryptable : 1;
0049     bool inProgress : 1;
0050     bool technicalProblem : 1;
0051     bool isEncapsulatedRfc822Message : 1;
0052     bool isCompliant : 1; // corresponds to the isDeVS flag of signature or decryption result
0053     bool keyRevoked : 1;
0054 
0055     inline bool isTrusted()
0056     {
0057         return keyTrust == GpgME::Signature::Full || keyTrust == GpgME::Signature::Ultimate;
0058     }
0059 };
0060 
0061 }