Skip to content

PythonQt.QtNetwork.QSslCertificate · declarations 001

Back to PythonQt.QtNetwork.QSslCertificate

CommonName instance-attribute

CommonName: Any

CountryName instance-attribute

CountryName: Any

DistinguishedNameQualifier instance-attribute

DistinguishedNameQualifier: Any

EmailAddress instance-attribute

EmailAddress: Any

LocalityName instance-attribute

LocalityName: Any

Organization instance-attribute

Organization: Any

OrganizationalUnitName instance-attribute

OrganizationalUnitName: Any

SerialNumber instance-attribute

SerialNumber: Any

StateOrProvinceName instance-attribute

StateOrProvinceName: Any

SubjectInfo instance-attribute

SubjectInfo: type

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

int('0b100', base=0) 4

clear

clear() -> None

X.clear()

Supplemental documentation: Qt 5 reference:

void QSslCertificate::clear()

Clears the contents of this certificate, making it a null certificate.

See also isNull().

Upstream PySide2 reference signatures (binding differences may apply):

clear(self) -> None

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

digest

digest(algorithm: Any) -> Any

X.digest(algorithm) -> PythonQt.QtCore.QByteArray

Supplemental documentation: Qt 5 reference:

QByteArray QSslCertificate::digest(QCryptographicHash::Algorithm algorithm \= QCryptographicHash::Md5) const

Returns a cryptographic digest of this certificate. By default, an MD5 digest will be generated, but you can also specify a custom algorithm.

Upstream PySide2 reference signatures (binding differences may apply):

digest(self, algorithm: PySide2.QtCore.QCryptographicHash.Algorithm=...) -> PySide2.QtCore.QByteArray

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

effectiveDate

effectiveDate() -> Any

X.effectiveDate() -> PythonQt.QtCore.QDateTime

Supplemental documentation: Qt 5 reference:

QDateTime QSslCertificate::effectiveDate() const

Returns the date-time that the certificate becomes valid, or an empty QDateTime if this is a null certificate.

See also expiryDate().

Upstream PySide2 reference signatures (binding differences may apply):

effectiveDate(self) -> PySide2.QtCore.QDateTime

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

expiryDate

expiryDate() -> Any

X.expiryDate() -> PythonQt.QtCore.QDateTime

Supplemental documentation: Qt 5 reference:

QDateTime QSslCertificate::expiryDate() const

Returns the date-time that the certificate expires, or an empty QDateTime if this is a null certificate.

See also effectiveDate().

Upstream PySide2 reference signatures (binding differences may apply):

expiryDate(self) -> PySide2.QtCore.QDateTime

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

extensions

extensions() -> tuple

X.extensions() -> tuple

Supplemental documentation: Qt 5 reference:

QList\<QSslCertificateExtension> QSslCertificate::extensions() const

Returns a list containing the X509 extensions of this certificate.

This function was introduced in Qt 5.0.

Upstream PySide2 reference signatures (binding differences may apply):

extensions(self) -> typing.List[PySide2.QtNetwork.QSslCertificateExtension]

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

fromData

fromData(data: Any, format: Any) -> tuple

X.fromData(data, format) -> tuple

Supplemental documentation: Qt 5 reference:

[static] QList\<QSslCertificate> QSslCertificate::fromData(const QByteArray \&data, QSsl::EncodingFormat format \= QSsl::Pem)

Searches for and parses all certificates in data that are encoded in the specified format and returns them in a list of certificates.

See also fromDevice().

Upstream PySide2 reference signatures (binding differences may apply):

fromData(data: PySide2.QtCore.QByteArray, format: PySide2.QtNetwork.QSsl.EncodingFormat=...) -> typing.List[PySide2.QtNetwork.QSslCertificate]

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

fromDevice

fromDevice(device: Any, format: Any) -> tuple

X.fromDevice(device, format) -> tuple

Supplemental documentation: Qt 5 reference:

[static] QList\<QSslCertificate> QSslCertificate::fromDevice(QIODevice *device, QSsl::EncodingFormat format \= QSsl::Pem)

Searches for and parses all certificates in device that are encoded in the specified format and returns them in a list of certificates.

