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#include "qopcuax509extension.h"
5#include "qopcuax509extension_p.h"
6
7QT_BEGIN_NAMESPACE
8
9/*!
10 \class QOpcUaX509Extension
11 \inmodule QtOpcUa
12 \since 5.14
13
14 \brief Base class for all X509 extensions.
15
16 This class is currently available as a Technology Preview, and therefore the API
17 and functionality provided by the class may be subject to change at any time without
18 prior notice.
19
20 \sa QOpcUaX509ExtensionSubjectAlternativeName, QOpcUaX509ExtensionBasicConstraints,
21 QOpcUaX509ExtensionKeyUsage, QOpcUaX509ExtensionKeyUsage
22*/
23
24/*!
25 Constructs a default X509Extension.
26*/
27QOpcUaX509Extension::QOpcUaX509Extension()
28 : data(new QOpcUaX509ExtensionData)
29{
30}
31
32/*!
33 Constructs a X509Extension from \a rhs.
34*/
35QOpcUaX509Extension::QOpcUaX509Extension(const QOpcUaX509Extension &rhs)
36 : data(rhs.data)
37{
38}
39
40/*!
41 Constructs a X509Extension from \a rhs.
42*/
43QOpcUaX509Extension::QOpcUaX509Extension(QSharedDataPointer<QOpcUaX509ExtensionData> rhs)
44 : data(rhs)
45{
46}
47
48/*!
49 Returns \c true if this X509Extension has the same value as \a rhs.
50*/
51bool QOpcUaX509Extension::operator==(const QOpcUaX509Extension &rhs) const
52{
53 return data->critical == rhs.data->critical;
54}
55
56/*!
57 Sets the values from \a rhs in this X509Extension.
58*/
59QOpcUaX509Extension &QOpcUaX509Extension::operator=(const QOpcUaX509Extension &rhs)
60{
61 if (this != &rhs)
62 data.operator=(o: rhs.data);
63 return *this;
64}
65
66/*!
67 Destructs a X509Extension.
68*/
69QOpcUaX509Extension::~QOpcUaX509Extension()
70{
71}
72
73/*!
74 Sets the critical flag to \a critical.
75*/
76void QOpcUaX509Extension::setCritical(bool critical)
77{
78 data->critical = critical;
79}
80
81/*!
82 Return the state of the critical flag.
83*/
84bool QOpcUaX509Extension::critical() const
85{
86 return data->critical;
87}
88
89QOpcUaX509Extension::QOpcUaX509Extension(QOpcUaX509ExtensionData *other)
90{
91 data = other;
92}
93
94QT_END_NAMESPACE
95

source code of qtopcua/src/opcua/x509/qopcuax509extension.cpp