summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2022-10-26 10:04:00 +0200
committerMichal Klocek <michal.klocek@qt.io>2022-11-18 15:10:18 +0100
commit2aaaf875327b553eafa29a6ca943893f6e362ef9 (patch)
tree9059de136e8ff39d98d34d75e61667c9d1c902b8
parent16ae468b1034fc2a44b80dd4d964984771d663fa (diff)
Doc: Improve QWebEngineClientCertificateStore documentation
Fixes: QTBUG-106497 Pick-to: 6.4 Change-Id: Ic10d2d54722b071eaacd9f7cb74b08c8ecedcd65 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
-rw-r--r--src/core/api/qwebengineclientcertificatestore.cpp16
-rw-r--r--src/core/doc/src/qtwebengine-features.qdoc5
2 files changed, 20 insertions, 1 deletions
diff --git a/src/core/api/qwebengineclientcertificatestore.cpp b/src/core/api/qwebengineclientcertificatestore.cpp
index 243797193..3d231c05f 100644
--- a/src/core/api/qwebengineclientcertificatestore.cpp
+++ b/src/core/api/qwebengineclientcertificatestore.cpp
@@ -20,7 +20,21 @@ QT_BEGIN_NAMESPACE
The class allows to store client certificates in an in-memory store.
When a web site requests an SSL client certificate, the QWebEnginePage::selectClientCertificate
signal is emitted with matching certificates from the native certificate store or the in-memory store.
- The getInstance() method can be used to access the single instance of the class.
+
+ The class instance can be obtained with the QWebEngineProfile::clientCertificateStore() method.
+
+ \code
+ 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);
+ \endcode
*/
QWebEngineClientCertificateStore::QWebEngineClientCertificateStore(QtWebEngineCore::ClientCertificateStoreData *storeData)
diff --git a/src/core/doc/src/qtwebengine-features.qdoc b/src/core/doc/src/qtwebengine-features.qdoc
index 157fab3d9..ebfe0f6ca 100644
--- a/src/core/doc/src/qtwebengine-features.qdoc
+++ b/src/core/doc/src/qtwebengine-features.qdoc
@@ -123,6 +123,11 @@
recommended to always give the user a choice before uniquely identifying them
to a remote server.
+ To manage a client certificate in-memory store, the QWebEngineClientCertificateStore
+ instance can be obtained with the QWebEngineProfile::clientCertificateStore() method.
+ An application can use this class to add a new certificate with a
+ QWebEngineClientCertificateStore::add() call.
+
\section1 Custom Schemes
\QWE makes it possible for the application to define its own custom