|
signon
8.58
|
Encrypted file system manager. More...
#include <crypto-manager.h>


Public Types | |
| enum | FileSystemType { Ext2 = 0, Ext3, Ext4 } |
| Supported encrypted partion filesystem type. More... | |
Public Member Functions | |
| bool | initialize (const QVariantMap &configuration) |
| CryptoManager (QObject *parent=0) | |
| Constructs a CryptoManager object with the given parent. More... | |
| ~CryptoManager () | |
| Destroys a CryptoManager object. More... | |
| bool | setupFileSystem () |
| Sets up an encrypted file system. More... | |
| bool | deleteFileSystem () |
| Deletes the encrypted file system. More... | |
| bool | mountFileSystem () |
| Mounts the encrypted file system. More... | |
| bool | unmountFileSystem () |
| Unmounts the encrypted file system. More... | |
| QString | fileSystemMountPath () const |
| QStringList | backupFiles () const |
| bool | encryptionKeyInUse (const SignOn::Key &key) |
| bool | addEncryptionKey (const SignOn::Key &key, const SignOn::Key &existingKey) |
| Adds an encryption key to one of the available keyslots of the LUKS partition's header. More... | |
| bool | removeEncryptionKey (const SignOn::Key &key, const SignOn::Key &remainingKey) |
| Releases an existing used keyslot in the LUKS partition's header. More... | |
Encrypted file system manager.
Uses cryptsetup and LUKS.
Definition at line 45 of file crypto-manager.h.
Supported encrypted partion filesystem type.
| Enumerator | |
|---|---|
| Ext2 | |
| Ext3 | |
| Ext4 | |
Definition at line 70 of file crypto-manager.h.
| CryptoManager::CryptoManager | ( | QObject * | parent = 0 | ) |
Constructs a CryptoManager object with the given parent.
| parent |
Definition at line 82 of file crypto-manager.cpp.
References BLAME, and CryptsetupHandler::loadDmMod().
| CryptoManager::~CryptoManager | ( | ) |
Destroys a CryptoManager object.
Definition at line 97 of file crypto-manager.cpp.
References unmountFileSystem().
| bool CryptoManager::addEncryptionKey | ( | const SignOn::Key & | key, |
| const SignOn::Key & | existingKey | ||
| ) |
Adds an encryption key to one of the available keyslots of the LUKS partition's header.
Use the keyTag parameter in order to store and keep track of the key.
| key | The key to be added/set. |
| existingKey | An already existing key. |
Definition at line 437 of file crypto-manager.cpp.
References CryptsetupHandler::addKeySlot(), and TRACE.
| QStringList CryptoManager::backupFiles | ( | ) | const |
Definition at line 399 of file crypto-manager.cpp.
| bool CryptoManager::deleteFileSystem | ( | ) |
Deletes the encrypted file system.
Definition at line 383 of file crypto-manager.cpp.
References unmountFileSystem().
| bool CryptoManager::encryptionKeyInUse | ( | const SignOn::Key & | key | ) |
key is occupying a keyslot in the encrypted file system. Definition at line 470 of file crypto-manager.cpp.
References mountFileSystem().
| QString CryptoManager::fileSystemMountPath | ( | ) | const |
Definition at line 394 of file crypto-manager.cpp.
| bool CryptoManager::initialize | ( | const QVariantMap & | configuration | ) |
Definition at line 102 of file crypto-manager.cpp.
References TRACE.
| bool CryptoManager::mountFileSystem | ( | ) |
Mounts the encrypted file system.
Definition at line 258 of file crypto-manager.cpp.
References BLAME, CryptsetupHandler::closeFile(), DEVICE_MAPPER_DIR, LosetupHandler::findAvailableDevice(), CryptsetupHandler::loadDmMod(), CryptsetupHandler::openFile(), LosetupHandler::setupDevice(), TRACE, and unmountFileSystem().
Referenced by encryptionKeyInUse().
| bool CryptoManager::removeEncryptionKey | ( | const SignOn::Key & | key, |
| const SignOn::Key & | remainingKey | ||
| ) |
Releases an existing used keyslot in the LUKS partition's header.
| key | The key to be removed. |
| remainingKey | Another valid key |
Definition at line 455 of file crypto-manager.cpp.
References CryptsetupHandler::removeKeySlot(), and TRACE.
| bool CryptoManager::setupFileSystem | ( | ) |
Sets up an encrypted file system.
This method is to be called only at the file system creation/formatting. Use mountFileSystem() on subsequent uses. This method handles also the mounting so when using it, a call to mountFileSystem() is not necessary.
Definition at line 175 of file crypto-manager.cpp.
References BLAME, CryptsetupHandler::closeFile(), PartitionHandler::createPartitionFile(), DEVICE_MAPPER_DIR, LosetupHandler::findAvailableDevice(), CryptsetupHandler::formatFile(), PartitionHandler::formatPartitionFile(), CryptsetupHandler::loadDmMod(), CryptsetupHandler::openFile(), LosetupHandler::setupDevice(), TRACE, and unmountFileSystem().
| bool CryptoManager::unmountFileSystem | ( | ) |
Unmounts the encrypted file system.
Definition at line 345 of file crypto-manager.cpp.
References CryptsetupHandler::closeFile(), LosetupHandler::releaseDevice(), and TRACE.
Referenced by deleteFileSystem(), mountFileSystem(), setupFileSystem(), and ~CryptoManager().