forked from ibm-openbmc/phosphor-certificate-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
csr.hpp
58 lines (49 loc) · 1.39 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
57
58
#pragma once
#include <xyz/openbmc_project/Certs/CSR/server.hpp>
namespace phosphor
{
namespace certs
{
using CSRRead = sdbusplus::xyz::openbmc_project::Certs::server::CSR;
using CSRIface = sdbusplus::server::object::object<CSRRead>;
enum class Status
{
SUCCESS,
FAILURE,
};
using CertInstallPath = std::string;
/** @class CSR
* @brief To read CSR certificate
*/
class CSR : public CSRIface
{
public:
CSR() = delete;
~CSR() = default;
CSR(const CSR&) = delete;
CSR& operator=(const CSR&) = delete;
CSR(CSR&&) = default;
CSR& operator=(CSR&&) = default;
/** @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::bus& bus, const char* path,
CertInstallPath&& installPath, const Status& status);
/** @brief Return CSR
*/
std::string cSR() override;
private:
/** @brief sdbusplus handler */
sdbusplus::bus::bus& bus;
/** @brief object path */
std::string objectPath;
/** @brief Certificate file installation path **/
CertInstallPath certInstallPath;
/** @brief Status of GenerateCSR request */
Status csrStatus;
};
} // namespace certs
} // namespace phosphor