diff --git a/redfish-core/lib/certificate_service.hpp b/redfish-core/lib/certificate_service.hpp
index 0c1bc62..53c72e6 100644
--- a/redfish-core/lib/certificate_service.hpp
+++ b/redfish-core/lib/certificate_service.hpp
@@ -870,29 +870,21 @@
             boost::beast::http::verb::
                 get)([&app](const crow::Request& req,
                             const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                            const std::string& param) -> void {
+                            const std::string& id) -> void {
             if (!redfish::setUpRedfishRoute(app, req, asyncResp))
             {
                 return;
             }
-            if (param.empty())
-            {
-                messages::internalError(asyncResp->res);
-                return;
-            }
-            long id = getIDFromURL(req.url);
 
-            BMCWEB_LOG_DEBUG << "HTTPSCertificate::doGet ID="
-                             << std::to_string(id);
+            BMCWEB_LOG_DEBUG << "HTTPS Certificate ID=" << id;
             std::string certURL =
                 "/redfish/v1/Managers/bmc/NetworkProtocol/HTTPS/Certificates/" +
-                std::to_string(id);
-            std::string objectPath = certs::httpsObjectPath;
-            objectPath += "/";
-            objectPath += std::to_string(id);
-            getCertificateProperties(
-                asyncResp, objectPath, certs::httpsServiceName,
-                std::to_string(id), certURL, "HTTPS Certificate");
+                id;
+            std::string objPath =
+                sdbusplus::message::object_path(certs::httpsObjectPath) / id;
+            getCertificateProperties(asyncResp, objPath,
+                                     certs::httpsServiceName, id, certURL,
+                                     "HTTPS Certificate");
         });
 }
 
@@ -961,19 +953,15 @@
                 messages::internalError(asyncResp->res);
                 return;
             }
-            long certId = getIDFromURL(objectPath);
-            if (certId < 0)
-            {
-                BMCWEB_LOG_ERROR << "Invalid objectPath value" << objectPath;
-                messages::internalError(asyncResp->res);
-                return;
-            }
+
+            sdbusplus::message::object_path path(objectPath);
+            std::string certId = path.filename();
             std::string certURL =
                 "/redfish/v1/Managers/bmc/NetworkProtocol/HTTPS/Certificates/" +
-                std::to_string(certId);
-            getCertificateProperties(
-                asyncResp, objectPath, certs::httpsServiceName,
-                std::to_string(certId), certURL, "HTTPS Certificate");
+                certId;
+            getCertificateProperties(asyncResp, objectPath,
+                                     certs::httpsServiceName, certId, certURL,
+                                     "HTTPS Certificate");
             BMCWEB_LOG_DEBUG << "HTTPS certificate install file="
                              << certFile->getCertFilePath();
             },
@@ -1072,19 +1060,14 @@
                 messages::internalError(asyncResp->res);
                 return;
             }
-            long certId = getIDFromURL(objectPath);
-            if (certId < 0)
-            {
-                BMCWEB_LOG_ERROR << "Invalid objectPath value" << objectPath;
-                messages::internalError(asyncResp->res);
-                return;
-            }
+
+            sdbusplus::message::object_path path(objectPath);
+            std::string certId = path.filename();
             std::string certURL =
-                "/redfish/v1/AccountService/LDAP/Certificates/" +
-                std::to_string(certId);
-            getCertificateProperties(
-                asyncResp, objectPath, certs::ldapServiceName,
-                std::to_string(certId), certURL, "LDAP Certificate");
+                "/redfish/v1/AccountService/LDAP/Certificates/" + certId;
+            getCertificateProperties(asyncResp, objectPath,
+                                     certs::ldapServiceName, certId, certURL,
+                                     "LDAP Certificate");
             BMCWEB_LOG_DEBUG << "LDAP certificate install file="
                              << certFile->getCertFilePath();
             },
