summaryrefslogtreecommitdiffstats
path: root/src/BobinkAuth.h
diff options
context:
space:
mode:
authorThomas Vanbesien <tvanbesi@proton.me>2026-02-17 23:58:08 +0100
committerThomas Vanbesien <tvanbesi@proton.me>2026-02-17 23:58:08 +0100
commit343169dff6b062074fd3c4a5e240b449ffc4a449 (patch)
treea2ef1edc8dd1b1c1dbac757192fa681d8ec76717 /src/BobinkAuth.h
downloadBobinkQtOpcUa-343169dff6b062074fd3c4a5e240b449ffc4a449.tar.gz
BobinkQtOpcUa-343169dff6b062074fd3c4a5e240b449ffc4a449.zip
Initial Bobink library: BobinkAuth, BobinkClient, and demo app
Implements the core OPC UA wrapper library with: - Build system with automatic dep building (open62541, QtOpcUa) - BobinkAuth: QML auth component (anonymous/userpass/certificate) - BobinkClient: QML singleton managing connection, LDS discovery, PKI configuration, endpoint selection, and certificate trust flow - Demo app for manual testing of the full connection flow
Diffstat (limited to 'src/BobinkAuth.h')
-rw-r--r--src/BobinkAuth.h60
1 files changed, 60 insertions, 0 deletions
diff --git a/src/BobinkAuth.h b/src/BobinkAuth.h
new file mode 100644
index 0000000..2e3ea6a
--- /dev/null
+++ b/src/BobinkAuth.h
@@ -0,0 +1,60 @@
+#ifndef BOBINKAUTH_H
+#define BOBINKAUTH_H
+
+#include <QObject>
+#include <QOpcUaAuthenticationInformation>
+#include <QQmlEngine>
+
+class BobinkAuth : public QObject {
+ Q_OBJECT
+ QML_ELEMENT
+
+ Q_PROPERTY(AuthMode mode READ mode WRITE setMode NOTIFY modeChanged)
+ Q_PROPERTY(
+ QString username READ username WRITE setUsername NOTIFY usernameChanged)
+ Q_PROPERTY(
+ QString password READ password WRITE setPassword NOTIFY passwordChanged)
+ Q_PROPERTY(
+ QString certPath READ certPath WRITE setCertPath NOTIFY certPathChanged)
+ Q_PROPERTY(
+ QString keyPath READ keyPath WRITE setKeyPath NOTIFY keyPathChanged)
+
+public:
+ enum AuthMode { Anonymous, UserPass, Certificate };
+ Q_ENUM(AuthMode)
+
+ explicit BobinkAuth(QObject *parent = nullptr);
+
+ AuthMode mode() const;
+ void setMode(AuthMode mode);
+
+ QString username() const;
+ void setUsername(const QString &username);
+
+ QString password() const;
+ void setPassword(const QString &password);
+
+ QString certPath() const;
+ void setCertPath(const QString &path);
+
+ QString keyPath() const;
+ void setKeyPath(const QString &path);
+
+ QOpcUaAuthenticationInformation toAuthenticationInformation() const;
+
+signals:
+ void modeChanged();
+ void usernameChanged();
+ void passwordChanged();
+ void certPathChanged();
+ void keyPathChanged();
+
+private:
+ AuthMode m_mode = Anonymous;
+ QString m_username;
+ QString m_password;
+ QString m_certPath;
+ QString m_keyPath;
+};
+
+#endif // BOBINKAUTH_H