libstorage-ng
Public Member Functions | Static Public Member Functions | List of all members
storage::BitlockerV2 Class Reference

A BitLocker layer on a block device. More...

#include <BitlockerV2.h>

Inheritance diagram for storage::BitlockerV2:
[legend]
Collaboration diagram for storage::BitlockerV2:
[legend]

Public Member Functions

const std::string & get_uuid () const
 Get the BitLocker UUID.
 
Impl & get_impl ()
 
const Impl & get_impl () const
 
virtual BitlockerV2clone () const override
 
 BitlockerV2 (Impl *impl)
 
- Public Member Functions inherited from storage::Encryption
EncryptionType get_type () const
 Get the encryption type.
 
void set_type (EncryptionType type)
 Set the encryption type. More...
 
const std::string & get_password () const
 Get the encryption password.
 
void set_password (const std::string &password)
 Set the encryption password.
 
const std::string & get_key_file () const
 Get the key file.
 
void set_key_file (const std::string &key_file)
 Set the key file. More...
 
bool is_use_key_file_in_commit () const
 Get whether the key file is used in commit.
 
void set_use_key_file_in_commit (bool use_key_file_in_commit)
 Set whether the key file is used in commit. More...
 
const std::string & get_cipher () const
 Get the cipher. More...
 
void set_cipher (const std::string &cipher)
 Set the cipher. More...
 
unsigned int get_key_size () const
 Get the key size in bytes. More...
 
void set_key_size (unsigned int key_size)
 Set the key size in bytes. More...
 
const std::string & get_pbkdf () const
 Get the PBKDF (of the first used keyslot). More...
 
void set_pbkdf (const std::string &pbkdf)
 Set the PBKDF. More...
 
const std::string & get_integrity () const
 Get the integrity. More...
 
void set_integrity (const std::string &integrity)
 Set the integrity. More...
 
MountByType get_mount_by () const
 Get the mount-by method. More...
 
void set_mount_by (MountByType mount_by)
 Set the mount-by method. More...
 
void set_default_mount_by ()
 Set the mount-by method to the global default, see Storage::get_default_mount_by(). More...
 
const std::vector< std::string > & get_crypt_options () const
 Get options (fourth field) in /etc/crypttab.
 
void set_crypt_options (const std::vector< std::string > &crypt_options)
 Set options (fourth field) in /etc/crypttab.
 
bool is_in_etc_crypttab () const
 Query whether the LUKS device is present (probed devicegraph) or will be present (staging devicegraph) in /etc/crypttab.
 
void set_in_etc_crypttab (bool in_etc_crypttab)
 Set whether the LUKS device will be present in /etc/crypttab.
 
BlkDeviceget_blk_device ()
 Return underlying blk device. More...
 
const BlkDeviceget_blk_device () const
 Return underlying blk device. More...
 
const std::string & get_open_options () const
 Get extra options for open calls.
 
void set_open_options (const std::string &open_options)
 Set extra options for open calls. More...
 
Impl & get_impl ()
 
const Impl & get_impl () const
 
 Encryption (Impl *impl)
 
- Public Member Functions inherited from storage::BlkDevice
const std::string & get_name () const
 
void set_name (const std::string &name)
 
const Regionget_region () const
 
void set_region (const Region &region)
 
unsigned long long get_size () const
 Returns the size of the block device.
 
void set_size (unsigned long long size)
 Set the size of the block device. More...
 
std::string get_size_string () const
 Returns the size of the block device as a localised string. More...
 
const Topologyget_topology () const
 Get the topology.
 
void set_topology (const Topology &topology)
 Set the topology. More...
 
bool is_active () const
 
bool is_read_only () const
 Return whether the block device is read-only. More...
 
const std::string & get_sysfs_name () const
 
const std::string & get_sysfs_path () const
 
const std::vector< std::string > & get_udev_paths () const
 Return the names of the udev by-path links of the blk device. More...
 
const std::vector< std::string > & get_udev_ids () const
 Return the names of the udev by-id links of the blk device. More...
 
bool is_usable_as_blk_device () const
 Checks whether the blk device is in general usable as a blk device. More...
 
RemoveInfo detect_remove_info () const
 Check whether the device can be removed. More...
 
const std::string & get_dm_table_name () const
 Return device-mapper table name (dm-table-name for short). More...
 
void set_dm_table_name (const std::string &dm_table_name)
 Set the device-mapper table name (dm-table-name for short). More...
 
BlkFilesystemcreate_blk_filesystem (FsType fs_type)
 Creates a block filesystem on the block device. More...
 
bool has_blk_filesystem () const
 Return whether the block device has a block filesystem.
 
BlkFilesystemget_blk_filesystem ()
 Return the block filesystem of the block device. More...
 
const BlkFilesystemget_blk_filesystem () const
 Return the block filesystem of the block device. More...
 
