31 #ifndef CREDENTIALS_ACCESS_MANAGER_H
32 #define CREDENTIALS_ACCESS_MANAGER_H
41 #include <QStringList>
42 #include <QVariantMap>
44 #include "SignOn/AbstractAccessControlManager"
45 #include "SignOn/AbstractCryptoManager"
46 #include "SignOn/AbstractKeyAuthorizer"
47 #include "SignOn/AbstractKeyManager"
48 #include "SignOn/AbstractSecretsStorage"
49 #include "SignOn/KeyHandler"
58 #define SIGNON_SECURE_STORAGE_NOT_AVAILABLE (QEvent::User + 1001)
66 #define SIGNON_SECURE_STORAGE_AVAILABLE (QEvent::User + 1002)
214 enum KeySwapAuthorizingMech {
216 AuthorizedKeyRemovedFirst,
217 UnauthorizedKeyRemovedFirst
225 enum StorageUiCleanupFlag {
227 DisableCoreKeyAuthorization
232 Q_DECLARE_FLAGS(StorageUiCleanupFlags, StorageUiCleanupFlag)
241 QObject *parent = 0);
367 void onKeyInserted(
const SignOn::Key key);
368 void onLastAuthorizedKeyRemoved(
const SignOn::Key key);
369 void onKeyRemoved(
const SignOn::Key key);
370 void onKeyAuthorizationQueried(
const SignOn::Key,
int);
371 void onEncryptedFSMounted();
372 void onEncryptedFSUnmounting();
378 bool createStorageDir();
379 bool openSecretsDB();
380 bool isSecretsDBOpen();
381 bool closeSecretsDB();
382 bool openMetaDataDB();
383 void closeMetaDataDB();
384 void replyToSecureStorageEventNotifiers();
389 bool m_isInitialized;
399 SignOn::AbstractCryptoManager *m_cryptoManager;
400 SignOn::KeyHandler *m_keyHandler;
401 SignOn::AbstractKeyAuthorizer *m_keyAuthorizer;
402 SignOn::AbstractSecretsStorage *m_secretsStorage;
404 SignOn::AbstractAccessControlManager *m_acManager;
413 #endif // CREDENTIALS_ACCESS_MANAGER_H
CAMConfiguration()
Constructs a CAMConfiguration object with the default configuration - encryption in use...
Definition of the CredentialsDB object.
QString metadataDBPath() const
Returns the path to the metadata DB.
bool deleteCredentialsSystem()
Deletes the credentials system.
void addSetting(const QString &key, const QVariant &value)
void serialize(QIODevice *device)
Serializes the CAMConfiguration object as string to a specific IODevice.
bool closeCredentialsSystem()
Closes the credentials system.
QString m_dbName
The database file name.
bool initExtension(QObject *object)
Initializes know objects from an extension plugin.
bool credentialsSystemOpened() const
For convenience method.
const CAMConfiguration & configuration() const
CredentialsAccessManager(const CAMConfiguration &configuration, QObject *parent=0)
Constructs a CredentialsAccessManager object with the given parent.
QString m_secretsDbName
The credentials database file name.
void customEvent(QEvent *event)
bool useEncryption() const
Any object in the signon framework that needs the CredentialsAccessManager - CAM - secure storage in ...
void addKeyManager(SignOn::AbstractKeyManager *keyManager)
Adds a key manager.
void setStoragePath(const QString &storagePath)
static CredentialsAccessManager * instance()
Returns CAM instance.
QString m_storagePath
The base directory for storage.
Main singleton and manager object of the credentials database system.
bool isCredentialsSystemReady() const
The creadentials system is ready when all of the subscribed key managers have successfully reported a...
void credentialsSystemReady()
Is emitted when the credentials system becomes ready.
bool init()
Initializes the CAM instance.
QString secretsStorageName() const
Returns the name of the SecretsStorage to use.
QPointer< QObject > EventSender
bool keysAvailable() const
The CAM manages the encryption keys collection.
~CredentialsAccessManager()
Destroys a CredentialsAccessManager.
SecureStorageEvent(QEvent::Type type)
void finalize()
Finalizes the CAM instance, this could include, closing the credentials system and resetting the conf...
CredentialsAccessError lastError() const
CredentialsDB * credentialsDB() const
Manages the credentials I/O.
QString accessControlManagerName() const
Returns the name of the AccessControlManager to use.
Configuration object for the CredentialsAccessManager - CAM.
Helper class for access control-related functionality.
QByteArray m_encryptionPassphrase
Passphrase used for opening encrypted FS.
bool openCredentialsSystem()
Opens the credentials system, creates the CreadentialsDB object; if encryption is configured this wil...
QString cryptoManagerName() const
Returns the name of the CryptoManager to use.
QStringList backupFiles() const
Contains helper functions related to Access Control.