// qsslcertificate.sip generated by MetaSIP on Mon Oct 24 12:34:01 2011 // // This file is part of the QtNetwork Python extension module. // // Copyright (c) 2011 Riverbank Computing Limited // // This file is part of PyQt. // // This file may be used under the terms of the GNU General Public // License versions 2.0 or 3.0 as published by the Free Software // Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3 // included in the packaging of this file. Alternatively you may (at // your option) use any later version of the GNU General Public // License if such license has been publicly approved by Riverbank // Computing Limited (or its successors, if any) and the KDE Free Qt // Foundation. In addition, as a special exception, Riverbank gives you // certain additional rights. These rights are described in the Riverbank // GPL Exception version 1.1, which can be found in the file // GPL_EXCEPTION.txt in this package. // // If you are unsure which license is appropriate for your use, please // contact the sales department at sales@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, }; 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; bool isValid() const; void clear(); QByteArray version() const; QByteArray serialNumber() const; QByteArray digest(QCryptographicHash::Algorithm algorithm = QCryptographicHash::Md5) const; QString issuerInfo(QSslCertificate::SubjectInfo info) const; QString issuerInfo(const QByteArray &tag) const; QString subjectInfo(QSslCertificate::SubjectInfo info) const; QString subjectInfo(const QByteArray &tag) const; QMultiMap alternateSubjectNames() const; 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; }; %End %End %If (Qt_4_3_0 -) %If (PyQt_OpenSSL) // Mapped type for QMultiMap. %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 (vlobj == NULL) { 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 (vlobj == NULL) { 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