Implementation of BMC VMI certificate manager

This manager is to create and manage entries
for each host CSR request which needs to shared
with host.

this commits implements dbus interfaces
https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-dbus-interfaces/+/31808

This feature can be enabled by using below feature flag
"--enable-ca-cert-extension"

Testby:
Creating CSR entries
Deleting  entries
Setting properties

Signed-off-by: Ravi Teja <raviteja28031990@gmail.com>
Change-Id: I24829b839feac6264f32053b9be63daef6599379
diff --git a/bmc-vmi-ca/ca_cert_entry.hpp b/bmc-vmi-ca/ca_cert_entry.hpp
new file mode 100644
index 0000000..245a5cc
--- /dev/null
+++ b/bmc-vmi-ca/ca_cert_entry.hpp
@@ -0,0 +1,72 @@
+#pragma once
+
+#include "xyz/openbmc_project/Certs/Entry/server.hpp"
+#include "xyz/openbmc_project/Object/Delete/server.hpp"
+#include "xyz/openbmc_project/PLDM/Provider/Certs/Authority/CSR/server.hpp"
+
+#include <sdbusplus/bus.hpp>
+#include <sdbusplus/server/object.hpp>
+
+namespace ca
+{
+namespace cert
+{
+
+using Delete = sdbusplus::xyz::openbmc_project::Object::server::Delete;
+
+using CertEntry = sdbusplus::xyz::openbmc_project::Certs::server::Entry;
+using CSREntry = sdbusplus::xyz::openbmc_project::PLDM::Provider::Certs::
+    Authority::server::CSR;
+using Ifaces = sdbusplus::server::object::object<CSREntry, CertEntry, Delete>;
+
+class CACertMgr;
+
+/** @class Entry
+ *  @brief CA authority certificate Entry implementation.
+ *  @details A concrete implementation for the
+ *           xyz.openbmc_project.Certs.Entry DBus API
+ */
+class Entry : public Ifaces
+{
+  public:
+    Entry() = delete;
+    Entry(const Entry&) = delete;
+    Entry& operator=(const Entry&) = delete;
+    Entry(Entry&&) = delete;
+    Entry& operator=(Entry&&) = delete;
+    ~Entry() = default;
+
+    /** @brief Constructor to put object onto bus at a D-Bus path.
+     *  @param[in] bus - Bus to attach to.
+     *  @param[in] objPath - The D-Bus object path to attach at.
+     *  @param[in] entryId - Entry id
+     *  @param[in] csr     - csr string
+     *  @param[in] cert    - client certificate
+     */
+    Entry(sdbusplus::bus::bus& bus, const std::string& objPath,
+          uint32_t entryId, std::string& csr, std::string& cert,
+          CACertMgr& manager) :
+        Ifaces(bus, objPath.c_str(), true),
+        bus(bus), id(entryId), manager(manager)
+
+    {
+        cSR(csr);
+        clientCertificate(cert);
+
+        // Emit deferred signal.
+        this->emit_object_added();
+    };
+
+    void delete_() override;
+
+  protected:
+    /** @brief sdbusplus handler */
+    sdbusplus::bus::bus& bus;
+    uint32_t id;
+    /** @brief object path */
+    std::string objectPath;
+    /** @brief Reference to Certificate Manager */
+    CACertMgr& manager;
+};
+} // namespace cert
+} // namespace ca