Use QSharedPointer instead of cloning YkChallengeResponseKey and make it a QObject to allow emitting signals
This commit is contained in:
@@ -22,20 +22,34 @@
|
||||
#include "keys/ChallengeResponseKey.h"
|
||||
#include "keys/drivers/YubiKey.h"
|
||||
|
||||
class YkChallengeResponseKey : public ChallengeResponseKey
|
||||
#include <QObject>
|
||||
|
||||
class YkChallengeResponseKey : public QObject, public ChallengeResponseKey
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
YkChallengeResponseKey(int slot = -1,
|
||||
bool blocking = false);
|
||||
YkChallengeResponseKey(int slot = -1, bool blocking = false);
|
||||
|
||||
QByteArray rawKey() const;
|
||||
YkChallengeResponseKey* clone() const;
|
||||
bool challenge(const QByteArray& chal);
|
||||
bool challenge(const QByteArray& chal, int retries);
|
||||
bool challenge(const QByteArray& chal, unsigned retries);
|
||||
QString getName() const;
|
||||
bool isBlocking() const;
|
||||
|
||||
signals:
|
||||
/**
|
||||
* Emitted whenever user interaction is required to proceed with the challenge-response protocol.
|
||||
* You can use this to show a helpful dialog informing the user that his assistance is required.
|
||||
*/
|
||||
void userInteractionRequired();
|
||||
|
||||
/**
|
||||
* Emitted when the user has provided their required input.
|
||||
*/
|
||||
void userConfirmed();
|
||||
|
||||
private:
|
||||
QByteArray m_key;
|
||||
int m_slot;
|
||||
|
||||
Reference in New Issue
Block a user