1bd324e4aSBrad Bishop# phosphor-certificate-manager 20aea2169SPatrick Williams 30aa0d114SJayanth OthayothCertificate management allows to replace the existing certificate and private 40aa0d114SJayanth Othayothkey file with another (possibly CA signed) Certificate key file. Certificate 50aa0d114SJayanth Othayothmanagement allows the user to install both the server and client certificates. 60aa0d114SJayanth Othayoth 70aa0d114SJayanth Othayoth## To Build 80aa0d114SJayanth Othayoth 91f54ad17SPatrick WilliamsThis project can be built with `meson`. The typical `meson` workflow is: 101f54ad17SPatrick Williams`meson builddir && ninja -C builddir`. 115c515c21SZhenfei Tai 125c515c21SZhenfei Tai## To Run 130aea2169SPatrick Williams 145c515c21SZhenfei TaiMultiple instances of `phosphor-certificate-manager` are usually run on the bmc 155c515c21SZhenfei Taito support management of different types of certificates. 160aea2169SPatrick Williams 1716b6c358SPatrick Williams```text 185c515c21SZhenfei TaiUsage: ./phosphor-certificate-manager [options] 195c515c21SZhenfei TaiOptions: 205c515c21SZhenfei Tai --help Print this menu 215c515c21SZhenfei Tai --type certificate type 225c515c21SZhenfei Tai Valid types: client,server,authority 235c515c21SZhenfei Tai --endpoint d-bus endpoint 245c515c21SZhenfei Tai --path certificate file path 255c515c21SZhenfei Tai --unit=<name> Optional systemd unit need to reload 265c515c21SZhenfei Tai``` 275c515c21SZhenfei Tai 285c515c21SZhenfei Tai### Https certificate management 290aea2169SPatrick Williams 305c515c21SZhenfei Tai**Purpose:** Server https certificate 310aea2169SPatrick Williams 325c515c21SZhenfei Tai```bash 335c515c21SZhenfei Tai./phosphor-certificate-manager --type=server --endpoint=https \ 345c515c21SZhenfei Tai --path=/etc/ssl/certs/https/server.pem --unit=bmcweb.service 355c515c21SZhenfei Tai``` 365c515c21SZhenfei Tai 375c515c21SZhenfei Tai### CA certificate management 380aea2169SPatrick Williams 395c515c21SZhenfei Tai**Purpose:** Client certificate validation 400aea2169SPatrick Williams 415c515c21SZhenfei Tai```bash 42*2e8fa88eSMichal Orzel./phosphor-certificate-manager --type=authority --endpoint=truststore \ 435c515c21SZhenfei Tai --path=/etc/ssl/certs/authority --unit=bmcweb.service 445c515c21SZhenfei Tai``` 455c515c21SZhenfei Tai 465c515c21SZhenfei Tai### LDAP client certificate management 470aea2169SPatrick Williams 485c515c21SZhenfei Tai**Purpose:** LDAP client certificate validation 490aea2169SPatrick Williams 505c515c21SZhenfei Tai```bash 515c515c21SZhenfei Tai./phosphor-certificate-manager --type=client --endpoint=ldap \ 525c515c21SZhenfei Tai --path=/etc/nslcd/certs/cert.pem 535c515c21SZhenfei Tai``` 545c515c21SZhenfei Tai 555c515c21SZhenfei Tai## D-Bus Interface 560aea2169SPatrick Williams 575c515c21SZhenfei Tai`phosphor-certificate-manager` is an implementation of the D-Bus interface 580aea2169SPatrick Williamsdefined in 590aea2169SPatrick Williams[this document](https://github.com/openbmc/phosphor-dbus-interfaces/blob/a3d0c212a1e734a77fbaf11c7561c59e59d514da/xyz/openbmc_project/Certs/README.md). 605c515c21SZhenfei Tai 615c515c21SZhenfei TaiD-Bus service name is constructed by 620aea2169SPatrick Williams"xyz.openbmc_project.Certs.Manager.{Type}.{Endpoint}" and D-Bus object path is 630aea2169SPatrick Williamsconstructed by "/xyz/openbmc_project/certs/{type}/{endpoint}". 645c515c21SZhenfei Tai 655c515c21SZhenfei TaiTake https certificate management as an example. 660aea2169SPatrick Williams 675c515c21SZhenfei Tai```bash 685c515c21SZhenfei Tai./phosphor-certificate-manager --type=server --endpoint=https \ 695c515c21SZhenfei Tai --path=/etc/ssl/certs/https/server.pem --unit=bmcweb.service 705c515c21SZhenfei Tai``` 710aea2169SPatrick Williams 720aea2169SPatrick WilliamsD-Bus service name is "xyz.openbmc_project.Certs.Manager.Server.Https" and D-Bus 730aea2169SPatrick Williamsobject path is "/xyz/openbmc_project/certs/server/https". 745c515c21SZhenfei Tai 755c515c21SZhenfei Tai## Usage in openbmc/bmcweb 760aea2169SPatrick Williams 770aea2169SPatrick WilliamsOpenBMC [bmcweb](https://github.com/openbmc/bmcweb) exposes various 780aea2169SPatrick Williams[REST APIs](https://github.com/openbmc/bmcweb/blob/master/redfish-core/lib/certificate_service.hpp) 795c515c21SZhenfei Taifor certificate management on the BMC, which leverages functionalities of 805c515c21SZhenfei Tai`phosphor-certificate-manager` via D-Bus. 81