certificate.hpp (e3d47cd468699980157aa901eae269f49b3a0218) | certificate.hpp (698a57435e5fb45b744e3a178f1dc3c7910e20da) |
---|---|
1#pragma once 2 3#include "watch.hpp" 4 5#include <openssl/ossl_typ.h> 6#include <openssl/x509.h> 7 8#include <functional> --- 82 unchanged lines hidden (view full) --- 91 /** @brief Constructor for the Certificate Object 92 * @param[in] bus - Bus to attach to. 93 * @param[in] objPath - Object path to attach to 94 * @param[in] type - Type of the certificate 95 * @param[in] installPath - Path of the certificate to install 96 * @param[in] uploadPath - Path of the certificate file to upload 97 * @param[in] watchPtr - watch on self signed certificate 98 * @param[in] parent - the manager that owns the certificate | 1#pragma once 2 3#include "watch.hpp" 4 5#include <openssl/ossl_typ.h> 6#include <openssl/x509.h> 7 8#include <functional> --- 82 unchanged lines hidden (view full) --- 91 /** @brief Constructor for the Certificate Object 92 * @param[in] bus - Bus to attach to. 93 * @param[in] objPath - Object path to attach to 94 * @param[in] type - Type of the certificate 95 * @param[in] installPath - Path of the certificate to install 96 * @param[in] uploadPath - Path of the certificate file to upload 97 * @param[in] watchPtr - watch on self signed certificate 98 * @param[in] parent - the manager that owns the certificate |
99 * @param[in] restore - the certificate is created in the restore path |
|
99 */ 100 Certificate(sdbusplus::bus_t& bus, const std::string& objPath, 101 CertificateType type, const std::string& installPath, | 100 */ 101 Certificate(sdbusplus::bus_t& bus, const std::string& objPath, 102 CertificateType type, const std::string& installPath, |
102 const std::string& uploadPath, Watch* watch, Manager& parent); | 103 const std::string& uploadPath, Watch* watch, Manager& parent, 104 bool restore); |
103 104 /** @brief Constructor for the Certificate Object; a variant for authorities 105 * list install 106 * @param[in] bus - Bus to attach to. 107 * @param[in] objPath - Object path to attach to 108 * @param[in] type - Type of the certificate 109 * @param[in] installPath - Path of the certificate to install 110 * @param[in] x509Store - an initialized X509 store used for certificate 111 * validation; Certificate object doesn't own it 112 * @param[in] pem - Content of the certificate file to upload; it shall be 113 * a single PEM encoded x509 certificate 114 * @param[in] watchPtr - watch on self signed certificate 115 * @param[in] parent - Pointer to the manager which owns the constructed 116 * Certificate object | 105 106 /** @brief Constructor for the Certificate Object; a variant for authorities 107 * list install 108 * @param[in] bus - Bus to attach to. 109 * @param[in] objPath - Object path to attach to 110 * @param[in] type - Type of the certificate 111 * @param[in] installPath - Path of the certificate to install 112 * @param[in] x509Store - an initialized X509 store used for certificate 113 * validation; Certificate object doesn't own it 114 * @param[in] pem - Content of the certificate file to upload; it shall be 115 * a single PEM encoded x509 certificate 116 * @param[in] watchPtr - watch on self signed certificate 117 * @param[in] parent - Pointer to the manager which owns the constructed 118 * Certificate object |
119 * @param[in] restore - the certificate is created in the restore path |
|
117 */ 118 Certificate(sdbusplus::bus_t& bus, const std::string& objPath, 119 const CertificateType& type, const std::string& installPath, 120 X509_STORE& x509Store, const std::string& pem, Watch* watchPtr, | 120 */ 121 Certificate(sdbusplus::bus_t& bus, const std::string& objPath, 122 const CertificateType& type, const std::string& installPath, 123 X509_STORE& x509Store, const std::string& pem, Watch* watchPtr, |
121 Manager& parent); | 124 Manager& parent, bool restore); |
122 123 /** @brief Validate and Replace/Install the certificate file 124 * Install/Replace the existing certificate file with another 125 * (possibly CA signed) Certificate file. 126 * @param[in] filePath - Certificate file path. | 125 126 /** @brief Validate and Replace/Install the certificate file 127 * Install/Replace the existing certificate file with another 128 * (possibly CA signed) Certificate file. 129 * @param[in] filePath - Certificate file path. |
130 * @param[in] restore - the certificate is created in the restore path |
|
127 */ | 131 */ |
128 void install(const std::string& filePath); | 132 void install(const std::string& filePath, bool restore); |
129 130 /** @brief Validate and Replace/Install the certificate file 131 * Install/Replace the existing certificate file with another 132 * (possibly CA signed) Certificate file. 133 * @param[in] x509Store - an initialized X509 store used for certificate 134 * validation; Certificate object doesn't own it 135 * @param[in] pem - a string buffer which stores a PEM encoded certificate. | 133 134 /** @brief Validate and Replace/Install the certificate file 135 * Install/Replace the existing certificate file with another 136 * (possibly CA signed) Certificate file. 137 * @param[in] x509Store - an initialized X509 store used for certificate 138 * validation; Certificate object doesn't own it 139 * @param[in] pem - a string buffer which stores a PEM encoded certificate. |
140 * @param[in] restore - the certificate is created in the restore path |
|
136 */ | 141 */ |
137 void install(X509_STORE& x509Store, const std::string& pem); | 142 void install(X509_STORE& x509Store, const std::string& pem, bool restore); |
138 139 /** @brief Validate certificate and replace the existing certificate 140 * @param[in] filePath - Certificate file path. 141 */ 142 void replace(const std::string filePath) override; 143 144 /** @brief Populate certificate properties by parsing certificate file 145 */ --- 169 unchanged lines hidden --- | 143 144 /** @brief Validate certificate and replace the existing certificate 145 * @param[in] filePath - Certificate file path. 146 */ 147 void replace(const std::string filePath) override; 148 149 /** @brief Populate certificate properties by parsing certificate file 150 */ --- 169 unchanged lines hidden --- |