See also fromData().

Upstream PySide2 reference signatures (binding differences may apply):

fromDevice(device: PySide2.QtCore.QIODevice, format: PySide2.QtNetwork.QSsl.EncodingFormat=...) -> typing.List[PySide2.QtNetwork.QSslCertificate]

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

fromPath

fromPath(path: str, format: Any, syntax: Any) -> tuple

X.fromPath(path, format, syntax) -> tuple

Supplemental documentation: Qt 5 reference:

[static] QList\<QSslCertificate> QSslCertificate::fromPath(const QString \&path, QSsl::EncodingFormat format \= QSsl::Pem, QSslCertificate::PatternSyntax syntax \= PatternSyntax::FixedString)

Searches all files in the path for certificates encoded in the specified format and returns them in a list. path must be a file or a pattern matching one or more files, as specified by syntax.

Example:

const auto certs = QSslCertificate::fromPath("C:/ssl/certificate.*.pem",
                                             QSsl::Pem, QSslCertificate::Wildcard);
for (const QSslCertificate &cert : certs) {
    qDebug() << cert.issuerInfo(QSslCertificate::Organization);
}

This function was introduced in Qt 5.15.

See also fromData().

Upstream PySide2 reference signatures (binding differences may apply):

fromPath(path: str, format: PySide2.QtNetwork.QSsl.EncodingFormat, syntax: PySide2.QtCore.QRegExp.PatternSyntax) -> typing.List[PySide2.QtNetwork.QSslCertificate]
fromPath(path: str, format: PySide2.QtNetwork.QSsl.EncodingFormat=..., syntax: PySide2.QtNetwork.QSslCertificate.PatternSyntax=...) -> typing.List[PySide2.QtNetwork.QSslCertificate]

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

handle

handle() -> int

X.handle()

Supplemental documentation: Qt 5 reference:

Qt::HANDLE QSslCertificate::handle() const

Returns a pointer to the native certificate handle, if there is one, else nullptr.

You can use this handle, together with the native API, to access extended information about the certificate.

Warning: Use of this function has a high probability of being non-portable, and its return value may vary from platform to platform or change from minor release to minor release.

Upstream PySide2 reference signatures (binding differences may apply):

handle(self) -> int

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

importPkcs12

importPkcs12(device: Any, key: Any, cert: Any, caCertificates: Any, passPhrase: Any) -> bool

X.importPkcs12(device, key, cert, caCertificates, passPhrase) -> bool

Supplemental documentation: Qt 5 reference:

[static] bool QSslCertificate::importPkcs12(QIODevice *device, QSslKey *key, QSslCertificate *certificate, QList\<QSslCertificate> *caCertificates \= nullptr, const QByteArray \&passPhrase \= QByteArray())

Imports a PKCS#12 (pfx) file from the specified device. A PKCS#12 file is a bundle that can contain a number of certificates and keys. This method reads a single key, its certificate and any associated caCertificates from the bundle. If a passPhrase is specified then this will be used to decrypt the bundle. Returns true if the PKCS#12 file was successfully loaded.

Note: The device must be open and ready to be read from.

This function was introduced in Qt 5.4.

Upstream PySide2 reference signatures (binding differences may apply):

importPkcs12(device: PySide2.QtCore.QIODevice, key: PySide2.QtNetwork.QSslKey, cert: PySide2.QtNetwork.QSslCertificate, caCertificates: typing.Optional[typing.Sequence[PySide2.QtNetwork.QSslCertificate]]=..., passPhrase: PySide2.QtCore.QByteArray=...) -> bool

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

isBlacklisted

isBlacklisted() -> bool

X.isBlacklisted() -> bool

Supplemental documentation: Qt 5 reference:

bool QSslCertificate::isBlacklisted() const

Returns true if this certificate is blacklisted; otherwise returns false.

See also isNull().

Upstream PySide2 reference signatures (binding differences may apply):

isBlacklisted(self) -> bool

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

isNull

isNull() -> bool

X.isNull() -> bool

Supplemental documentation: Qt 5 reference:

bool QSslCertificate::isNull() const

Returns true if this is a null certificate (i.e., a certificate with no contents); otherwise returns false.

