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
qqmlsslkey_p.h
Go to the documentation of this file.
1// Copyright (C) 2023 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 QQMLSSLKEY_P_H
5#define QQMLSSLKEY_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 <qtqmlnetworkexports.h>
19
20#include <QtCore/QByteArray>
21#include <QtCore/QMetaType>
22#include <QtNetwork/qsslkey.h>
23#include <QtNetwork/qssl.h>
24#include <QtQml/qqml.h>
25
27
28class Q_QMLNETWORK_EXPORT QQmlSslKey
29{
31 QML_NAMED_ELEMENT(sslKey)
33
34 Q_PROPERTY(QString keyFile READ keyFile
35 WRITE setKeyFile)
36 Q_PROPERTY(QSsl::KeyAlgorithm keyAlgorithm READ keyAlgorithm
37 WRITE setKeyAlgorithm)
38 Q_PROPERTY(QSsl::EncodingFormat keyFormat READ keyFormat
39 WRITE setKeyFormat)
40 Q_PROPERTY(QByteArray keyPassPhrase READ keyPassPhrase
41 WRITE setKeyPassPhrase)
42 Q_PROPERTY(QSsl::KeyType keyType READ keyType WRITE setKeyType)
43
44public:
45 QSslKey getSslKey() const;
46 QString keyFile() const { return m_keyFile; }
47 QSsl::KeyAlgorithm keyAlgorithm() const { return m_keyAlgorithm; }
48 QSsl::EncodingFormat keyFormat() const { return m_keyFormat; }
49 QByteArray keyPassPhrase() const { return m_keyPassPhrase; }
50 QSsl::KeyType keyType() const { return m_keyType; }
51
52 void setKeyFile(const QString &key);
53 void setKeyAlgorithm(QSsl::KeyAlgorithm value);
54 void setKeyFormat(QSsl::EncodingFormat value);
55 void setKeyPassPhrase(const QByteArray &value);
56 void setKeyType(QSsl::KeyType type);
57
58private:
59 inline friend bool operator==(const QQmlSslKey &lvalue, const QQmlSslKey &rvalue)
60 {
61 return (lvalue.m_keyFile == rvalue.m_keyFile
62 && lvalue.m_keyAlgorithm == rvalue.m_keyAlgorithm
63 && lvalue.m_keyFormat == rvalue.m_keyFormat
64 && lvalue.m_keyType == rvalue.m_keyType
65 && lvalue.m_keyPassPhrase == rvalue.m_keyPassPhrase);
66 }
67
68 QString m_keyFile;
69 QByteArray m_keyPassPhrase;
70 QSsl::KeyAlgorithm m_keyAlgorithm = QSsl::Rsa;
71 QSsl::EncodingFormat m_keyFormat = QSsl::Pem;
73};
74
76
77#endif // QQMLSSLKEY_P_H
\inmodule QtCore
Definition qbytearray.h:57
QSsl::KeyAlgorithm keyAlgorithm() const
friend bool operator==(const QQmlSslKey &lvalue, const QQmlSslKey &rvalue)
QByteArray keyPassPhrase() const
QSsl::EncodingFormat keyFormat() const
QSsl::KeyType keyType() const
The QSslKey class provides an interface for private and public keys.
Definition qsslkey.h:23
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
The QSsl namespace declares enums common to all SSL classes in Qt Network.
KeyType
Describes the two types of keys QSslKey supports.
Definition qssl.h:22
@ PrivateKey
Definition qssl.h:23
KeyAlgorithm
Describes the different key algorithms supported by QSslKey.
Definition qssl.h:34
@ Rsa
Definition qssl.h:36
EncodingFormat
Describes supported encoding formats for certificates and keys.
Definition qssl.h:28
@ Pem
Definition qssl.h:29
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLuint64 key
GLenum type
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
#define Q_PROPERTY(...)
#define Q_GADGET