diff --git a/include/ocpp/common/evse_security.hpp b/include/ocpp/common/evse_security.hpp index 5fdd35a2b..ef00d965b 100644 --- a/include/ocpp/common/evse_security.hpp +++ b/include/ocpp/common/evse_security.hpp @@ -108,6 +108,11 @@ class EvseSecurity { /// \brief Retrieves the PEM formatted CA bundle file for the given \p certificate_type /// \param certificate_type /// \return CA certificate file + virtual std::string get_verify_file(const CaCertificateType& certificate_type) = 0; + + /// \brief Retrieves the PEM formatted CA bundle location for the given \p certificate_type + /// \param certificate_type + /// \return CA certificate file virtual std::string get_verify_location(const CaCertificateType& certificate_type) = 0; /// \brief Gets the expiry day count for the leaf certificate of the given \p certificate_type diff --git a/include/ocpp/common/evse_security_impl.hpp b/include/ocpp/common/evse_security_impl.hpp index f3c20b40d..05c59a6a7 100644 --- a/include/ocpp/common/evse_security_impl.hpp +++ b/include/ocpp/common/evse_security_impl.hpp @@ -55,6 +55,7 @@ class EvseSecurityImpl : public EvseSecurity { GetCertificateInfoResult get_leaf_certificate_info(const CertificateSigningUseEnum& certificate_type, bool include_ocsp = false) override; bool update_certificate_links(const CertificateSigningUseEnum& certificate_type) override; + std::string get_verify_file(const CaCertificateType& certificate_type) override; std::string get_verify_location(const CaCertificateType& certificate_type) override; int get_leaf_expiry_days_count(const CertificateSigningUseEnum& certificate_type) override; }; diff --git a/lib/ocpp/common/evse_security_impl.cpp b/lib/ocpp/common/evse_security_impl.cpp index 596f93211..cd717f7a3 100644 --- a/lib/ocpp/common/evse_security_impl.cpp +++ b/lib/ocpp/common/evse_security_impl.cpp @@ -130,6 +130,10 @@ bool EvseSecurityImpl::update_certificate_links(const CertificateSigningUseEnum& return this->evse_security->update_certificate_links(conversions::from_ocpp(certificate_type)); } +std::string EvseSecurityImpl::get_verify_file(const CaCertificateType& certificate_type) { + return this->evse_security->get_verify_file(conversions::from_ocpp(certificate_type)); +} + std::string EvseSecurityImpl::get_verify_location(const CaCertificateType& certificate_type) { return this->evse_security->get_verify_location(conversions::from_ocpp(certificate_type)); } diff --git a/tests/lib/ocpp/common/evse_security_mock.hpp b/tests/lib/ocpp/common/evse_security_mock.hpp index fa4555a6f..50568360a 100644 --- a/tests/lib/ocpp/common/evse_security_mock.hpp +++ b/tests/lib/ocpp/common/evse_security_mock.hpp @@ -32,6 +32,7 @@ class EvseSecurityMock : public EvseSecurity { MOCK_METHOD(GetCertificateInfoResult, get_leaf_certificate_info, (const CertificateSigningUseEnum&, bool), (override)); MOCK_METHOD(bool, update_certificate_links, (const CertificateSigningUseEnum&), (override)); + MOCK_METHOD(std::string, get_verify_file, (const CaCertificateType&), (override)); MOCK_METHOD(std::string, get_verify_location, (const CaCertificateType&), (override)); MOCK_METHOD(int, get_leaf_expiry_days_count, (const CertificateSigningUseEnum&), (override)); };