-
Notifications
You must be signed in to change notification settings - Fork 12
/
csr.hpp
56 lines (48 loc) · 1.32 KB
/
csr.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#pragma once
#include <sdbusplus/server/object.hpp>
#include <string>
#include <xyz/openbmc_project/Certs/CSR/server.hpp>
namespace phosphor::certs
{
enum class Status
{
success,
failure,
};
namespace internal
{
using CSRInterface = sdbusplus::server::object_t<
sdbusplus::xyz::openbmc_project::Certs::server::CSR>;
}
/** @class CSR
* @brief To read CSR certificate
*/
class CSR : public internal::CSRInterface
{
public:
CSR() = delete;
~CSR() = default;
CSR(const CSR&) = delete;
CSR& operator=(const CSR&) = delete;
CSR(CSR&&) = delete;
CSR& operator=(CSR&&) = delete;
/** @brief Constructor to put object onto bus at a D-Bus path.
* @param[in] bus - Bus to attach to.
* @param[in] path - The D-Bus object path to attach at.
* @param[in] installPath - Certificate installation path.
* @param[in] status - Status of Generate CSR request
*/
CSR(sdbusplus::bus_t& bus, const char* path, std::string&& installPath,
const Status& status);
/** @brief Return CSR
*/
std::string csr() override;
private:
/** @brief object path */
std::string objectPath;
/** @brief Certificate file installation path **/
std::string certInstallPath;
/** @brief Status of GenerateCSR request */
Status csrStatus;
};
} // namespace phosphor::certs