PySide6.QtWebEngineCore.QWebEngineClientCertificateStore¶
- class QWebEngineClientCertificateStore¶
The
QWebEngineClientCertificateStore
class provides an in-memory store for client certificates. More…Synopsis¶
Methods¶
def
add()
def
certificates()
def
clear()
def
remove()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description¶
The class allows to store client certificates in an in-memory store. When a web site requests an SSL client certificate, the
selectClientCertificate
signal is emitted with matching certificates from the native certificate store or the in-memory store.The class instance can be obtained with the
clientCertificateStore()
method.QFile certFile(":/resouces/certificate.crt"); certFile.open(QIODevice::ReadOnly); const QSslCertificate cert(certFile.readAll(), QSsl::Pem); QFile keyFile(":/resources/privatekey.key"); keyFile.open(QIODevice::ReadOnly); const QSslKey sslKey(keyFile.readAll(), QSsl::Rsa, QSsl::Pem, QSsl::PrivateKey, ""); QWebEngineProfile profile; profile.clientCertificateStore()->add(cert, sslKey);
- add(certificate, privateKey)¶
- Parameters:
certificate –
QSslCertificate
privateKey –
QSslKey
Adds a
certificate
with theprivateKey
to the in-memory client certificate store.- certificates()¶
- Return type:
.list of QSslCertificate
Returns a list of the client certificates in the in-memory store. Returns an empty list if the store does not contain any certificates.
- clear()¶
Clears all the client certificates from the in-memory store.
- remove(certificate)¶
- Parameters:
certificate –
QSslCertificate
Deletes all the instances of the client certificate in the in-memory client certificate store that matches the certificate
certificate
.