KHealthCertificate

ktestcertificate.h
1/*
2 * SPDX-FileCopyrightText: 2021 Volker Krause <vkrause@kde.org>
3 * SPDX-License-Identifier: LGPL-2.0-or-later
4 */
5
6#ifndef KTESTCERTIFICATE_H
7#define KTESTCERTIFICATE_H
8
9#include "khealthcertificate_export.h"
10#include "khealthcertificatetypes.h"
11
12#include <QDate>
13#include <QUrl>
14
15class KTestCertificatePrivate;
16
17/** A test certificate. */
18class KHEALTHCERTIFICATE_EXPORT KTestCertificate
19{
20 KHEALTHCERTIFICATE_GADGET(Test)
21 KHEALTHCERTIFICATE_PROPERTY(QString, name, setName)
22 KHEALTHCERTIFICATE_PROPERTY(QDate, dateOfBirth, setDateOfBirth)
23 KHEALTHCERTIFICATE_PROPERTY(QDate, date, setDate)
24 KHEALTHCERTIFICATE_PROPERTY(QString, disease, setDisease)
25 /** The type of test, such as PCR or antigen. */
26 KHEALTHCERTIFICATE_PROPERTY(QString, testType, setTestType)
27 /** The test manufacturer/product used. */
28 KHEALTHCERTIFICATE_PROPERTY(QString, testName, setTestName)
29 /** URL pointing to further information about the test product. */
30 KHEALTHCERTIFICATE_PROPERTY(QUrl, testUrl, setTestUrl)
31 KHEALTHCERTIFICATE_PROPERTY(QString, resultString, setResultString)
32 KHEALTHCERTIFICATE_PROPERTY(QString, testCenter, setTestCenter)
33 /** Country the certificate was issued in, as ISO 3166-1 alpha 2 code. */
34 KHEALTHCERTIFICATE_PROPERTY(QString, country, setCountry)
35 /** The entity that issued this certificate. */
36 KHEALTHCERTIFICATE_PROPERTY(QString, certificateIssuer, setCertificateIssuer)
37 /** The unique identifier of this certificate. */
38 KHEALTHCERTIFICATE_PROPERTY(QString, certificateId, setCertificateId)
39 /** Date/time this certificate has been issued at. */
40 KHEALTHCERTIFICATE_PROPERTY(QDateTime, certificateIssueDate, setCertificateIssueDate)
41 /** Date/time this certificate expires. */
42 KHEALTHCERTIFICATE_PROPERTY(QDateTime, certificateExpiryDate, setCertificateExpiryDate)
43 /** Validation status of the cryptographic signature of this certificate. */
44 KHEALTHCERTIFICATE_PROPERTY(KHealthCertificate::SignatureValidation, signatureState, setSignatureState)
45
46 Q_PROPERTY(KHealthCertificate::CertificateValidation validationState READ validationState)
47
48 enum Result {
49 Unknown,
50 Negative,
51 Positive,
52 };
53 Q_ENUM(Result)
54 KHEALTHCERTIFICATE_PROPERTY(Result, result, setResult)
55
56 /** Indicates whether the result is still current. */
57 Q_PROPERTY(bool isCurrent READ isCurrent)
58
59 /** Fully encoded data as represented in the barcode. */
60 KHEALTHCERTIFICATE_PROPERTY(QByteArray, rawData, setRawData)
61public:
62 KHealthCertificate::CertificateValidation validationState() const;
63
64 bool isCurrent() const;
65};
66
67Q_DECLARE_METATYPE(KTestCertificate)
68
69#endif // KTESTCERTIFICATE_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.
A test certificate.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 11 2024 12:09:14 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.