Certificate delete API – backend.

Till now the Certificate Manager has one-to-one relation with a
Certificate class. And the DELETE API provided by the
Certificate Manager was enough to delete managed by it certificate.

With introducing Mutual-TLS the relation is changing to one-to-many
and current delete API is not sufficient. This commit adds DELETE
interface to Certificate class, so each of them can be removed
individually. This implementation was done on base of current user
account management implementation. The Certificate class exposes the
delete interface on DBus. When the API is called the Certificate
instance calls proper operation on Certificate Manager which
removes it from its internal collection. The rest of the removing
certificate process, including service reset remains as it was.

Tested with uploaded multiple TLS certificates.
Each Certificate exposes Delete interface on dbus and user is able
to delete each of them. The delete API on Certificate Manager object
was replaced with DeleteAll interface and results in deleting all
loaded certificates.

Signed-off-by: Zbigniew Kurzynski <zbigniew.kurzynski@intel.com>
Change-Id: I9dd6fa998e8bd8081fbd13549831bc94a4a7aa54
diff --git a/certs_manager.hpp b/certs_manager.hpp
index 9dd128d..ed28348 100644
--- a/certs_manager.hpp
+++ b/certs_manager.hpp
@@ -9,16 +9,17 @@
 #include <sdeventplus/source/event.hpp>
 #include <xyz/openbmc_project/Certs/CSR/Create/server.hpp>
 #include <xyz/openbmc_project/Certs/Install/server.hpp>
-#include <xyz/openbmc_project/Object/Delete/server.hpp>
+#include <xyz/openbmc_project/Collection/DeleteAll/server.hpp>
 
 namespace phosphor
 {
 namespace certs
 {
 using Install = sdbusplus::xyz::openbmc_project::Certs::server::Install;
-using Delete = sdbusplus::xyz::openbmc_project::Object::server::Delete;
+using DeleteAll =
+    sdbusplus::xyz::openbmc_project::Collection::server::DeleteAll;
 using CSRCreate = sdbusplus::xyz::openbmc_project::Certs::CSR::server::Create;
-using Ifaces = sdbusplus::server::object::object<Install, CSRCreate, Delete>;
+using Ifaces = sdbusplus::server::object::object<Install, CSRCreate, DeleteAll>;
 
 using X509_REQ_Ptr = std::unique_ptr<X509_REQ, decltype(&::X509_REQ_free)>;
 using EVP_PKEY_Ptr = std::unique_ptr<EVP_PKEY, decltype(&::EVP_PKEY_free)>;
@@ -64,10 +65,14 @@
      */
     std::string install(const std::string filePath) override;
 
-    /** @brief Delete the certificate (and possibly revert
-     *         to a self-signed certificate).
+    /** @brief Implementation for DeleteAll
+     *  Delete all objects in the collection.
      */
-    void delete_() override;
+    void deleteAll() override;
+
+    /** @brief Delete the certificate with given hash.
+     */
+    void deleteCertificate(const std::string& certHash);
 
     /** @brief Generate Private key and CSR file
      *  Generates the Private key file and CSR file based on the input