signon 8.54

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Static Public Member Functions | List of all members
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 | removeKeySlot (const QString &deviceName, const QByteArray &key, const QByteArray &remainingKey)
| Removes a key ocupying an 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,name | of the device.
  key,the | key to be added.
  existingKey,an | already 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,name | of 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,key | of the ecrypted file system
  deviceName,name | of 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,key | of the ecrypted file system
  deviceName,name | of the loop device to be opened.
  deviceMap,name | of 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,name | of 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,name | of the device.
  key,the | key 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:

- src/extensions/cryptsetup/crypto-handlers.h
- src/extensions/cryptsetup/crypto-handlers.cpp