Name Date Size #Lines LOC

..Today-

bmc-vmi-ca/H11-Oct-2023-290193

dist/H31-Aug-2023-148121

subprojects/H29-Mar-2022-3223

test/H31-Aug-2023-2,1521,765

.clang-formatH A D25-Oct-20233.6 KiB136134

.clang-tidyH A D22-Sep-2022731 1714

.gitignoreH A D29-Mar-2022182 87

.openbmc-enforce-gitlintH A D19-Sep-20220

LICENSEH A D07-Mar-202111.1 KiB202169

OWNERSH A D02-Dec-20231.9 KiB6156

README.mdH A D31-Aug-20232.5 KiB8157

argument.cppH A D22-Sep-20221 KiB3328

argument.hppH A D29-Mar-2022487 2013

certificate.cppH A D11-Oct-202322.1 KiB714577

certificate.hppH A D11-May-202310.7 KiB321115

certs_manager.cppH A D25-Mar-202436.7 KiB1,139974

certs_manager.hppH A D11-May-202314.1 KiB346110

config.h.inH A D10-May-20231,014 2718

csr.cppH A D11-Oct-20232.4 KiB8873

csr.hppH A D11-May-20231.3 KiB5834

mainapp.cppH A D11-May-20232.2 KiB7544

meson.buildH A D22-Jul-20232.1 KiB10185

meson.optionsH A D31-Aug-2023742 3528

watch.cppH A D25-Oct-20232.8 KiB117102

watch.hppH A D11-May-20231.8 KiB7231

x509_utils.cppH A D11-Oct-20238.3 KiB263213

x509_utils.hppH A D24-Mar-20222 KiB6717

README.md

1# phosphor-certificate-manager
2
3Certificate management allows to replace the existing certificate and private
4key file with another (possibly CA signed) Certificate key file. Certificate
5management allows the user to install both the server and client certificates.
6
7## To Build
8
9This project can be built with `meson`. The typical `meson` workflow is:
10`meson builddir && ninja -C builddir`.
11
12## To Run
13
14Multiple instances of `phosphor-certificate-manager` are usually run on the bmc
15to support management of different types of certificates.
16
17```text
18Usage: ./phosphor-certificate-manager [options]
19Options:
20    --help            Print this menu
21    --type            certificate type
22                      Valid types: client,server,authority
23    --endpoint        d-bus endpoint
24    --path            certificate file path
25    --unit=<name>     Optional systemd unit need to reload
26```
27
28### Https certificate management
29
30**Purpose:** Server https certificate
31
32```bash
33./phosphor-certificate-manager --type=server --endpoint=https \
34    --path=/etc/ssl/certs/https/server.pem --unit=bmcweb.service
35```
36
37### CA certificate management
38
39**Purpose:** Client certificate validation
40
41```bash
42./phosphor-certificate-manager --type=authority --endpoint=truststore \
43    --path=/etc/ssl/certs/authority --unit=bmcweb.service
44```
45
46### LDAP client certificate management
47
48**Purpose:** LDAP client certificate validation
49
50```bash
51./phosphor-certificate-manager --type=client --endpoint=ldap \
52    --path=/etc/nslcd/certs/cert.pem
53```
54
55## D-Bus Interface
56
57`phosphor-certificate-manager` is an implementation of the D-Bus interface
58defined in
59[this document](https://github.com/openbmc/phosphor-dbus-interfaces/blob/a3d0c212a1e734a77fbaf11c7561c59e59d514da/xyz/openbmc_project/Certs/README.md).
60
61D-Bus service name is constructed by
62"xyz.openbmc_project.Certs.Manager.{Type}.{Endpoint}" and D-Bus object path is
63constructed by "/xyz/openbmc_project/certs/{type}/{endpoint}".
64
65Take https certificate management as an example.
66
67```bash
68./phosphor-certificate-manager --type=server --endpoint=https \
69    --path=/etc/ssl/certs/https/server.pem --unit=bmcweb.service
70```
71
72D-Bus service name is "xyz.openbmc_project.Certs.Manager.Server.Https" and D-Bus
73object path is "/xyz/openbmc_project/certs/server/https".
74
75## Usage in openbmc/bmcweb
76
77OpenBMC [bmcweb](https://github.com/openbmc/bmcweb) exposes various
78[REST APIs](https://github.com/openbmc/bmcweb/blob/master/redfish-core/lib/certificate_service.hpp)
79for certificate management on the BMC, which leverages functionalities of
80`phosphor-certificate-manager` via D-Bus.
81