signon  8.42
SignonDaemonNS::CredentialsAccessManager Class Reference

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.

Public Member Functions

 CredentialsAccessManager (const CAMConfiguration &configuration, QObject *parent=0)
 Constructs a CredentialsAccessManager object with the given parent.
 ~CredentialsAccessManager ()
 Destroys a CredentialsAccessManager.
bool init ()
 Initializes the CAM instance.
void finalize ()
 Finalizes the CAM instance, this could include, closing the credentials system and resetting the configuration.
void addKeyManager (SignOn::AbstractKeyManager *keyManager)
 Adds a key manager.
bool initExtension (QObject *object)
 Initializes know objects from an extension plugin.
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.
bool closeCredentialsSystem ()
 Closes the credentials system.
bool deleteCredentialsSystem ()
 Deletes the credentials system.
bool credentialsSystemOpened () const
 For convenience method.
bool isCredentialsSystemReady () const
 The creadentials system is ready when all of the subscribed key managers have successfully reported all of the inserted keys.
CredentialsDBcredentialsDB () const
const CAMConfigurationconfiguration () const
CredentialsAccessError lastError () const
bool keysAvailable () const
 The CAM manages the encryption keys collection.

Static Public Member Functions

static CredentialsAccessManagerinstance ()
 Returns CAM instance.

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
configurationThe configuration to use.
parentA 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
keyManagerThe key manager to add.

Definition at line 274 of file credentialsaccessmanager.cpp.

Referenced by initExtension().

QStringList CredentialsAccessManager::backupFiles ( ) const

Definition at line 378 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 492 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.

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
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 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 165 of file credentialsaccessmanager.cpp.

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

bool CredentialsAccessManager::initExtension ( QObject *  object)

Initializes know objects from an extension plugin.

Parameters
extensionA 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.

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 530 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 584 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 465 of file credentialsaccessmanager.cpp.

References BLAME, and RETURN_IF_NOT_INITIALIZED.


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