pgLab/pglab/ConnectionList.h
eelke e36924c087 Passwords are now saved in a password manager.
The password manager uses strong encryption using a key derived from the passphrase using
scrypt key strengthening algorithm. This ensures encryption is performed using a strong key
and that brute forcing the passphrase is time consuming.

If the user loses his passphrase no recovery is possible.
2018-11-08 21:50:49 +01:00

54 lines
1 KiB
C++

#ifndef CONNECTIONLIST_H
#define CONNECTIONLIST_H
#include "ConnectionConfig.h"
#include <QString>
#include <QUuid>
#include <vector>
#include "Expected.h"
class ConnectionList {
public:
ConnectionList();
size_t size() const { return m_connections.size(); }
ConnectionConfig& getConfigByIdx(size_t idx)
{
return m_connections.at(idx);
}
void setConfigByIdx(size_t idx, const ConnectionConfig &cc)
{
m_connections[idx] = cc;
}
size_t createNew();
void remove(size_t idx, size_t count);
void load();
void save();
void save(size_t index);
private:
// class LijstElem {
// public:
// QUuid m_uuid; ///< Unique identifier, used as a key for storing password in psk db.
// ConnectionConfig m_config;
// LijstElem(const QUuid id, const ConnectionConfig &cfg)
// : m_uuid(id), m_config(cfg)
// {}
// };
using t_Connections = std::vector<ConnectionConfig>;
t_Connections m_connections;
void deleteFromIni(t_Connections::iterator begin, t_Connections::iterator end);
static QString iniFileName();
};
#endif // CONNECTIONLIST_H