1// Copyright (C) 2019 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 QOPCUAX509EXTENSIONEXTENDEDKEYUSAGE_H
5#define QOPCUAX509EXTENSIONEXTENDEDKEYUSAGE_H
6
7#include "QtOpcUa/qopcuax509extension.h"
8#include <QtOpcUa/qopcuaglobal.h>
9
10QT_BEGIN_NAMESPACE
11
12class Q_OPCUA_EXPORT QOpcUaX509ExtensionExtendedKeyUsage : public QOpcUaX509Extension
13{
14public:
15 enum class KeyUsage : uint {
16 TlsWebServerAuthentication,
17 TlsWebClientAuthentication,
18 SignExecutableCode,
19 EmailProtection,
20 };
21
22 QOpcUaX509ExtensionExtendedKeyUsage();
23 QOpcUaX509ExtensionExtendedKeyUsage(const QOpcUaX509ExtensionExtendedKeyUsage &);
24 QOpcUaX509ExtensionExtendedKeyUsage &operator=(const QOpcUaX509ExtensionExtendedKeyUsage &);
25 bool operator==(const QOpcUaX509ExtensionExtendedKeyUsage &rhs) const;
26 ~QOpcUaX509ExtensionExtendedKeyUsage();
27
28 void setKeyUsage(KeyUsage keyUsage, bool enable = true);
29 bool keyUsage(KeyUsage) const;
30};
31
32#if QT_VERSION >= 0x060000
33inline size_t qHash(const QOpcUaX509ExtensionExtendedKeyUsage::KeyUsage &key)
34#else
35inline uint qHash(const QOpcUaX509ExtensionExtendedKeyUsage::KeyUsage &key)
36#endif
37{
38 return ::qHash(key: static_cast<uint>(key));
39}
40
41QT_END_NAMESPACE
42
43#endif // QOPCUAX509EXTENSIONEXTENDEDKEYUSAGE_H
44

source code of qtopcua/src/opcua/x509/qopcuax509extensionextendedkeyusage.h