Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
src_network_ssl_qsslpresharedkeyauthenticator.cpp
Go to the documentation of this file.
1// Copyright (C) 2018 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4//! [0]
5 connect(socket, &QSslSocket::preSharedKeyAuthenticationRequired,
6 this, &AuthManager::handlePreSharedKeyAuthentication);
7//! [0]
8
9//! [1]
10 void AuthManager::handlePreSharedKeyAuthentication(QSslPreSharedKeyAuthenticator *authenticator)
11 {
12 authenticator->setIdentity("My Qt App");
13
14 const QByteArray key = deriveKey(authenticator->identityHint(), passphrase);
15 authenticator->setPreSharedKey(key);
16 }
17//! [1]
connect(quitButton, &QPushButton::clicked, &app, &QCoreApplication::quit, Qt::QueuedConnection)