7#ifndef _KWALLETFREEDESKTOPSESSION_H_
8#define _KWALLETFREEDESKTOPSESSION_H_
10#include "kwalletfreedesktopservice.h"
11#include <QDBusContext>
12#include <QDBusObjectPath>
13#include <QDBusServiceWatcher>
16#define FDO_SECRETS_SESSION_PATH FDO_SECRETS_SERVICE_OBJECT "/session/"
20class KWalletFreedesktopSessionAlgorithm
23 virtual ~KWalletFreedesktopSessionAlgorithm() =
default;
24 virtual QByteArray negotiationOutput()
const = 0;
25 virtual bool encrypt(FreedesktopSecret &secret)
const = 0;
26 virtual bool decrypt(FreedesktopSecret &secret)
const = 0;
34 KWalletFreedesktopSession(
class KWalletFreedesktopService *
parent,
35 std::unique_ptr<KWalletFreedesktopSessionAlgorithm> algorithm,
40 KWalletFreedesktopService *fdoService()
const;
42 QByteArray negotiationOutput()
const;
43 bool encrypt(
const QDBusMessage &
message, FreedesktopSecret &secret)
const;
44 bool decrypt(
const QDBusMessage &
message, FreedesktopSecret &secret)
const;
47 void slotServiceOwnerChanged(
const QString &name,
const QString &oldOwner,
const QString &newOwner);
50 class KWalletFreedesktopService *m_service;
51 std::unique_ptr<KWalletFreedesktopSessionAlgorithm> m_algorithm;
52 QString m_sessionPath;
53 QString m_serviceBusName;
54 QDBusServiceWatcher m_serviceWatcher;
63class KWalletFreedesktopSessionAlgorithmPlain :
public KWalletFreedesktopSessionAlgorithm
66 QByteArray negotiationOutput()
const override;
67 bool encrypt(FreedesktopSecret &secret)
const override;
68 bool decrypt(FreedesktopSecret &secret)
const override;
71class KWalletFreedesktopSessionAlgorithmDhAes :
public KWalletFreedesktopSessionAlgorithm
74 KWalletFreedesktopSessionAlgorithmDhAes(
const QCA::PublicKey &publicKey, QCA::SymmetricKey symmetricKey);
76 QByteArray negotiationOutput()
const override;
77 bool encrypt(FreedesktopSecret &secret)
const override;
78 bool decrypt(FreedesktopSecret &secret)
const override;
81 QCA::PublicKey m_publicKey;
82 QCA::SymmetricKey m_symmetricKey;
QDBusConnection connection() const const
const QDBusMessage & message() const const
QObject * parent() const const