signon  8.56
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. More...
 
static bool openFile (const QByteArray &key, const QString &deviceName, const QString &deviceMap)
 Opens the file system. More...
 
static bool closeFile (const QString &deviceName)
 Closes the file system. More...
 
static bool removeFile (const QString &deviceName)
 Removes the file system. More...
 
static bool addKeySlot (const QString &deviceName, const QByteArray &key, const QByteArray &existingKey)
 Adds a key to a free encryption header slot. More...
 
static bool loadDmMod ()
 Loads the dm_mod kernel module. More...
 
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 567 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 500 of file crypto-handlers.cpp.

References crypt_removeDevice(), 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 693 of file crypto-handlers.cpp.

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

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 340 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 685 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 429 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 526 of file crypto-handlers.cpp.


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