Ravi Teja | a49895e | 2020-06-16 03:57:58 -0500 | [diff] [blame] | 1 | #include "config.h" |
| 2 | |
| 3 | #include "ca_certs_manager.hpp" |
| 4 | |
| 5 | #include <sdeventplus/event.hpp> |
| 6 | #include <string> |
| 7 | |
| 8 | int main(int argc, char** argv) |
| 9 | { |
| 10 | auto bus = sdbusplus::bus::new_default(); |
Ravi Teja | 86a31ba | 2021-04-23 04:22:49 -0500 | [diff] [blame] | 11 | static constexpr auto objPath = "/xyz/openbmc_project/certs/ca"; |
Ravi Teja | a49895e | 2020-06-16 03:57:58 -0500 | [diff] [blame] | 12 | |
| 13 | // Add sdbusplus ObjectManager |
Ravi Teja | 86a31ba | 2021-04-23 04:22:49 -0500 | [diff] [blame] | 14 | sdbusplus::server::manager::manager objManager(bus, objPath); |
Ravi Teja | a49895e | 2020-06-16 03:57:58 -0500 | [diff] [blame] | 15 | |
| 16 | // Get default event loop |
| 17 | auto event = sdeventplus::Event::get_default(); |
| 18 | |
| 19 | // Attach the bus to sd_event to service user requests |
| 20 | bus.attach_event(event.get(), SD_EVENT_PRIORITY_NORMAL); |
| 21 | |
Ravi Teja | 86a31ba | 2021-04-23 04:22:49 -0500 | [diff] [blame] | 22 | ca::cert::CACertMgr manager(bus, event, objPath); |
Ravi Teja | a49895e | 2020-06-16 03:57:58 -0500 | [diff] [blame] | 23 | |
| 24 | std::string busName = "xyz.openbmc_project.Certs.ca.authority.Manager"; |
| 25 | bus.request_name(busName.c_str()); |
| 26 | event.loop(); |
| 27 | return 0; |
| 28 | } |