KHealthCertificate

khealthcertificate.h
1/*
2 * SPDX-FileCopyrightText: 2021 Volker Krause <vkrause@kde.org>
3 * SPDX-License-Identifier: LGPL-2.0-or-later
4 */
5
6#ifndef KHEALTHCERTIFICATE_H
7#define KHEALTHCERTIFICATE_H
8
9#include "khealthcertificate_export.h"
10#include <QMetaType>
11
12/** Dummy RTTI for QML, which doesn't support `instanceof` on Q_GADGETs... */
13class KHEALTHCERTIFICATE_EXPORT KHealthCertificate
14{
15 Q_GADGET
16public:
17 enum CertificateType {
18 Vaccination,
19 Test,
20 Recovery,
21 };
22 Q_ENUM(CertificateType)
23
24 enum CertificateValidation {
25 Valid,
26 Partial,
27 Invalid,
28 Unknown
29 };
30 Q_ENUM(CertificateValidation)
31
32 /** Result of attempting to verify the cryptographic signature of a certificate. */
34 ValidSignature, ///< signature is valid
35 InvalidSignature, ///< signature is invalid
36 UnknownSignature, ///< signature verification was attempted but didn't yield a result, e.g. due to a missing certificate of signing entity.
37 UncheckedSignature, ///< signature verification was not attempted, e.g. as it's not yet implemented for the specific certificate type.
38 };
39 Q_ENUM(SignatureValidation)
40
41 /** Returns the last date until @p certificate is relevant.
42 * That is, past the returned date, the certificate is considered expired and thus provides
43 * no or only very limited use anymore.
44 * This is useful for sorting a set of certificate in the UI in a meaningful way.
45 */
46 static QDateTime relevantUntil(const QVariant &certificate);
47};
48
49#endif // KHEALTHCERTIFICATE_H
Dummy RTTI for QML, which doesn't support instanceof on Q_GADGETs...
SignatureValidation
Result of attempting to verify the cryptographic signature of a certificate.
@ ValidSignature
signature is valid
@ InvalidSignature
signature is invalid
@ UncheckedSignature
signature verification was not attempted, e.g. as it's not yet implemented for the specific certifica...
@ UnknownSignature
signature verification was attempted but didn't yield a result, e.g. due to a missing certificate of ...
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 24 2024 11:51:28 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.