signon 8.54

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
SignonDaemonNS::CredentialsAccessManager Class Reference

Main singleton and manager object of the credentials database system. More...

`#include <credentialsaccessmanager.h>`

Inheritance diagram for SignonDaemonNS::CredentialsAccessManager:
[legend]
Collaboration diagram for SignonDaemonNS::CredentialsAccessManager:
[legend]

## Signals
void | credentialsSystemReady ()
| Is emitted when the credentials system becomes ready. More...

## Public Member Functions
| CredentialsAccessManager (const CAMConfiguration &configuration, QObject *parent=0)
| Constructs a CredentialsAccessManager object with the given parent. More...
| ~CredentialsAccessManager ()
| Destroys a CredentialsAccessManager. More...
bool | init ()
| Initializes the CAM instance. More...
void | finalize ()
| Finalizes the CAM instance, this could include, closing the credentials system and resetting the configuration. More...
void | addKeyManager (SignOn::AbstractKeyManager *keyManager)
| Adds a key manager. More...
bool | initExtension (QObject *object)
| Initializes know objects from an extension plugin. More...
QStringList | backupFiles () const
bool | openCredentialsSystem ()
| Opens the credentials system, creates the CreadentialsDB object; if encryption is configured this will also mount the encrypted file system, based on the AccessControlHandler obtained keys. More...
bool | closeCredentialsSystem ()
| Closes the credentials system. More...
bool | deleteCredentialsSystem ()
| Deletes the credentials system. More...
bool | credentialsSystemOpened () const
| For convenience method. More...
bool | isCredentialsSystemReady () const
| The creadentials system is ready when all of the subscribed key managers have successfully reported all of the inserted keys. More...
CredentialsDB * | credentialsDB () const
const CAMConfiguration & | configuration () const
CredentialsAccessError | lastError () const
bool | keysAvailable () const
| The CAM manages the encryption keys collection. More...

## Static Public Member Functions
static CredentialsAccessManager * | instance ()
| Returns CAM instance. More...

## Protected Member Functions
void | customEvent (QEvent *event)

## Detailed Description

Main singleton and manager object of the credentials database system.

Offers access to the CredentialsDB and AccessControl objects, using a specific configuration (e.g. Access to a SQL database created on an encrypted file system which is mounted by this system). Most calls of this object's methods return false or NULL in case of failure; the specific error code can be retrieved by calling the lastError() method.

See Also
  CredentialsDB
  AccessControl
  AccessCodeHandler
  AbstractCryptoManager

Definition at line 193 of file credentialsaccessmanager.h.

## Constructor & Destructor Documentation

CredentialsAccessManager::CredentialsAccessManager | ( | const CAMConfiguration & | configuration,
|  | QObject * | parent = `0`
| ) |  |

Constructs a CredentialsAccessManager object with the given parent.

Parameters

  configuration | The configuration to use.
  parent | A parent QObject.

Definition at line 127 of file credentialsaccessmanager.cpp.

References BLAME.

CredentialsAccessManager::~CredentialsAccessManager | ( |  | ) |

Destroys a CredentialsAccessManager.

Closes the credentials access system

- closes the database connection
- unmounts the dedicated encrypted filesystem, if in use.

Definition at line 153 of file credentialsaccessmanager.cpp.

References closeCredentialsSystem().

## Member Function Documentation

void CredentialsAccessManager::addKeyManager | ( | SignOn::AbstractKeyManager * | keyManager | ) |

Adds a key manager.

This method must be called before init().

Parameters

  keyManager | The key manager to add.

Definition at line 274 of file credentialsaccessmanager.cpp.

Referenced by initExtension().

QStringList CredentialsAccessManager::backupFiles | ( |  | ) | const

Definition at line 379 of file credentialsaccessmanager.cpp.

bool CredentialsAccessManager::closeCredentialsSystem | ( |  | ) |

Closes the credentials system.

- closes the database connection
- if encryption is in use, unmounts the encrypted file system This is also called by the destructor.

Returns
  true on success, false otherwise. Call lastError() to get the error code.

Definition at line 493 of file credentialsaccessmanager.cpp.

References credentialsSystemOpened(), SignonDaemonNS::NoError, and RETURN_IF_NOT_INITIALIZED.

Referenced by deleteCredentialsSystem(), finalize(), and ~CredentialsAccessManager().

const CAMConfiguration& SignonDaemonNS::CredentialsAccessManager::configuration | ( |  | ) | const
| inline

Returns
  the CAM in use configuration.

Definition at line 346 of file credentialsaccessmanager.h.

CredentialsDB * CredentialsAccessManager::credentialsDB | ( |  | ) | const

Returns
  the credentials database object.

Definition at line 524 of file credentialsaccessmanager.cpp.

References RETURN_IF_NOT_INITIALIZED.

Referenced by SignonDaemonNS::SignonIdentity::addReference(), SignonDaemonNS::AccessControlManagerHelper::isPeerAllowedToUseIdentity(), SignonDaemonNS::AccessControlManagerHelper::isPeerOwnerOfIdentity(), SignonDaemonNS::SignonAuthSessionAdaptor::process(), SignonDaemonNS::SignonIdentity::queryInfo(), SignonDaemonNS::SignonIdentity::queryUiSlot(), SignonDaemonNS::SignonIdentity::remove(), SignonDaemonNS::SignonIdentity::removeReference(), SignonDaemonNS::SignonIdentity::signOut(), SignonDaemonNS::SignonIdentity::storeCredentials(), SignonDaemonNS::SignonIdentity::verifySecret(), and SignonDaemonNS::SignonIdentity::verifyUiSlot().

