// qsslcertificate.sip generated by MetaSIP // // This file is part of the QtNetwork Python extension module. // // Copyright (c) 2015 Riverbank Computing Limited // // This file is part of PyQt4. // // This file may be used under the terms of the GNU General Public License // version 3.0 as published by the Free Software Foundation and appearing in // the file LICENSE included in the packaging of this file. Please review the // following information to ensure the GNU General Public License version 3.0 // requirements will be met: http://www.gnu.org/copyleft/gpl.html. // // If you do not wish to use this file under the terms of the GPL version 3.0 // then you may purchase a commercial license. For more information contact // info@riverbankcomputing.com. // // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. %If (Qt_4_3_0 -) %If (PyQt_OpenSSL) class QSslCertificate { %TypeHeaderCode #include %End public: enum SubjectInfo { Organization, CommonName, LocalityName, OrganizationalUnitName, CountryName, StateOrProvinceName, %If (Qt_5_0_0 -) DistinguishedNameQualifier, %End %If (Qt_5_0_0 -) SerialNumber, %End %If (Qt_5_0_0 -) EmailAddress, %End }; QSslCertificate(QIODevice *device, QSsl::EncodingFormat format = QSsl::Pem); QSslCertificate(const QByteArray &data = QByteArray(), QSsl::EncodingFormat format = QSsl::Pem); QSslCertificate(const QSslCertificate &other); ~QSslCertificate(); bool operator==(const QSslCertificate &other) const; bool operator!=(const QSslCertificate &other) const; bool isNull() const; %If (PyQt_Deprecated_5_0) bool isValid() const; %End void clear(); QByteArray version() const; QByteArray serialNumber() const; QByteArray digest(QCryptographicHash::Algorithm algorithm = QCryptographicHash::Md5) const; %If (Qt_5_0_0 -) QStringList issuerInfo(QSslCertificate::SubjectInfo info) const; %End %If (- Qt_5_0_0) QString issuerInfo(QSslCertificate::SubjectInfo info) const; %End %If (Qt_5_0_0 -) QStringList issuerInfo(const QByteArray &attribute) const; %End %If (- Qt_5_0_0) QString issuerInfo(const QByteArray &tag) const; %End %If (Qt_5_0_0 -) QStringList subjectInfo(QSslCertificate::SubjectInfo info) const; %End %If (- Qt_5_0_0) QString subjectInfo(QSslCertificate::SubjectInfo info) const; %End %If (Qt_5_0_0 -) QStringList subjectInfo(const QByteArray &attribute) const; %End %If (- Qt_5_0_0) QString subjectInfo(const QByteArray &tag) const; %End %If (Qt_5_0_0 -) QMultiMap subjectAlternativeNames() const; %End %If (PyQt_Deprecated_5_0) QMultiMap alternateSubjectNames() const; %End QDateTime effectiveDate() const; QDateTime expiryDate() const; QSslKey publicKey() const; QByteArray toPem() const; QByteArray toDer() const; static QList fromPath(const QString &path, QSsl::EncodingFormat format = QSsl::Pem, QRegExp::PatternSyntax syntax = QRegExp::FixedString); static QList fromDevice(QIODevice *device, QSsl::EncodingFormat format = QSsl::Pem); static QList fromData(const QByteArray &data, QSsl::EncodingFormat format = QSsl::Pem); Qt::HANDLE handle() const; %If (Qt_5_0_0 -) void swap(QSslCertificate &other); %End %If (Qt_5_0_0 -) bool isBlacklisted() const; %End %If (Qt_5_0_0 -) QList subjectInfoAttributes() const; %End %If (Qt_5_0_0 -) QList issuerInfoAttributes() const; %End %If (Qt_5_0_0 -) QList extensions() const; %End %If (Qt_5_0_0 -) QString toText() const; %End %If (Qt_5_0_0 -) static QList verify(QList certificateChain, const QString &hostName = QString()); %End }; %End %End %If (Qt_5_0_0 -) %If (PyQt_OpenSSL) // Mapped type for QMultiMap. %MappedType QMultiMap /DocType="Py_v3:dict-of-QSsl.AlternativeNameEntryType-list-of-str;dict-of-QSsl.AlternateNameEntryType-list-of-QString"/ { %TypeHeaderCode #include #include #include %End %ConvertFromTypeCode // Get the enum objects that are the dictionary keys. static PyObject *email_entry = NULL; static PyObject *dns_entry = NULL; if (email_entry == NULL) { email_entry = PyObject_GetAttrString((PyObject *)sipTypeAsPyTypeObject(sipType_QSsl), #if PY_VERSION_HEX >= 0x02050000 "EmailEntry"); #else const_cast("EmailEntry")); #endif if (email_entry == NULL) return NULL; } if (dns_entry == NULL) { dns_entry = PyObject_GetAttrString((PyObject *)sipTypeAsPyTypeObject(sipType_QSsl), #if PY_VERSION_HEX >= 0x02050000 "DnsEntry"); #else const_cast("DnsEntry")); #endif if (dns_entry == NULL) return NULL; } // Create the dictionary. PyObject *d = PyDict_New(); if (d == NULL) return NULL; QList vl; // Handle the Qssl::EmailEntry key. vl = sipCpp->values(QSsl::EmailEntry); if (!vl.isEmpty()) { PyObject *vlobj = PyList_New(vl.count()); if (vlobj == NULL) { Py_DECREF(d); return NULL; } int rc = PyDict_SetItem(d, email_entry, vlobj); Py_DECREF(email_entry); Py_DECREF(vlobj); if (rc < 0) { Py_DECREF(d); return NULL; } for (int i = 0; i < vl.count(); ++i) { QString *s = new QString(vl.at(i)); PyObject *vobj = sipConvertFromNewType(s, sipType_QString, sipTransferObj); if (vobj == NULL) { delete s; Py_DECREF(d); return NULL; } PyList_SET_ITEM(vlobj, i, vobj); } } // Handle the Qssl::DnsEntry key. vl = sipCpp->values(QSsl::DnsEntry); if (!vl.isEmpty()) { PyObject *vlobj = PyList_New(vl.count()); if (vlobj == NULL) { Py_DECREF(d); return NULL; } int rc = PyDict_SetItem(d, dns_entry, vlobj); Py_DECREF(dns_entry); Py_DECREF(vlobj); if (rc < 0) { Py_DECREF(d); return NULL; } for (int i = 0; i < vl.count(); ++i) { QString *s = new QString(vl.at(i)); PyObject *vobj = sipConvertFromNewType(s, sipType_QString, sipTransferObj); if (vobj == NULL) { delete s; Py_DECREF(d); return NULL; } PyList_SET_ITEM(vlobj, i, vobj); } } return d; %End %ConvertToTypeCode if (sipIsErr == NULL) { // We don't support passing the type as an argument as it isn't // currently needed (and is unlikely to be in the future). PyErr_SetString(PyExc_NotImplementedError, "converting to QMultiMap is unsupported"); return 0; } // Keep the compiler quiet. sipPy = NULL; return 0; %End }; %End %End %If (Qt_4_3_0 -) %If (PyQt_Deprecated_5_0) // Mapped type for QMultiMap. %If (PyQt_OpenSSL) %MappedType QMultiMap /DocType="Py_v3:dict-of-QSsl.AlternateNameEntryType-list-of-str;dict-of-QSsl.AlternateNameEntryType-list-of-QString"/ { %TypeHeaderCode #include #include #include %End %ConvertFromTypeCode // Get the enum objects that are the dictionary keys. static PyObject *email_entry = NULL; static PyObject *dns_entry = NULL; if (email_entry == NULL) { email_entry = PyObject_GetAttrString((PyObject *)sipTypeAsPyTypeObject(sipType_QSsl), #if PY_VERSION_HEX >= 0x02050000 "EmailEntry"); #else const_cast("EmailEntry")); #endif if (email_entry == NULL) return NULL; } if (dns_entry == NULL) { dns_entry = PyObject_GetAttrString((PyObject *)sipTypeAsPyTypeObject(sipType_QSsl), #if PY_VERSION_HEX >= 0x02050000 "DnsEntry"); #else const_cast("DnsEntry")); #endif if (dns_entry == NULL) return NULL; } // Create the dictionary. PyObject *d = PyDict_New(); if (d == NULL) return NULL; QList vl; // Handle the Qssl::EmailEntry key. vl = sipCpp->values(QSsl::EmailEntry); if (!vl.isEmpty()) { PyObject *vlobj = PyList_New(vl.count()); if (vlobj == NULL) { Py_DECREF(d); return NULL; } int rc = PyDict_SetItem(d, email_entry, vlobj); Py_DECREF(email_entry); Py_DECREF(vlobj); if (rc < 0) { Py_DECREF(d); return NULL; } for (int i = 0; i < vl.count(); ++i) { QString *s = new QString(vl.at(i)); PyObject *vobj = sipConvertFromNewType(s, sipType_QString, sipTransferObj); if (vobj == NULL) { delete s; Py_DECREF(d); return NULL; } PyList_SET_ITEM(vlobj, i, vobj); } } // Handle the Qssl::DnsEntry key. vl = sipCpp->values(QSsl::DnsEntry); if (!vl.isEmpty()) { PyObject *vlobj = PyList_New(vl.count()); if (vlobj == NULL) { Py_DECREF(d); return NULL; } int rc = PyDict_SetItem(d, dns_entry, vlobj); Py_DECREF(dns_entry); Py_DECREF(vlobj); if (rc < 0) { Py_DECREF(d); return NULL; } for (int i = 0; i < vl.count(); ++i) { QString *s = new QString(vl.at(i)); PyObject *vobj = sipConvertFromNewType(s, sipType_QString, sipTransferObj); if (vobj == NULL) { delete s; Py_DECREF(d); return NULL; } PyList_SET_ITEM(vlobj, i, vobj); } } return d; %End %ConvertToTypeCode if (sipIsErr == NULL) { // We don't support passing the type as an argument as it isn't // currently needed (and is unlikely to be in the future). PyErr_SetString(PyExc_NotImplementedError, "converting to QMultiMap is unsupported"); return 0; } // Keep the compiler quiet. sipPy = NULL; return 0; %End }; %End %End %End