Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qtlskey_generic_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QTLSKEY_GENERIC_P_H
5#define QTLSKEY_GENERIC_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtNetwork/private/qtnetworkglobal_p.h>
19
20#include <QtNetwork/private/qtlsbackend_p.h>
21
22#include "qtlskey_base_p.h"
23
24
25#include <QtCore/qnamespace.h>
26#include <QtCore/qglobal.h>
27
29
30namespace QTlsPrivate {
31
32// This class is what previously was known as qsslkey_qt:
33// it implements most of functionality needed by QSslKey
34// not relying on any TLS implementation. It's used by
35// our SecureTransport and Schannel backends.
37{
38public:
40
42 const QByteArray &passPhrase, bool deepClear) override;
44 const QByteArray &passPhrase, bool deepClear) override;
45
46 QByteArray toPem(const QByteArray &passPhrase) const override;
47
49 QByteArray> *headers) const override;
50
51 void fromHandle(Qt::HANDLE opaque, KeyType expectedType) override;
52
53 void clear(bool deep) override;
54
55 Qt::HANDLE handle() const override
56 {
57 return Qt::HANDLE(opaque);
58 }
59
60 int length() const override
61 {
62 return keyLength;
63 }
64
65 bool isPkcs8() const override
66 {
67 return pkcs8;
68 }
69
70private:
71 QByteArray decryptPkcs8(const QByteArray &encrypted, const QByteArray &passPhrase);
72
73 bool pkcs8 = false;
74 Qt::HANDLE opaque = nullptr;
75 QByteArray derData;
76 int keyLength = -1;
77};
78
79} // namespace QTlsPrivate
80
82
83#endif // QTLSKEY_GENERIC_P_H
\inmodule QtCore
Definition qbytearray.h:57
Definition qmap.h:187
KeyAlgorithm algorithm() const override
TlsKeyBase(KeyType type=QSsl::PublicKey, KeyAlgorithm algorithm=QSsl::Opaque)
QByteArray derFromPem(const QByteArray &pem, QMap< QByteArray, QByteArray > *headers) const override
bool isPkcs8() const override
QByteArray toPem(const QByteArray &passPhrase) const override
int length() const override
void decodePem(KeyType type, KeyAlgorithm algorithm, const QByteArray &pem, const QByteArray &passPhrase, bool deepClear) override
void fromHandle(Qt::HANDLE opaque, KeyType expectedType) override
Qt::HANDLE handle() const override
void decodeDer(KeyType type, KeyAlgorithm algorithm, const QByteArray &der, const QByteArray &passPhrase, bool deepClear) override
b clear()
KeyType
Describes the two types of keys QSslKey supports.
Definition qssl.h:22
KeyAlgorithm
Describes the different key algorithms supported by QSslKey.
Definition qssl.h:34
Combined button and popup list for selecting options.
Namespace containing onternal types that TLS backends implement.
void * HANDLE
GLenum type