SignOn::KeyHandler Class
Object holding the keys to the secure storage. More...
- Header:
#include <SignOn/KeyHandler> - Inherits: QObject
List of all members, including inherited members
Public Types
Public Functions
- KeyHandler(QObject *parent = 0)
- ~KeyHandler()
- bool authorizeKey(const SignOn::Key &key, SignOn::KeyHandler::AuthorizeFlags flags = None)
- bool canAddKeyAuthorization() const
- SignOn::AbstractCryptoManager *cryptoManager() const
- void initialize(SignOn::AbstractCryptoManager *cryptoManager, const SignOn::KeyManagersList &keyManagers)
- QSet<SignOn::Key> insertedKeys() const
- bool isReady() const
- bool keyIsAuthorized(const SignOn::Key &key) const
- bool revokeKeyAuthorization(const SignOn::Key &key)
Signals
- void keyAuthorizationRevoked(const SignOn::Key key)
- void keyAuthorized(const SignOn::Key key)
- void keyDisabled(const SignOn::Key key)
- void keyInserted(const SignOn::Key key)
- void keyRemoved(const SignOn::Key key)
- void lastAuthorizedKeyRemoved(const SignOn::Key key)
- void ready()
Detailed Description
The KeyHandler is where all keys to the secure storage are held. It provides signals to notify when keys are inserted, authorized, removed, disabled, as well as methods to authorize and unauthorize keys.
Member Type Documentation
enum KeyHandler::Authorizations
flags KeyHandler::AuthorizeFlags
Options for authorizeKey().
| Constant | Value | Description |
|---|---|---|
SignOn::KeyHandler::None |
0 |
No options. |
SignOn::KeyHandler::FormatStorage |
1 << 0 |
Formats the secure storage |
The AuthorizeFlags type is a typedef for QFlags<Authorizations>. It stores an OR combination of Authorizations values.
Member Function Documentation
[explicit] KeyHandler::KeyHandler(QObject *parent = 0)
Constructor, with the given parent.
[virtual noexcept] KeyHandler::~KeyHandler()
Destructor
bool KeyHandler::authorizeKey(const SignOn::Key &key, SignOn::KeyHandler::AuthorizeFlags flags = None)
Add key to the list of keys which can be used to access the secure storage, with the options flags. If the KeyHandler is empty, this method will fail.
Returns true if the operation was successful.
See also keyAuthorized()
bool KeyHandler::canAddKeyAuthorization() const
Returns true if a new key can be authorized by calling authorizeKey() without specifying the FormatStorage flag (that is, if the KeyHandler knows other keys which can open the storage).
SignOn::AbstractCryptoManager *KeyHandler::cryptoManager() const
Returns the CryptoManager.
void KeyHandler::initialize(SignOn::AbstractCryptoManager *cryptoManager, const SignOn::KeyManagersList &keyManagers)
This method initializes the key managers keyManagers, with the cryptoManager.
QSet<SignOn::Key> KeyHandler::insertedKeys() const
Returns the currently inserted keys.
bool KeyHandler::isReady() const
True if all key managers have been initialized and have started reporting their inserted keys.
[signal] void KeyHandler::keyAuthorizationRevoked(const SignOn::Key key)
Emitted when the authorization of key has been revoked.
[signal] void KeyHandler::keyAuthorized(const SignOn::Key key)
Emitted when key has been authorized.
[signal] void KeyHandler::keyDisabled(const SignOn::Key key)
Emitted when key is disabled. For instance, this signal can be emitted when a password expires or when a hardware key is removed. This signal will be emitted before the action is processed by the KeyHandler; this means that if for instance key was an authorized key, calling keyIsAuthorized() from this signal's handler will still return true.
[signal] void KeyHandler::keyInserted(const SignOn::Key key)
Emitted when the new key is available. If the key is not yet known to signond, signond will call authorizeKey on the key managers before accepting it.
bool KeyHandler::keyIsAuthorized(const SignOn::Key &key) const
Returns true if key is an authorized key.
[signal] void KeyHandler::keyRemoved(const SignOn::Key key)
One of the key managers has asked that key be removed. This means that the key manager will never provide the same key again, so its authorization to open the secure storage can be revoked. The keyDisabled() signal will always be emitted prior to this one.
[signal] void KeyHandler::lastAuthorizedKeyRemoved(const SignOn::Key key)
Emitted when the last authorized key, key, has been removed.
[signal] void KeyHandler::ready()
Emitted after all key managers have been initialized and have reported about their inserted keys.
bool KeyHandler::revokeKeyAuthorization(const SignOn::Key &key)
Remove key from the list of keys which can be used to access the secure storage. If the KeyHandler is empty, this method will fail.
Returns true if the operation was successful.
See also keyAuthorizationRevoked()
Related Non-Members
KeyManagersList
A list of key managers.