qsslcertificate.sip 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. // qsslcertificate.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtNetwork Python extension module.
  4. //
  5. // Copyright (c) 2026 Riverbank Computing Limited <info@riverbankcomputing.com>
  6. //
  7. // This file is part of PyQt6.
  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. %If (PyQt_SSL)
  22. class QSslCertificate
  23. {
  24. %TypeHeaderCode
  25. #include <qsslcertificate.h>
  26. %End
  27. public:
  28. enum SubjectInfo
  29. {
  30. Organization,
  31. CommonName,
  32. LocalityName,
  33. OrganizationalUnitName,
  34. CountryName,
  35. StateOrProvinceName,
  36. DistinguishedNameQualifier,
  37. SerialNumber,
  38. EmailAddress,
  39. };
  40. QSslCertificate(QIODevice *device, QSsl::EncodingFormat format = QSsl::Pem) /ReleaseGIL/;
  41. QSslCertificate(const QByteArray &data = QByteArray(), QSsl::EncodingFormat format = QSsl::Pem);
  42. QSslCertificate(const QSslCertificate &other);
  43. ~QSslCertificate();
  44. bool operator==(const QSslCertificate &other) const;
  45. bool operator!=(const QSslCertificate &other) const;
  46. bool isNull() const;
  47. void clear();
  48. QByteArray version() const;
  49. QByteArray serialNumber() const;
  50. QByteArray digest(QCryptographicHash::Algorithm algorithm = QCryptographicHash::Md5) const;
  51. QStringList issuerInfo(QSslCertificate::SubjectInfo info) const;
  52. QStringList issuerInfo(const QByteArray &attribute) const;
  53. QStringList subjectInfo(QSslCertificate::SubjectInfo info) const;
  54. QStringList subjectInfo(const QByteArray &attribute) const;
  55. QMultiMap<QSsl::AlternativeNameEntryType, QString> subjectAlternativeNames() const;
  56. QDateTime effectiveDate() const;
  57. QDateTime expiryDate() const;
  58. QSslKey publicKey() const;
  59. QByteArray toPem() const;
  60. QByteArray toDer() const;
  61. static QList<QSslCertificate> fromPath(const QString &path, QSsl::EncodingFormat format = QSsl::Pem, QSslCertificate::PatternSyntax syntax = QSslCertificate::PatternSyntax::FixedString);
  62. static QList<QSslCertificate> fromDevice(QIODevice *device, QSsl::EncodingFormat format = QSsl::Pem);
  63. static QList<QSslCertificate> fromData(const QByteArray &data, QSsl::EncodingFormat format = QSsl::Pem);
  64. %If (Qt_6_10_0 -)
  65. static QList<QSslCertificate> fromFile(const QString &filePath, QSsl::EncodingFormat format = QSsl::Pem);
  66. %End
  67. Qt::HANDLE handle() const;
  68. void swap(QSslCertificate &other /Constrained/);
  69. bool isBlacklisted() const;
  70. QList<QByteArray> subjectInfoAttributes() const;
  71. QList<QByteArray> issuerInfoAttributes() const;
  72. QList<QSslCertificateExtension> extensions() const;
  73. QString toText() const;
  74. static QList<QSslError> verify(const QList<QSslCertificate> &certificateChain, const QString &hostName = QString());
  75. bool isSelfSigned() const;
  76. Py_hash_t __hash__() const;
  77. %MethodCode
  78. sipRes = qHash(*sipCpp);
  79. %End
  80. static bool importPkcs12(QIODevice *device, QSslKey *key, QSslCertificate *certificate, QList<QSslCertificate> *caCertificates = 0, const QByteArray &passPhrase = QByteArray()) /ReleaseGIL/;
  81. QString issuerDisplayName() const;
  82. QString subjectDisplayName() const;
  83. enum class PatternSyntax
  84. {
  85. RegularExpression,
  86. Wildcard,
  87. FixedString,
  88. };
  89. };
  90. %End