32 #ifndef SIGNON_CRYPTSETUP_HANDLER_H
33 #define SIGNON_CRYPTSETUP_HANDLER_H
67 bool makeCall(
const QString &appPath,
68 const QStringList &args,
69 bool readOutput =
false);
75 QByteArray
output()
const {
return m_output; }
78 void error(QProcess::ProcessError err);
104 const quint32 fileSize);
114 const quint32 fileSystemType);
137 static bool mount(
const QString &source,
138 const QString &target,
139 const QString &fileSystemType = QLatin1String(
"ext2"));
145 static bool umount(
const QString &target);
169 const QString &blockDevice);
206 static bool formatFile(
const QByteArray &key,
const QString &deviceName);
214 static bool openFile(
const QByteArray &key,
215 const QString &deviceName,
216 const QString &deviceMap);
222 static bool closeFile(
const QString &deviceName);
229 static bool removeFile(
const QString &deviceName);
240 static bool addKeySlot(
const QString &deviceName,
241 const QByteArray &key,
242 const QByteArray &existingKey);
252 const QByteArray &key,
253 const QByteArray &remainingKey);
264 static QString
error();
274 #endif // SIGNON_CRYPTSETUP_HANDLER_H
static bool setupDevice(const QString &deviceName, const QString &blockDevice)
Mounts a block device to loopback device.
bool makeCall(const QString &appPath, const QStringList &args, bool readOutput=false)
Executes the application at appPath in a separate child process.
static bool formatPartitionFile(const QString &fileName, const quint32 fileSystemType)
Formats a file (block device) for a specific file system type (ext2,ext3,ext4)
static bool createPartitionFile(const QString &fileName, const quint32 fileSize)
Creates a random data file of fileSize Mb.
Wraps the libcryptsetup API functionality.
~SystemCommandLineCallHandler()
Destructor.
QByteArray output() const
static bool formatFile(const QByteArray &key, const QString &deviceName)
Formats the file system.
SystemCommandLineCallHandler()
Basic constructor.
static bool loadDmMod()
Loads the dm_mod kernel module.
static bool closeFile(const QString &deviceName)
Closes the file system.
static bool umount(const QString &target)
Unmounts a block device from a specific location.
Handles mounting, unmounting of loopback devices.
static bool removeFile(const QString &deviceName)
Removes the file system.
Handles mounting and unmounting of file systems.
Handles calls to system command line tools.
static bool removeKeySlot(const QString &deviceName, const QByteArray &key, const QByteArray &remainingKey)
Removes a key ocupying an encryption header slot.
static bool addKeySlot(const QString &deviceName, const QByteArray &key, const QByteArray &existingKey)
Adds a key to a free encryption header slot.
static bool mount(const QString &source, const QString &target, const QString &fileSystemType=QLatin1String("ext2"))
Mounts a block device to a specific location.
static bool releaseDevice(const QString &deviceName)
Releases a used loopback device.
static QString findAvailableDevice()
Finds an available loopback device.
static bool openFile(const QByteArray &key, const QString &deviceName, const QString &deviceMap)
Opens the file system.