1// qsslcertificate.sip generated by MetaSIP
2//
3// This file is part of the QtNetwork Python extension module.
4//
5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com>
6//
7// This file is part of PyQt5.
8//
9// This file may be used under the terms of the GNU General Public License
10// version 3.0 as published by the Free Software Foundation and appearing in
11// the file LICENSE included in the packaging of this file.  Please review the
12// following information to ensure the GNU General Public License version 3.0
13// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
14//
15// If you do not wish to use this file under the terms of the GPL version 3.0
16// then you may purchase a commercial license.  For more information contact
17// info@riverbankcomputing.com.
18//
19// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21
22
23%If (PyQt_SSL)
24
25class QSslCertificate
26{
27%TypeHeaderCode
28#include <qsslcertificate.h>
29%End
30
31public:
32    enum SubjectInfo
33    {
34        Organization,
35        CommonName,
36        LocalityName,
37        OrganizationalUnitName,
38        CountryName,
39        StateOrProvinceName,
40        DistinguishedNameQualifier,
41        SerialNumber,
42        EmailAddress,
43    };
44
45    QSslCertificate(QIODevice *device, QSsl::EncodingFormat format = QSsl::Pem) /ReleaseGIL/;
46    QSslCertificate(const QByteArray &data = QByteArray(), QSsl::EncodingFormat format = QSsl::Pem);
47    QSslCertificate(const QSslCertificate &other);
48    ~QSslCertificate();
49    bool operator==(const QSslCertificate &other) const;
50    bool operator!=(const QSslCertificate &other) const;
51    bool isNull() const;
52    void clear();
53    QByteArray version() const;
54    QByteArray serialNumber() const;
55    QByteArray digest(QCryptographicHash::Algorithm algorithm = QCryptographicHash::Md5) const;
56    QStringList issuerInfo(QSslCertificate::SubjectInfo info) const;
57    QStringList issuerInfo(const QByteArray &attribute) const;
58    QStringList subjectInfo(QSslCertificate::SubjectInfo info) const;
59    QStringList subjectInfo(const QByteArray &attribute) const;
60    QMultiMap<QSsl::AlternativeNameEntryType, QString> subjectAlternativeNames() const;
61    QDateTime effectiveDate() const;
62    QDateTime expiryDate() const;
63    QSslKey publicKey() const;
64    QByteArray toPem() const;
65    QByteArray toDer() const;
66    static QList<QSslCertificate> fromPath(const QString &path, QSsl::EncodingFormat format = QSsl::Pem, QRegExp::PatternSyntax syntax = QRegExp::FixedString);
67    static QList<QSslCertificate> fromDevice(QIODevice *device, QSsl::EncodingFormat format = QSsl::Pem);
68    static QList<QSslCertificate> fromData(const QByteArray &data, QSsl::EncodingFormat format = QSsl::Pem);
69    Qt::HANDLE handle() const;
70    void swap(QSslCertificate &other /Constrained/);
71    bool isBlacklisted() const;
72    QList<QByteArray> subjectInfoAttributes() const;
73    QList<QByteArray> issuerInfoAttributes() const;
74    QList<QSslCertificateExtension> extensions() const;
75    QString toText() const;
76    static QList<QSslError> verify(QList<QSslCertificate> certificateChain, const QString &hostName = QString());
77%If (Qt_5_4_0 -)
78    bool isSelfSigned() const;
79%End
80%If (Qt_5_4_0 -)
81    long __hash__() const;
82%MethodCode
83        sipRes = qHash(*sipCpp);
84%End
85
86%End
87%If (Qt_5_4_0 -)
88    static bool importPkcs12(QIODevice *device, QSslKey *key, QSslCertificate *certificate, QList<QSslCertificate> *caCertificates = 0, const QByteArray &passPhrase = QByteArray()) /ReleaseGIL/;
89%End
90%If (Qt_5_12_0 -)
91    QString issuerDisplayName() const;
92%End
93%If (Qt_5_12_0 -)
94    QString subjectDisplayName() const;
95%End
96%If (Qt_5_15_0 -)
97
98    enum class PatternSyntax
99    {
100        RegularExpression,
101        Wildcard,
102        FixedString,
103    };
104
105%End
106};
107
108%End
109