Skip to content

PythonQt.Qt.QSslCertificate

QSslCertificate

PythonQtInstanceWrapper object

Native bases: PythonQtInstanceWrapper

Supplemental documentation: Qt 5 reference:

Detailed Description

QSslCertificate stores an X509 certificate, and is commonly used to verify the identity and store information about the local host, a remotely connected peer, or a trusted third party Certificate Authority.

There are many ways to construct a QSslCertificate. The most common way is to call QSslSocket::peerCertificate(), which returns a QSslCertificate object, or QSslSocket::peerCertificateChain(), which returns a list of them. You can also load certificates from a DER (binary) or PEM (Base64) encoded bundle, typically stored as one or more local files, or in a Qt Resource.

You can call isNull() to check if your certificate is null. By default, QSslCertificate constructs a null certificate. A null certificate is invalid, but an invalid certificate is not necessarily null. If you want to reset all contents in a certificate, call clear().

After loading a certificate, you can find information about the certificate, its subject, and its issuer, by calling one of the many accessor functions, including version(), serialNumber(), issuerInfo() and subjectInfo(). You can call effectiveDate() and expiryDate() to check when the certificate starts being effective and when it expires. The publicKey() function returns the certificate subject's public key as a QSslKey. You can call issuerInfo() or subjectInfo() to get detailed information about the certificate issuer and its subject.

Internally, QSslCertificate is stored as an X509 structure. You can access this handle by calling handle(), but the results are likely to not be portable.

Source: https://doc.qt.io/archives/qt-5.15/qsslcertificate.html

Complete member index

Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.

Member Kind Signature Summary
CommonName attribute Any (shared captured text)
CountryName attribute Any (shared captured text)
DistinguishedNameQualifier attribute Any (shared captured text)
EmailAddress attribute Any (shared captured text)
LocalityName attribute Any (shared captured text)
Organization attribute Any (shared captured text)
OrganizationalUnitName attribute Any (shared captured text)
SerialNumber attribute Any (shared captured text)
StateOrProvinceName attribute Any (shared captured text)
SubjectInfo attribute type Convert a number or string to an integer, or return 0 if no arguments are given. (shared captured text)
__init__ function (self, *args: Any, **kwargs: Any) -> None Native constructor; consult class documentation for supported overloads. (shared captured text)
className function (self, *args: Any, **kwargs: Any) -> Any Return the classname of the object (shared captured text)
clear function (self) -> None Clears the contents of this certificate, making it a null certificate. (shared captured text)
delete function (self, *args: Any, **kwargs: Any) -> Any Deletes the C++ object (at your own risk, my friend!) (shared captured text)
digest function (self, algorithm: Any) -> Any X.digest(algorithm) -> PythonQt.QtCore.QByteArray (shared captured text)
effectiveDate function (self) -> Any X.effectiveDate() -> PythonQt.QtCore.QDateTime (shared captured text)
expiryDate function (self) -> Any X.expiryDate() -> PythonQt.QtCore.QDateTime (shared captured text)
extensions function (self) -> tuple X.extensions() -> tuple (shared captured text)
fromData function (self, data: Any, format: Any) -> tuple X.fromData(data, format) -> tuple (shared captured text)
fromDevice function (self, device: Any, format: Any) -> tuple X.fromDevice(device, format) -> tuple (shared captured text)
fromPath function (self, path: str, format: Any, syntax: Any) -> tuple X.fromPath(path, format, syntax) -> tuple (shared captured text)
handle function (self) -> int Returns a pointer to the native certificate handle, if there is one, else nullptr. (shared captured text)
help function (self, *args: Any, **kwargs: Any) -> Any Shows the help of available methods for this class (shared captured text)
importPkcs12 function (self, device: Any, key: Any, cert: Any, caCertificates: Any, passPhrase: Any) -> bool X.importPkcs12(device, key, cert, caCertificates, passPhrase) -> bool (shared captured text)
inherits function (self, *args: Any, **kwargs: Any) -> Any Returns if the class inherits or is of given type name (shared captured text)
isBlacklisted function (self) -> bool X.isBlacklisted() -> bool (shared captured text)
isNull function (self) -> bool X.isNull() -> bool (shared captured text)
isSelfSigned function (self) -> bool X.isSelfSigned() -> bool (shared captured text)
issuerInfo function (self, info: Any) -> tuple X.issuerInfo(info) -> tuple (shared captured text)
issuerInfoAttributes function (self) -> Any Returns a list of the attributes that have values in the issuer information of this certificate. (shared captured text)
operator_assign function (self, other: Any) -> Any X.operator_assign(other) -> PythonQt.QtNetwork.QSslCertificate (shared captured text)
publicKey function (self) -> Any X.publicKey() -> PythonQt.QtNetwork.QSslKey (shared captured text)
serialNumber function (self) -> Any X.serialNumber() -> PythonQt.QtCore.QByteArray (shared captured text)
subjectAlternativeNames function (self) -> Any Returns the list of alternative subject names for this certificate. (shared captured text)
subjectInfo function (self, info: Any) -> tuple X.subjectInfo(info) -> tuple (shared captured text)
subjectInfoAttributes function (self) -> Any Returns a list of the attributes that have values in the subject information of this certificate. (shared captured text)
swap function (self, other: Any) -> None Swaps this certificate instance with other. (shared captured text)
toDer function (self) -> Any X.toDer() -> PythonQt.QtCore.QByteArray (shared captured text)
toPem function (self) -> Any X.toPem() -> PythonQt.QtCore.QByteArray (shared captured text)
toText function (self) -> str X.toText() -> str (shared captured text)
verify function (self, certificateChain: Any, hostName: str) -> tuple X.verify(certificateChain, hostName) -> tuple (shared captured text)
version function (self) -> Any X.version() -> PythonQt.QtCore.QByteArray (shared captured text)