File indexing completed on 2024-11-24 04:44:41

0001 /*
0002  * SPDX-FileCopyrightText: 2021 Volker Krause <vkrause@kde.org>
0003  * SPDX-License-Identifier: LGPL-2.0-or-later
0004  */
0005 
0006 #ifndef KHEALTHCERTIFICATEPARSER_H
0007 #define KHEALTHCERTIFICATEPARSER_H
0008 
0009 #include "khealthcertificate_export.h"
0010 
0011 class QByteArray;
0012 class QVariant;
0013 
0014 /** Parses health certificates. */
0015 namespace KHealthCertificateParser
0016 {
0017     /**
0018      * Parse a single digital health certificate.
0019      *
0020      * @param data The digital health certificate, typically this is the content of a QR code.
0021      * Input can be of any supported format, the exact type is auto-detected.
0022      *
0023      * @returns Four different things can be returned, depending on the input.
0024      * - KVaccinationCertificate
0025      * - KTestCertificate
0026      * - KRecoveryCertificate
0027      * - a null QVariant in case of invalid or unsupported input
0028      * If the input was parsed successfully but is semantically invalid that needs to be checked
0029      * separately, see e.g. KVaccinationCertificate::signatureState and KVaccinationCertificate::validationState.
0030      */
0031     KHEALTHCERTIFICATE_EXPORT QVariant parse(const QByteArray &data);
0032 }
0033 
0034 #endif // KHEALTHCERTIFICATEPARSER_H