signon
8.58
|
Main singleton and manager object of the credentials database system. More...
#include <credentialsaccessmanager.h>
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) |
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.
Definition at line 193 of file credentialsaccessmanager.h.
CredentialsAccessManager::CredentialsAccessManager | ( | const CAMConfiguration & | configuration, |
QObject * | parent = 0 |
||
) |
Constructs a CredentialsAccessManager object with the given parent.
configuration | The configuration to use. |
parent | A parent QObject. |
Definition at line 124 of file credentialsaccessmanager.cpp.
References BLAME.
CredentialsAccessManager::~CredentialsAccessManager | ( | ) |
Destroys a CredentialsAccessManager.
Closes the credentials access system
Definition at line 150 of file credentialsaccessmanager.cpp.
References closeCredentialsSystem().
void CredentialsAccessManager::addKeyManager | ( | SignOn::AbstractKeyManager * | keyManager | ) |
Adds a key manager.
This method must be called before init().
keyManager | The key manager to add. |
Definition at line 271 of file credentialsaccessmanager.cpp.
Referenced by initExtension().
QStringList CredentialsAccessManager::backupFiles | ( | ) | const |
Definition at line 378 of file credentialsaccessmanager.cpp.
References BLAME, SignonDaemonNS::CredentialsDB::closeSecretsDB(), SignonDaemonNS::CredentialsDbConnectionError, SignonDaemonNS::CredentialsDbNotMounted, SignonDaemonNS::CredentialsDbSetupFailed, SignonDaemonNS::CredentialsDbUnmountFailed, SignonDaemonNS::CredentialsDB::init(), SignonDaemonNS::CredentialsDB::isSecretsDBOpen(), SignonDaemonNS::CAMConfiguration::m_secretsDbName, SignonDaemonNS::CAMConfiguration::metadataDBPath(), SignonDaemonNS::NoError, SignonDaemonNS::CredentialsDB::openSecretsDB(), setUserOwnership(), and TRACE.
Referenced by SignonDaemonNS::SignonDaemon::backupStarts(), and SignonDaemonNS::SignonDaemon::restoreFinished().
bool CredentialsAccessManager::closeCredentialsSystem | ( | ) |
Closes the credentials system.
Definition at line 492 of file credentialsaccessmanager.cpp.
References credentialsSystemOpened(), SignonDaemonNS::NoError, and RETURN_IF_NOT_INITIALIZED.
Referenced by SignonDaemonNS::SignonDaemon::backupStarts(), deleteCredentialsSystem(), finalize(), SignonDaemonNS::SignonDaemon::restoreFinished(), ~CredentialsAccessManager(), and SignonDaemonNS::SignonDaemon::~SignonDaemon().
|
inline |
Definition at line 346 of file credentialsaccessmanager.h.
CredentialsDB * CredentialsAccessManager::credentialsDB | ( | ) | const |
Definition at line 523 of file credentialsaccessmanager.cpp.
References RETURN_IF_NOT_INITIALIZED.
Referenced by SignonDaemonNS::SignonIdentity::addReference(), SignonDaemonNS::SignonDaemon::clear(), SignonDaemonNS::AccessControlManagerHelper::isPeerAllowedToUseIdentity(), SignonDaemonNS::AccessControlManagerHelper::isPeerOwnerOfIdentity(), SignonDaemonNS::SignonAuthSessionAdaptor::process(), SignonDaemonNS::SignonDaemon::queryIdentities(), SignonDaemonNS::SignonIdentity::queryInfo(), SignonDaemonNS::SignonIdentity::queryUiSlot(), SignonDaemonNS::SignonIdentity::remove(), SignonDaemonNS::SignonIdentity::removeReference(), SignonDaemonNS::SignonSessionCore::setId(), SignonDaemonNS::SignonIdentity::signOut(), SignonDaemonNS::SignonIdentity::storeCredentials(), SignonDaemonNS::SignonIdentity::verifySecret(), and SignonDaemonNS::SignonIdentity::verifyUiSlot().
|
inline |
For convenience method.
Definition at line 326 of file credentialsaccessmanager.h.
Referenced by SignonDaemonNS::SignonDaemon::backupStarts(), closeCredentialsSystem(), customEvent(), SignonDaemonNS::SignonDaemon::init(), and SignonDaemonNS::SignonDaemon::restoreFinished().
|
signal |
Is emitted when the credentials system becomes ready.
Referenced by init().
|
protected |
bool CredentialsAccessManager::deleteCredentialsSystem | ( | ) |
Deletes the credentials system.
Definition at line 510 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 162 of file credentialsaccessmanager.cpp.
References closeCredentialsSystem(), SignonDaemonNS::NoError, and TRACE.
Referenced by SignonDaemonNS::SignonDaemon::init().
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 177 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().
Referenced by SignonDaemonNS::SignonDaemon::init().
bool CredentialsAccessManager::initExtension | ( | QObject * | object | ) |
Initializes know objects from an extension plugin.
extension | A signon extension plugin. |
Definition at line 277 of file credentialsaccessmanager.cpp.
References SignonDaemonNS::CAMConfiguration::accessControlManagerName(), addKeyManager(), SignonDaemonNS::CAMConfiguration::cryptoManagerName(), SignonDaemonNS::CAMConfiguration::secretsStorageName(), and TRACE.
Referenced by SignonDaemonNS::SignonDaemon::init().
|
static |
Returns CAM instance.
Definition at line 157 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::setId(), 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.
Definition at line 530 of file credentialsaccessmanager.cpp.
bool CredentialsAccessManager::keysAvailable | ( | ) | const |
The CAM manages the encryption keys collection.
Definition at line 584 of file credentialsaccessmanager.cpp.
References SignonDaemonNS::CredentialsDB::isSecretsDBOpen(), SIGNON_SECURE_STORAGE_AVAILABLE, SIGNON_SECURE_STORAGE_NOT_AVAILABLE, and TRACE.
Referenced by SignonDaemonNS::SignonSessionCore::setId().
|
inline |
Definition at line 352 of file credentialsaccessmanager.h.
Referenced by SignonDaemonNS::SignonDaemon::clear(), and SignonDaemonNS::SignonDaemon::queryIdentities().
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.
Definition at line 465 of file credentialsaccessmanager.cpp.
References BLAME, and RETURN_IF_NOT_INITIALIZED.
Referenced by SignonDaemonNS::SignonDaemon::backupStarts(), SignonDaemonNS::SignonDaemon::init(), and SignonDaemonNS::SignonDaemon::restoreFinished().