bool SignonDaemonNS::CredentialsAccessManager::credentialsSystemOpened | ( |  | ) | const
| inline

For convenience method.

Returns
  true if the credentials system is opened, false otherwise.

Definition at line 326 of file credentialsaccessmanager.h.

Referenced by closeCredentialsSystem().

void SignonDaemonNS::CredentialsAccessManager::credentialsSystemReady | ( |  | ) |
| signal

Is emitted when the credentials system becomes ready.

Referenced by init().

void CredentialsAccessManager::customEvent | ( | QEvent * | event | ) |
| protected

Definition at line 616 of file credentialsaccessmanager.cpp.

References SignonDaemonNS::CredentialsDB::isSecretsDBOpen(), SignonDaemonNS::SecureStorageEvent::m_sender, SIGNON_SECURE_STORAGE_NOT_AVAILABLE, and TRACE.

bool CredentialsAccessManager::deleteCredentialsSystem | ( |  | ) |

Deletes the credentials system.

- deletes the credentials database
- if encryption is in use the encrypted file system will be deleted
  Warning
    use this carefully. Upon successful completion this call deletes all the stored credentials.
  Returns
    true on success, false otherwise. Call lastError() to get the error code.

Definition at line 511 of file credentialsaccessmanager.cpp.

References BLAME, closeCredentialsSystem(), and RETURN_IF_NOT_INITIALIZED.

void CredentialsAccessManager::finalize | ( |  | ) |

Finalizes the CAM instance, this could include, closing the credentials system and resetting the configuration.

After this call the CAM needs to be reinitialized.

Definition at line 165 of file credentialsaccessmanager.cpp.

References closeCredentialsSystem(), SignonDaemonNS::NoError, and TRACE.

bool CredentialsAccessManager::init | ( |  | ) |

Initializes the CAM instance.

If encryption is in use, this will start the key managers and create the CryptoManager object, preparing everything for the mounting of the encrypted file system.

Definition at line 180 of file credentialsaccessmanager.cpp.

References SignonDaemonNS::CAMConfiguration::accessControlManagerName(), SignonDaemonNS::AlreadyInitialized, BLAME, credentialsSystemReady(), SignonDaemonNS::CAMConfiguration::cryptoManagerName(), SignonDaemonNS::CAMConfiguration::m_settings, SignonDaemonNS::NoError, SignonDaemonNS::CAMConfiguration::secretsStorageName(), SignonDaemonNS::CAMConfiguration::serialize(), TRACE, and SignonDaemonNS::CAMConfiguration::useEncryption().

bool CredentialsAccessManager::initExtension | ( | QObject * | object | ) |

Initializes know objects from an extension plugin.

Parameters

  extension | A signon extension plugin.

Returns
  True if the extension provides objects that the CAM is using.

Definition at line 280 of file credentialsaccessmanager.cpp.

References SignonDaemonNS::CAMConfiguration::accessControlManagerName(), addKeyManager(), SignonDaemonNS::CAMConfiguration::cryptoManagerName(), SignonDaemonNS::CAMConfiguration::secretsStorageName(), and TRACE.

CredentialsAccessManager * CredentialsAccessManager::instance | ( |  | ) |
| static

Returns CAM instance.

Definition at line 160 of file credentialsaccessmanager.cpp.

Referenced by SignonDaemonNS::SignonIdentity::addReference(), SignonDaemonNS::AccessControlManagerHelper::isPeerAllowedToUseIdentity(), SignonDaemonNS::AccessControlManagerHelper::isPeerOwnerOfIdentity(), SignonDaemonNS::SignonAuthSessionAdaptor::process(), SignonDaemonNS::SignonSessionCore::process(), SignonDaemonNS::SignonIdentity::queryInfo(), SignonDaemonNS::SignonIdentity::queryUiSlot(), SignonDaemonNS::SignonIdentity::remove(), SignonDaemonNS::SignonIdentity::removeReference(), SignonDaemonNS::SignonSessionCore::SignonSessionCore(), SignonDaemonNS::SignonIdentity::signOut(), SignonDaemonNS::SignonIdentity::storeCredentials(), SignonDaemonNS::SignonIdentity::verifySecret(), and SignonDaemonNS::SignonIdentity::verifyUiSlot().

bool CredentialsAccessManager::isCredentialsSystemReady | ( |  | ) | const

The creadentials system is ready when all of the subscribed key managers have successfully reported all of the inserted keys.

The credentials system can be ready while at the same time the secure storage is not opened.

Returns
  true if the credentials system is ready, false otherwise.

Definition at line 531 of file credentialsaccessmanager.cpp.

bool CredentialsAccessManager::keysAvailable | ( |  | ) | const

The CAM manages the encryption keys collection.

Returns
  whether the CAM detected any encryption keys or not.

Definition at line 585 of file credentialsaccessmanager.cpp.

CredentialsAccessError SignonDaemonNS::CredentialsAccessManager::lastError | ( |  | ) | const
| inline

See Also
  CredentialsAccessError

Returns
  the last CAM's internally reported error.

Definition at line 352 of file credentialsaccessmanager.h.

bool CredentialsAccessManager::openCredentialsSystem | ( |  | ) |

Opens the credentials system, creates the CreadentialsDB object; if encryption is configured this will also mount the encrypted file system, based on the AccessControlHandler obtained keys.

First call of this method on a specific platform also does the formatting prior to the effective opening.

Returns
  true on success, false otherwise. Call lastError() to get the error code.

Definition at line 466 of file credentialsaccessmanager.cpp.

References BLAME, and RETURN_IF_NOT_INITIALIZED.

The documentation for this class was generated from the following files:

- src/signond/credentialsaccessmanager.h
- src/signond/credentialsaccessmanager.cpp