signon  8.42
CryptsetupHandler Class Reference

Wraps the libcryptsetup API functionality. More...

#include <crypto-handlers.h>

Static Public Member Functions

static bool formatFile (const QByteArray &key, const QString &deviceName)
 Formats the file system.
static bool openFile (const QByteArray &key, const QString &deviceName, const QString &deviceMap)
 Opens the file system.
static bool closeFile (const QString &deviceName)
 Closes the file system.
static bool removeFile (const QString &deviceName)
 Removes the file system.
static bool addKeySlot (const QString &deviceName, const QByteArray &key, const QByteArray &existingKey)
 Adds a key to a free encryption header slot.
static bool removeKeySlot (const QString &deviceName, const QByteArray &key, const QByteArray &remainingKey)
 Removes a key ocupying an encryption header slot.
static bool loadDmMod ()
 Loads the dm_mod kernel module.
static QString error ()

Detailed Description

Wraps the libcryptsetup API functionality.

Definition at line 199 of file crypto-handlers.h.

Member Function Documentation

bool CryptsetupHandler::addKeySlot ( const QString &  deviceName,
const QByteArray &  key,
const QByteArray &  existingKey 
)
static

Adds a key to a free encryption header slot.

This operation is to be executed if at least one key is already set in the LUKS header.

Parameters
deviceName,nameof the device.
key,thekey to be added.
existingKey,analready existing key.
Returns
whether the key was successfully added or not.
Todo:
implement this

Definition at line 533 of file crypto-handlers.cpp.

References crypt_luksAddKeyBinary(), error(), SIGNON_LUKS_CIPHER, SIGNON_LUKS_KEY_SIZE, and TRACE.

Referenced by CryptoManager::addEncryptionKey().

bool CryptsetupHandler::closeFile ( const QString &  deviceName)
static

Closes the file system.

Parameters
deviceName,nameof the mapped device to be closed.

Definition at line 464 of file crypto-handlers.cpp.

References error(), and TRACE.

Referenced by CryptoManager::mountFileSystem(), CryptoManager::setupFileSystem(), and CryptoManager::unmountFileSystem().

QString CryptsetupHandler::error ( )
static
Returns
the last error as string.

Definition at line 660 of file crypto-handlers.cpp.

Referenced by addKeySlot(), closeFile(), formatFile(), openFile(), and removeKeySlot().

bool CryptsetupHandler::formatFile ( const QByteArray &  key,
const QString &  deviceName 
)
static

Formats the file system.

Parameters
key,keyof the ecrypted file system
deviceName,nameof the loop device LUKS formatted.

Definition at line 313 of file crypto-handlers.cpp.

References crypt_luksFormatBinary(), error(), SIGNON_LUKS_BASE_KEYSLOT, SIGNON_LUKS_CIPHER, SIGNON_LUKS_KEY_SIZE, and TRACE.

Referenced by CryptoManager::setupFileSystem().

bool CryptsetupHandler::loadDmMod ( )
static

Loads the dm_mod kernel module.

Returns
whether the dm_mod was successfully loaded or not.

Definition at line 652 of file crypto-handlers.cpp.

References SystemCommandLineCallHandler::makeCall().

Referenced by CryptoManager::CryptoManager(), CryptoManager::mountFileSystem(), and CryptoManager::setupFileSystem().

bool CryptsetupHandler::openFile ( const QByteArray &  key,
const QString &  deviceName,
const QString &  deviceMap 
)
static

Opens the file system.

Parameters
key,keyof the ecrypted file system
deviceName,nameof the loop device to be opened.
deviceMap,nameof the device mapper mapped device.

Definition at line 404 of file crypto-handlers.cpp.

References crypt_luksOpenBinary(), error(), and TRACE.

Referenced by CryptoManager::mountFileSystem(), and CryptoManager::setupFileSystem().

bool CryptsetupHandler::removeFile ( const QString &  deviceName)
static

Removes the file system.

Parameters
deviceName,nameof the device.
Todo:
implement this

Definition at line 492 of file crypto-handlers.cpp.

bool CryptsetupHandler::removeKeySlot ( const QString &  deviceName,
const QByteArray &  key,
const QByteArray &  remainingKey 
)
static

Removes a key ocupying an encryption header slot.

Parameters
deviceName,nameof the device.
key,thekey to be removed.
Returns
whether the key was successfully removed or not.
Todo:
implement this

Definition at line 614 of file crypto-handlers.cpp.

References crypt_luksRemoveKeyBinary(), error(), SIGNON_LUKS_CIPHER, SIGNON_LUKS_KEY_SIZE, and TRACE.

Referenced by CryptoManager::removeEncryptionKey().


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