Implement Replace interface for Certificate objects

Replace interface is used to replace an existing certificate.

Change-Id: Ibf4bbc9a96fd68b25e447c1b11a24be42c547a26
Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
diff --git a/certificate.hpp b/certificate.hpp
index 878ae71..6fbef52 100644
--- a/certificate.hpp
+++ b/certificate.hpp
@@ -5,7 +5,7 @@
 #include <filesystem>
 #include <phosphor-logging/elog.hpp>
 #include <xyz/openbmc_project/Certs/Certificate/server.hpp>
-#include <xyz/openbmc_project/Certs/Install/server.hpp>
+#include <xyz/openbmc_project/Certs/Replace/server.hpp>
 
 namespace phosphor
 {
@@ -13,9 +13,9 @@
 {
 using CertificateIface = sdbusplus::server::object::object<
     sdbusplus::xyz::openbmc_project::Certs::server::Certificate>;
-using InstallIface = sdbusplus::xyz::openbmc_project::Certs::server::Install;
+using ReplaceIface = sdbusplus::xyz::openbmc_project::Certs::server::Replace;
 using CertIfaces =
-    sdbusplus::server::object::object<CertificateIface, InstallIface>;
+    sdbusplus::server::object::object<CertificateIface, ReplaceIface>;
 
 using CertificateType = std::string;
 using UnitsToRestart = std::string;
@@ -67,14 +67,19 @@
                 const CertInstallPath& installPath,
                 const CertUploadPath& uploadPath);
 
-    /** @brief Implementation for Install
-     *  Replace the existing certificate file with another
+    /** @brief Validate certificate and replace the existing certificate
+     *  @param[in] filePath - Certificate file path.
+     */
+    void replace(const std::string filePath) override;
+
+  private:
+    /** @brief Validate and Replace/Install the certificate file
+     *  Install/Replace the existing certificate file with another
      *  (possibly CA signed) Certificate file.
      *  @param[in] filePath - Certificate file path.
      */
-    void install(const std::string filePath) override;
+    void install(const std::string& filePath);
 
-  private:
     /** @brief Load Certificate file into the X509 structre.
      *  @param[in] fileName - Certificate and key full file path.
      *  @return pointer to the X509 structure.