BlkFilesystemcreate_filesystem (FsType fs_type) ST_DEPRECATED
 Creates a block filesystem on the block device. More...
 
bool has_filesystem () const ST_DEPRECATED
 Return whether the block device has a block filesystem. More...
 
BlkFilesystemget_filesystem () ST_DEPRECATED
 Return the block filesystem of the block device. More...
 
const BlkFilesystemget_filesystem () const ST_DEPRECATED
 Return the block filesystem of the block device. More...
 
Encryptioncreate_encryption (const std::string &dm_table_name) ST_DEPRECATED
 Creates an encryption device on the blk device. More...
 
Encryptioncreate_encryption (const std::string &dm_table_name, EncryptionType type)
 Creates an encryption device on the blk device. More...
 
void remove_encryption ()
 Removes an encryption device on the blk device. More...
 
bool has_encryption () const
 Return whether the block device has an Encryption.
 
Encryptionget_encryption ()
 Return the Encryption of the block device. More...
 
const Encryptionget_encryption () const
 Return the Encryption of the block device. More...
 
Bcachecreate_bcache (const std::string &name)
 Creates a Bcache on the blk device. More...
 
bool has_bcache () const
 Return whether the block device has a BCache.
 
Bcacheget_bcache ()
 Return the Bcache of the block device. More...
 
const Bcacheget_bcache () const
 Return the Bcache of the block device. More...
 
BcacheCsetcreate_bcache_cset ()
 Creates a BcacheCset on the blk device. More...
 
bool has_bcache_cset () const
 Return whether the block device has a BcacheCset.
 
BcacheCsetget_bcache_cset ()
 Return the BcacheCset of the block device. More...
 
const BcacheCsetget_bcache_cset () const
 Return the BcacheCset of the block device. More...
 
std::vector< MountByTypepossible_mount_bys () const
 Returns the possible mount-by methods to reference the block device. More...
 
Impl & get_impl ()
 
const Impl & get_impl () const
 
- Public Member Functions inherited from storage::Device
sid_t get_sid () const
 Return the storage id (sid) of the device. More...
 
bool operator== (const Device &rhs) const
 
bool operator!= (const Device &rhs) const
 
Devicecopy_to_devicegraph (Devicegraph *devicegraph) const
 Copies the device to the devicegraph. More...
 
bool exists_in_devicegraph (const Devicegraph *devicegraph) const
 Checks if the device exists in the devicegraph.
 
bool exists_in_probed () const
 Checks if the device exists in the probed devicegraph.
 
bool exists_in_staging () const
 Checks if the device exists in the staging devicegraph.
 
bool exists_in_system () const
 Checks if the device exists in the system devicegraph.
 
std::string get_displayname () const
 
ResizeInfo detect_resize_info () const
 Detect the resize info of the device. More...
 
bool has_children () const
 
size_t num_children () const
 
bool has_parents () const
 
size_t num_parents () const
 
std::vector< Device * > get_children ()
 
std::vector< const Device * > get_children () const
 
std::vector< Device * > get_children (View view)
 Get all children of the device.
 
std::vector< const Device * > get_children (View view) const
 Get all children of the device. More...
 
std::vector< Device * > get_parents ()
 
std::vector< const Device * > get_parents () const
 
std::vector< Device * > get_parents (View view)
 Get all parents of the device.
 
std::vector< const Device * > get_parents (View view) const
 Get all parents of the device. More...
 
std::vector< Device * > get_siblings (bool itself)
 
std::vector< const Device * > get_siblings (bool itself) const
 
std::vector< Device * > get_descendants (bool itself)
 
std::vector< const Device * > get_descendants (bool itself) const
 
std::vector< Device * > get_descendants (bool itself, View view)
 
std::vector< const Device * > get_descendants (bool itself, View view) const
 
std::vector< Device * > get_ancestors (bool itself)
 
std::vector< const Device * > get_ancestors (bool itself) const
 
std::vector< Device * > get_leaves (bool itself)
 
std::vector< const Device * > get_leaves (bool itself) const
 
std::vector< Device * > get_roots (bool itself)
 
std::vector< const Device * > get_roots (bool itself) const
 
std::vector< Holder * > get_in_holders ()
 
std::vector< const Holder * > get_in_holders () const
 
std::vector< Holder * > get_out_holders ()
 
std::vector< const Holder * > get_out_holders () const
 
void remove_descendants () ST_DEPRECATED
 
void remove_descendants (View view)
 Remove all descendants of the device. More...
 
const std::map< std::string, std::string > & get_userdata () const
 Return the userdata of the device.
 
void set_userdata (const std::map< std::string, std::string > &userdata)
 Set the userdata of the device.
 
std::string get_name_sort_key () const
 Get a sort-key based on the device name. More...
 
Devicegraphget_devicegraph ()
 Return the devicegraph the device belongs to.
 
const Devicegraphget_devicegraph () const
 Return the devicegraph the device belongs to. More...
 
