libstorage-ng
BitlockerV2.h
1 /*
2  * Copyright (c) 2022 SUSE LLC
3  *
4  * All Rights Reserved.
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms of version 2 of the GNU General Public License as published
8  * by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, contact Novell, Inc.
17  *
18  * To contact Novell about this file by physical or electronic mail, you may
19  * find current contact information at www.novell.com.
20  */
21 
22 
23 #ifndef STORAGE_BITLOCKER_V2_H
24 #define STORAGE_BITLOCKER_V2_H
25 
26 
27 #include "storage/Devices/Encryption.h"
28 
29 
30 namespace storage
31 {
32 
42  class BitlockerV2 : public Encryption
43  {
44  public:
45 
52  static BitlockerV2* create(Devicegraph* devicegraph, const std::string& dm_table_name);
53 
54  static BitlockerV2* load(Devicegraph* devicegraph, const xmlNode* node);
55 
59  static std::vector<BitlockerV2*> get_all(Devicegraph* devicegraph);
60 
64  static std::vector<const BitlockerV2*> get_all(const Devicegraph* devicegraph);
65 
69  const std::string& get_uuid() const;
70 
76  static void reset_activation_infos();
77 
78  public:
79 
80  class Impl;
81 
82  Impl& get_impl();
83  const Impl& get_impl() const;
84 
85  virtual BitlockerV2* clone() const override;
86 
87  protected:
88 
89  BitlockerV2(Impl* impl);
90 
91  };
92 
93 
99  bool is_bitlocker_v2(const Device* device);
100 
108 
112  const BitlockerV2* to_bitlocker_v2(const Device* device);
113 
114 }
115 
116 #endif
static void reset_activation_infos()
The library keeps track of whether the activation of a specific BitLocker device was canceled and of ...
BitlockerV2 * to_bitlocker_v2(Device *device)
Converts pointer to Device to pointer to BitlockerV2.
An encryption layer on a blk device.
Definition: Encryption.h:54
static BitlockerV2 * create(Devicegraph *devicegraph, const std::string &dm_table_name)
Create a device of type BitlockerV2.
bool is_bitlocker_v2(const Device *device)
Checks whether device points to a BitlockerV2.
const std::string & get_uuid() const
Get the BitLocker UUID.
The main container of the libstorage-ng.
Definition: Devicegraph.h:169
An abstract base class for storage devices.
Definition: Device.h:81
static std::vector< BitlockerV2 * > get_all(Devicegraph *devicegraph)
Get all BitlockerV2s.
A BitLocker layer on a block device.
Definition: BitlockerV2.h:42
The storage namespace.
Definition: Actiongraph.h:38