By default, QSslCertificate constructs a null certificate.

See also clear().

Upstream PySide2 reference signatures (binding differences may apply):

isNull(self) -> bool

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

isSelfSigned

isSelfSigned() -> bool

X.isSelfSigned() -> bool

Supplemental documentation: Qt 5 reference:

bool QSslCertificate::isSelfSigned() const

Returns true if this certificate is self signed; otherwise returns false.

A certificate is considered self-signed its issuer and subject are identical.

This function was introduced in Qt 5.4.

Upstream PySide2 reference signatures (binding differences may apply):

isSelfSigned(self) -> bool

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

issuerInfo

issuerInfo(info: Any) -> tuple

X.issuerInfo(info) -> tuple

Supplemental documentation: Qt 5 reference:

QStringList QSslCertificate::issuerInfo(QSslCertificate::SubjectInfo subject) const

Returns the issuer information for the subject from the certificate, or an empty list if there is no information for subject in the certificate. There can be more than one entry of each type.

See also subjectInfo().

QStringList QSslCertificate::issuerInfo(const QByteArray \&attribute) const

Returns the issuer information for attribute from the certificate, or an empty list if there is no information for attribute in the certificate. There can be more than one entry for an attribute.

See also subjectInfo().

Upstream PySide2 reference signatures (binding differences may apply):

issuerInfo(self, attribute: PySide2.QtCore.QByteArray) -> typing.List[str]
issuerInfo(self, info: PySide2.QtNetwork.QSslCertificate.SubjectInfo) -> typing.List[str]

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

issuerInfoAttributes

issuerInfoAttributes() -> Any

X.issuerInfoAttributes()

Supplemental documentation: Qt 5 reference:

QList\<QByteArray> QSslCertificate::issuerInfoAttributes() const

Returns a list of the attributes that have values in the issuer information of this certificate. The information associated with a given attribute can be accessed using the issuerInfo() method. Note that this list may include the OIDs for any elements that are not known by the SSL backend.

This function was introduced in Qt 5.0.

See also subjectInfo().

Upstream PySide2 reference signatures (binding differences may apply):

issuerInfoAttributes(self) -> typing.List[PySide2.QtCore.QByteArray]

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

operator_assign

operator_assign(other: Any) -> Any

X.operator_assign(other) -> PythonQt.QtNetwork.QSslCertificate

publicKey

publicKey() -> Any

X.publicKey() -> PythonQt.QtNetwork.QSslKey

Supplemental documentation: Qt 5 reference:

QSslKey QSslCertificate::publicKey() const

Returns the certificate subject's public key.

Upstream PySide2 reference signatures (binding differences may apply):

publicKey(self) -> PySide2.QtNetwork.QSslKey

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

serialNumber

serialNumber() -> Any

X.serialNumber() -> PythonQt.QtCore.QByteArray

Supplemental documentation: Qt 5 reference:

QByteArray QSslCertificate::serialNumber() const

Returns the certificate's serial number string in hexadecimal format.

Upstream PySide2 reference signatures (binding differences may apply):

serialNumber(self) -> PySide2.QtCore.QByteArray

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

subjectAlternativeNames

subjectAlternativeNames() -> Any

X.subjectAlternativeNames()

Supplemental documentation: Qt 5 reference:

QMultiMap\<QSsl::AlternativeNameEntryType, QString> QSslCertificate::subjectAlternativeNames() const

Returns the list of alternative subject names for this certificate. The alternative names typically contain host names, optionally with wildcards, that are valid for this certificate.

These names are tested against the connected peer's host name, if either the subject information for CommonName doesn't define a valid host name, or the subject info name doesn't match the peer's host name.

See also subjectInfo().

Upstream PySide2 reference signatures (binding differences may apply):

subjectAlternativeNames(self) -> typing.Dict[PySide2.QtNetwork.QSsl.AlternativeNameEntryType, typing.List[str]]

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

subjectInfo

subjectInfo(info: Any) -> tuple

X.subjectInfo(info) -> tuple

Supplemental documentation: Qt 5 reference:

QStringList QSslCertificate::subjectInfo(QSslCertificate::SubjectInfo subject) const

