#ifndef RSAKEYSPOOL_H #define RSAKEYSPOOL_H #include #include #include #include #include namespace ClientProtocol { struct RSAKeyPair { QByteArray pub; QByteArray priv; }; typedef QMap KeysPool; typedef QHash PoolData; class RSAKeysPool: public QObject { Q_OBJECT private: PoolData pool; QMutex multithread; public: bool take(QRSAEncryption::Rsa rsa, RSAKeyPair &res); void addNewKey(QRSAEncryption::Rsa rsa, const RSAKeyPair& key); int size(QRSAEncryption::Rsa rsa) const; signals: void sigKeyTaked(); }; } #endif // RSAKEYSPOOL_H