Pages
API Documentation
On this page

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

Signals

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()

KeyManagersList

A list of key managers.

We use cookies to personalize content and to analyze our traffic. Please decide if you are willing to accept cookies from our website.