@@ -1104,27 +1087,19 @@
         .methods(boost::beast::http::verb::get)(
             [&app](const crow::Request& req,
                    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                   const std::string&) {
+                   const std::string& id) {
         if (!redfish::setUpRedfishRoute(app, req, asyncResp))
         {
             return;
         }
-        long id = getIDFromURL(req.url);
-        if (id < 0)
-        {
-            BMCWEB_LOG_ERROR << "Invalid url value" << req.url;
-            messages::internalError(asyncResp->res);
-            return;
-        }
-        BMCWEB_LOG_DEBUG << "LDAP Certificate ID=" << std::to_string(id);
-        std::string certURL = "/redfish/v1/AccountService/LDAP/Certificates/" +
-                              std::to_string(id);
-        std::string objectPath = certs::ldapObjectPath;
-        objectPath += "/";
-        objectPath += std::to_string(id);
-        getCertificateProperties(asyncResp, objectPath, certs::ldapServiceName,
-                                 std::to_string(id), certURL,
-                                 "LDAP Certificate");
+
+        BMCWEB_LOG_DEBUG << "LDAP Certificate ID=" << id;
+        std::string certURL =
+            "/redfish/v1/AccountService/LDAP/Certificates/" + id;
+        std::string objPath =
+            sdbusplus::message::object_path(certs::ldapObjectPath) / id;
+        getCertificateProperties(asyncResp, objPath, certs::ldapServiceName, id,
+                                 certURL, "LDAP Certificate");
         });
 } // requestRoutesLDAPCertificate
 /**
@@ -1184,20 +1159,14 @@
                 messages::internalError(asyncResp->res);
                 return;
             }
-            long certId = getIDFromURL(objectPath);
-            if (certId < 0)
-            {
-                BMCWEB_LOG_ERROR << "Invalid objectPath value" << objectPath;
-                messages::internalError(asyncResp->res);
-                return;
-            }
-            std::string certURL =
-                "/redfish/v1/Managers/bmc/Truststore/Certificates/" +
-                std::to_string(certId);
 
-            getCertificateProperties(
-                asyncResp, objectPath, certs::authorityServiceName,
-                std::to_string(certId), certURL, "TrustStore Certificate");
+            sdbusplus::message::object_path path(objectPath);
+            std::string certId = path.filename();
+            std::string certURL =
+                "/redfish/v1/Managers/bmc/Truststore/Certificates/" + certId;
+            getCertificateProperties(asyncResp, objectPath,
+                                     certs::authorityServiceName, certId,
+                                     certURL, "TrustStore Certificate");
             BMCWEB_LOG_DEBUG << "TrustStore certificate install file="
                              << certFile->getCertFilePath();
             },
@@ -1217,29 +1186,20 @@
         .methods(boost::beast::http::verb::get)(
             [&app](const crow::Request& req,
                    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                   const std::string&) {
+                   const std::string& id) {
         if (!redfish::setUpRedfishRoute(app, req, asyncResp))
         {
             return;
         }
-        long id = getIDFromURL(req.url);
-        if (id < 0)
-        {
-            BMCWEB_LOG_ERROR << "Invalid url value" << req.url;
-            messages::internalError(asyncResp->res);
-            return;
-        }
-        BMCWEB_LOG_DEBUG << "TrustStoreCertificate::doGet ID="
-                         << std::to_string(id);
+
+        BMCWEB_LOG_DEBUG << "Truststore Certificate ID=" << id;
         std::string certURL =
-            "/redfish/v1/Managers/bmc/Truststore/Certificates/" +
-            std::to_string(id);
-        std::string objectPath = certs::authorityObjectPath;
-        objectPath += "/";
-        objectPath += std::to_string(id);
-        getCertificateProperties(
-            asyncResp, objectPath, certs::authorityServiceName,
-            std::to_string(id), certURL, "TrustStore Certificate");
+            "/redfish/v1/Managers/bmc/Truststore/Certificates/" + id;
+        std::string objPath =
+            sdbusplus::message::object_path(certs::authorityObjectPath) / id;
+        getCertificateProperties(asyncResp, objPath,
+                                 certs::authorityServiceName, id, certURL,
+                                 "TrustStore Certificate");
         });
 
     BMCWEB_ROUTE(app, "/redfish/v1/Managers/bmc/Truststore/Certificates/<str>/")
@@ -1247,44 +1207,28 @@
         .methods(boost::beast::http::verb::delete_)(
             [&app](const crow::Request& req,
                    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                   const std::string& param) {
+                   const std::string& id) {
         if (!redfish::setUpRedfishRoute(app, req, asyncResp))
         {
             return;
         }
-        if (param.empty())
-        {
-            messages::internalError(asyncResp->res);
-            return;
-        }
 
-        long id = getIDFromURL(req.url);
-        if (id < 0)
-        {
-            BMCWEB_LOG_ERROR << "Invalid url value: " << req.url;
-            messages::resourceNotFound(asyncResp->res, "TrustStore Certificate",
-                                       std::string(req.url));
-            return;
-        }
-        BMCWEB_LOG_DEBUG << "TrustStoreCertificate::doDelete ID="
-                         << std::to_string(id);
-        std::string certPath = certs::authorityObjectPath;
-        certPath += "/";
-        certPath += std::to_string(id);
+        BMCWEB_LOG_DEBUG << "Delete TrustStore Certificate ID=" << id;
+        std::string objPath =
+            sdbusplus::message::object_path(certs::authorityObjectPath) / id;
 
         crow::connections::systemBus->async_method_call(
             [asyncResp, id](const boost::system::error_code ec) {
             if (ec)
             {
                 messages::resourceNotFound(asyncResp->res,
-                                           "TrustStore Certificate",
-                                           std::to_string(id));
+                                           "TrustStore Certificate", id);
                 return;
             }
             BMCWEB_LOG_INFO << "Certificate deleted";
             asyncResp->res.result(boost::beast::http::status::no_content);
             },
-            certs::authorityServiceName, certPath, certs::objDeleteIntf,
+            certs::authorityServiceName, objPath, certs::objDeleteIntf,
             "Delete");
         });
 } // requestRoutesTrustStoreCertificate
