23 #ifndef STORAGE_ENCRYPTION_H
24 #define STORAGE_ENCRYPTION_H
27 #include "storage/Devices/BlkDevice.h"
33 enum class EncryptionType {
34 NONE, TWOFISH, TWOFISH_OLD, TWOFISH256_OLD, LUKS, LUKS1 = LUKS, UNKNOWN, LUKS2, PLAIN
195 const Impl& get_impl()
const;
void set_in_etc_crypttab(bool in_etc_crypttab)
Set whether the LUKS device will be present in /etc/crypttab.
static std::vector< Encryption * > get_all(Devicegraph *devicegraph)
Get all Encryption objects of the devicegraph.
void set_cipher(const std::string &cipher)
Set the cipher.
Encryption * to_encryption(Device *device)
Converts pointer to Device to pointer to Encryption.
const std::string & get_cipher() const
Get the cipher.
const std::string & get_open_options() const
Get extra options for open calls.
void set_default_mount_by()
Set the mount-by method to the global default, see Storage::get_default_mount_by().
bool is_in_etc_crypttab() const
Query whether the LUKS device is present (probed devicegraph) or will be present (staging devicegraph...
MountByType get_mount_by() const
Get the mount-by method.
The storage namespace.
Definition: Actiongraph.h:39
static std::vector< const Encryption * > get_all(const Devicegraph *devicegraph)
Get all Encryption objects of the devicegraph.
An encryption layer on a blk device.
Definition: Encryption.h:46
void set_key_file(const std::string &key_file)
Set the key file.
An abstract Block Device.
Definition: BlkDevice.h:47
static Encryption * create(Devicegraph *devicegraph, const std::string &name)
Create a device of type Encryption.
The main container of the libstorage-ng.
Definition: Devicegraph.h:170
void set_key_size(unsigned int key_size)
Set the key size in bytes.
const BlkDevice * get_blk_device() const
Return underlying blk device.
void set_type(EncryptionType type)
Set the encryption type.
void set_open_options(const std::string &open_options)
Set extra options for open calls.
An abstract base class for storage devices.
Definition: Device.h:82
void set_mount_by(MountByType mount_by)
Set the mount-by method.
bool is_encryption(const Device *device)
Checks whether device points to an Encryption.
MountByType
The key by which the mount program identifies a mountable.
Definition: Mountable.h:60
void set_password(const std::string &password)
Set the encryption password.
void set_crypt_options(const std::vector< std::string > &crypt_options)
Set options (fourth field) in /etc/crypttab.
const std::vector< std::string > & get_crypt_options() const
Get options (fourth field) in /etc/crypttab.
unsigned int get_key_size() const
Get the key size in bytes.
const std::string & get_key_file() const
Get the key file.
const std::string & get_password() const
Get the encryption password.
EncryptionType get_type() const
Get the encryption type.