17#include "kleo_export.h"
19#include <Libkleo/Chrono>
24#include <gpgme++/key.h>
31class ExpiryCheckerPrivate;
32class ExpiryCheckerSettings;
34class KLEO_EXPORT TimeProvider
37 virtual ~TimeProvider() =
default;
39 virtual qint64 currentTime()
const = 0;
40 virtual QDate currentDate()
const = 0;
44class KLEO_EXPORT ExpiryChecker :
public QObject
51 CertificationKey = 0x04,
53 OwnEncryptionKey = OwnKey | EncryptionKey,
54 OwnSigningKey = OwnKey | SigningKey,
56 UsageMask = EncryptionKey | SigningKey | CertificationKey,
59 Q_DECLARE_FLAGS(CheckFlags, CheckFlag)
62 enum ExpirationStatus {
70 Q_ENUM(ExpirationStatus)
73 GpgME::Key certificate;
79 Kleo::chrono::days duration;
83 CheckFlags checkFlags;
84 Expiration expiration;
85 std::vector<Expiration> chainExpiration;
88 explicit ExpiryChecker(
const ExpiryCheckerSettings &settings,
QObject *parent =
nullptr);
90 ~ExpiryChecker()
override;
92 [[nodiscard]] ExpiryCheckerSettings settings()
const;
94 enum ExpiryInformation {
100 Q_ENUM(ExpiryInformation)
102 Result checkKey(
const GpgME::Key &key, CheckFlags flags)
const;
105 void expiryMessage(
const GpgME::Key &key,
QString msg, Kleo::ExpiryChecker::ExpiryInformation info,
bool isNewMessage)
const;
108 void setTimeProviderForTest(
const std::shared_ptr<TimeProvider> &);
111 std::unique_ptr<ExpiryCheckerPrivate>
const d;
114Q_DECLARE_OPERATORS_FOR_FLAGS(ExpiryChecker::CheckFlags)
118Q_DECLARE_METATYPE(Kleo::ExpiryChecker::ExpiryInformation)
Q_SCRIPTABLE CaptureState status()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:09:14 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.