Returns the information for the subject, or an empty list if there is no information for subject in the certificate. There can be more than one entry of each type.

See also issuerInfo().

QStringList QSslCertificate::subjectInfo(const QByteArray \&attribute) const

Returns the subject information for attribute, or an empty list if there is no information for attribute in the certificate. There can be more than one entry for an attribute.

See also issuerInfo().

Upstream PySide2 reference signatures (binding differences may apply):

subjectInfo(self, attribute: PySide2.QtCore.QByteArray) -> typing.List[str]
subjectInfo(self, info: PySide2.QtNetwork.QSslCertificate.SubjectInfo) -> typing.List[str]

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

subjectInfoAttributes

subjectInfoAttributes() -> Any

X.subjectInfoAttributes()

Supplemental documentation: Qt 5 reference:

QList\<QByteArray> QSslCertificate::subjectInfoAttributes() const

Returns a list of the attributes that have values in the subject information of this certificate. The information associated with a given attribute can be accessed using the subjectInfo() method. Note that this list may include the OIDs for any elements that are not known by the SSL backend.

This function was introduced in Qt 5.0.

See also subjectInfo().

Upstream PySide2 reference signatures (binding differences may apply):

subjectInfoAttributes(self) -> typing.List[PySide2.QtCore.QByteArray]

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

swap

swap(other: Any) -> None

X.swap(other)

Supplemental documentation: Qt 5 reference:

void QSslCertificate::swap(QSslCertificate \&other)

Swaps this certificate instance with other. This function is very fast and never fails.

This function was introduced in Qt 5.0.

Upstream PySide2 reference signatures (binding differences may apply):

swap(self, other: PySide2.QtNetwork.QSslCertificate) -> None

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

toDer

toDer() -> Any

X.toDer() -> PythonQt.QtCore.QByteArray

Supplemental documentation: Qt 5 reference:

QByteArray QSslCertificate::toDer() const

Returns this certificate converted to a DER (binary) encoded representation.

Upstream PySide2 reference signatures (binding differences may apply):

toDer(self) -> PySide2.QtCore.QByteArray

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

toPem

toPem() -> Any

X.toPem() -> PythonQt.QtCore.QByteArray

Supplemental documentation: Qt 5 reference:

QByteArray QSslCertificate::toPem() const

Returns this certificate converted to a PEM (Base64) encoded representation.

Upstream PySide2 reference signatures (binding differences may apply):

toPem(self) -> PySide2.QtCore.QByteArray

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

toText

toText() -> str

X.toText() -> str

Supplemental documentation: Qt 5 reference:

QString QSslCertificate::toText() const

Returns this certificate converted to a human-readable text representation.

This function was introduced in Qt 5.0.

Upstream PySide2 reference signatures (binding differences may apply):

toText(self) -> str

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

verify

verify(certificateChain: Any, hostName: str) -> tuple

X.verify(certificateChain, hostName) -> tuple

Supplemental documentation: Qt 5 reference:

[static] QList\<QSslError> QSslCertificate::verify(QList\<QSslCertificate> certificateChain, const QString \&hostName \= QString())

Verifies a certificate chain. The chain to be verified is passed in the certificateChain parameter. The first certificate in the list should be the leaf certificate of the chain to be verified. If hostName is specified then the certificate is also checked to see if it is valid for the specified host name.

Note that the root (CA) certificate should not be included in the list to be verified, this will be looked up automatically using the CA list specified in the default QSslConfiguration, and, in addition, if possible, CA certificates loaded on demand on Unix and Windows.

This function was introduced in Qt 5.0.

Upstream PySide2 reference signatures (binding differences may apply):

verify(certificateChain: typing.Sequence[PySide2.QtNetwork.QSslCertificate], hostName: str=...) -> typing.List[PySide2.QtNetwork.QSslError]

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

version

version() -> Any

X.version() -> PythonQt.QtCore.QByteArray

Supplemental documentation: Qt 5 reference:

QByteArray QSslCertificate::version() const

Returns the certificate's version string.

Upstream PySide2 reference signatures (binding differences may apply):

version(self) -> PySide2.QtCore.QByteArray

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