mirror of
https://github.com/QuasarApp/Snake.git
synced 2025-05-13 09:59:46 +00:00
34 lines
638 B
C++
34 lines
638 B
C++
#ifndef KEYSREACTOR_H
|
|
#define KEYSREACTOR_H
|
|
|
|
#include <qrsaencryption.h>
|
|
#include <QtConcurrent>
|
|
#include <rsakeyspool.h>
|
|
|
|
#define DEFAULT_KEYPOOL_SIZE 10
|
|
|
|
class KeysReactor: public QObject
|
|
{
|
|
Q_OBJECT
|
|
private:
|
|
ClientProtocol::RSAKeysPool _pool;
|
|
QRSAEncryption _generator;
|
|
int _poolSize = DEFAULT_KEYPOOL_SIZE;
|
|
QHash<QRSAEncryption::Rsa, bool> _mutexs;
|
|
|
|
private slots:
|
|
void handleGenerateNewKeys();
|
|
|
|
public:
|
|
KeysReactor(QObject *ptr = nullptr);
|
|
|
|
~KeysReactor() override;
|
|
|
|
ClientProtocol::RSAKeysPool* getPool();
|
|
int getPoolSize() const;
|
|
void setPoolSize(int value);
|
|
|
|
};
|
|
|
|
#endif // KEYSREACTOR_H
|