Impl & get_impl ()
 
const Impl & get_impl () const
 
void save (xmlNode *node) const ST_DEPRECATED
 

Static Public Member Functions

static BitlockerV2create (Devicegraph *devicegraph, const std::string &dm_table_name)
 Create a device of type BitlockerV2. More...
 
static BitlockerV2load (Devicegraph *devicegraph, const xmlNode *node)
 
static std::vector< BitlockerV2 * > get_all (Devicegraph *devicegraph)
 Get all BitlockerV2s.
 
static std::vector< const BitlockerV2 * > get_all (const Devicegraph *devicegraph)
 Get all BitlockerV2s. More...
 
static void reset_activation_infos ()
 The library keeps track of whether the activation of a specific BitLocker device was canceled and of the password. More...
 
- Static Public Member Functions inherited from storage::Encryption
static Encryptioncreate (Devicegraph *devicegraph, const std::string &name)
 Create a device of type Encryption. More...
 
static Encryptionload (Devicegraph *devicegraph, const xmlNode *node)
 
static std::vector< Encryption * > get_all (Devicegraph *devicegraph)
 Get all Encryption objects of the devicegraph.
 
static std::vector< const Encryption * > get_all (const Devicegraph *devicegraph)
 Get all Encryption objects of the devicegraph. More...
 
- Static Public Member Functions inherited from storage::BlkDevice
static std::vector< BlkDevice * > get_all (Devicegraph *devicegraph)
 Get all BlkDevices.
 
static std::vector< const BlkDevice * > get_all (const Devicegraph *devicegraph)
 Get all BlkDevices. More...
 
static BlkDevicefind_by_name (Devicegraph *devicegraph, const std::string &name)
 Find a block device by its name. More...
 
static const BlkDevicefind_by_name (const Devicegraph *devicegraph, const std::string &name)
 Find a block device by its name. More...
 
static bool exists_by_any_name (const Devicegraph *devicegraph, const std::string &name, SystemInfo &system_info)
 Check if a block device by any name including any symbolic links in /dev. More...
 
static BlkDevicefind_by_any_name (Devicegraph *devicegraph, const std::string &name) ST_DEPRECATED
 Find a block device by any name including any symbolic links in /dev. More...
 
static BlkDevicefind_by_any_name (Devicegraph *devicegraph, const std::string &name, SystemInfo &system_info)
 Find a block device by any name including any symbolic links in /dev. More...
 
static const BlkDevicefind_by_any_name (const Devicegraph *devicegraph, const std::string &name) ST_DEPRECATED
 Find a block device by any name including any symbolic links in /dev. More...
 
static const BlkDevicefind_by_any_name (const Devicegraph *devicegraph, const std::string &name, SystemInfo &system_info)
 Find a block device by any name including any symbolic links in /dev. More...
 
static bool compare_by_dm_table_name (const BlkDevice *lhs, const BlkDevice *rhs)
 Compare (less than) two BlkDevices by DM table name. More...
 
- Static Public Member Functions inherited from storage::Device
static std::vector< Device * > get_all (Devicegraph *devicegraph)
 Get all Devices.
 
static std::vector< const Device * > get_all (const Devicegraph *devicegraph)
 Get all Devices. More...
 
static bool compare_by_sid (const Device *lhs, const Device *rhs)
 Compare (less than) two Devices by sid. More...
 
static bool compare_by_name (const Device *lhs, const Device *rhs)
 Compare (less than) two Devices by name. More...
 

Additional Inherited Members

- Protected Member Functions inherited from storage::BlkDevice
 BlkDevice (Impl *impl)
 
- Protected Member Functions inherited from storage::Device
 Device (Impl *impl)
 
void create (Devicegraph *devicegraph) ST_DEPRECATED
 Create a device in the devicegraph. More...
 
void load (Devicegraph *devicegraph) ST_DEPRECATED
 

Detailed Description

A BitLocker layer on a block device.

Uses cryptsetup. Generated during probing if LIBSTORAGE_CRYPTSETUP_FOR_BITLOCKER=yes.

The block device is likely only usable by the NTFS that is already on it since the device-mapper table contains or may contain "zero" mappings.

Member Function Documentation

◆ create()

static BitlockerV2* storage::BitlockerV2::create ( Devicegraph devicegraph,
const std::string &  dm_table_name 
)
static

Create a device of type BitlockerV2.

Usually this function is not called directly. Instead BlkDevice::create_encryption() is called.

See also
Device::create(Devicegraph*)

◆ get_all()

static std::vector<const BitlockerV2*> storage::BitlockerV2::get_all ( const Devicegraph devicegraph)
static

Get all BitlockerV2s.

◆ reset_activation_infos()

static void storage::BitlockerV2::reset_activation_infos ( )
static

The library keeps track of whether the activation of a specific BitLocker device was canceled and of the password.

Using this function that information can be reset.


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