3#ifndef OCPP_COMMON_EVSE_SECURITY
4#define OCPP_COMMON_EVSE_SECURITY
11#include <ocpp/common/types.hpp>
12#include <ocpp/v2/ocpp_types.hpp>
26 const CaCertificateType& certificate_type) = 0;
42 const CertificateSigningUseEnum& certificate_type) = 0;
50 const LeafCertificateType& certificate_type) = 0;
57 virtual std::vector<CertificateHashDataChain>
75 const std::string& ocsp_response) = 0;
92 const std::string& organization,
const std::string& common,
bool use_tpm) = 0;
103 bool include_ocsp =
false) = 0;
124namespace evse_security_conversions {
128ocpp::v2::GetCertificateIdUseEnum to_ocpp_v2(ocpp::CertificateType other);
129ocpp::v2::InstallCertificateUseEnum to_ocpp_v2(ocpp::CaCertificateType other);
130ocpp::v2::HashAlgorithmEnum to_ocpp_v2(ocpp::HashAlgorithmEnumType other);
131ocpp::v2::InstallCertificateStatusEnum to_ocpp_v2(ocpp::InstallCertificateResult other);
132ocpp::v2::DeleteCertificateStatusEnum to_ocpp_v2(ocpp::DeleteCertificateResult other);
137std::vector<ocpp::v2::OCSPRequestData> to_ocpp_v2(
const std::vector<ocpp::OCSPRequestData>& ocsp_request_data);
139ocpp::CertificateType from_ocpp_v2(ocpp::v2::GetCertificateIdUseEnum other);
140std::vector<ocpp::CertificateType> from_ocpp_v2(
const std::vector<ocpp::v2::GetCertificateIdUseEnum>& other);
141ocpp::CaCertificateType from_ocpp_v2(ocpp::v2::InstallCertificateUseEnum other);
142ocpp::CertificateSigningUseEnum from_ocpp_v2(ocpp::v2::CertificateSigningUseEnum other);
143ocpp::HashAlgorithmEnumType from_ocpp_v2(ocpp::v2::HashAlgorithmEnum other);
144ocpp::InstallCertificateResult from_ocpp_v2(ocpp::v2::InstallCertificateStatusEnum other);
145ocpp::DeleteCertificateResult from_ocpp_v2(ocpp::v2::DeleteCertificateStatusEnum other);
Handler for security related operations of the charging station.
Definition: evse_security.hpp:17
virtual std::vector< CertificateHashDataChain > get_installed_certificates(const std::vector< CertificateType > &certificate_types)=0
Retrieves all certificates installed on the filesystem applying the certificate_types filter....
virtual GetCertificateSignRequestResult generate_certificate_signing_request(const CertificateSigningUseEnum &certificate_type, const std::string &country, const std::string &organization, const std::string &common, bool use_tpm)=0
Generates a certificate signing request for the given certificate_type , country ,...
virtual std::vector< OCSPRequestData > get_mo_ocsp_request_data(const std::string &certificate_chain)=0
Retrieves the OCSP request data of a certificate chain.
virtual std::vector< OCSPRequestData > get_v2g_ocsp_request_data()=0
Retrieves the OCSP request data of the V2G certificates (exluding the root). This function respects t...
virtual bool update_certificate_links(const CertificateSigningUseEnum &certificate_type)=0
Updates the certificate and key links for the given certificate_type.
virtual int get_leaf_expiry_days_count(const CertificateSigningUseEnum &certificate_type)=0
Gets the expiry day count for the leaf certificate of the given certificate_type.
virtual bool is_ca_certificate_installed(const CaCertificateType &certificate_type)=0
Indicates if a CA certificate for the given certificate_type is installed on the filesystem.
virtual GetCertificateInfoResult get_leaf_certificate_info(const CertificateSigningUseEnum &certificate_type, bool include_ocsp=false)=0
Searches the filesystem on the specified directories for the given certificate_type and retrieves the...
virtual std::string get_verify_file(const CaCertificateType &certificate_type)=0
Retrieves the PEM formatted CA bundle file for the given certificate_type.
virtual void update_ocsp_cache(const CertificateHashDataType &certificate_hash_data, const std::string &ocsp_response)=0
Updates the OCSP cache for the given certificate_hash_data with the given ocsp_response.
virtual DeleteCertificateResult delete_certificate(const CertificateHashDataType &certificate_hash_data)=0
Deletes the certificate specified by certificate_hash_data . This function respects the requirements ...
virtual CertificateValidationResult verify_certificate(const std::string &certificate_chain, const LeafCertificateType &certificate_type)=0
Verifies the given certificate_chain for the given certificate_type against the respective CA certifi...
virtual InstallCertificateResult update_leaf_certificate(const std::string &certificate_chain, const CertificateSigningUseEnum &certificate_type)=0
Verifies the given certificate_chain for the given certificate_type using the respective CA certifica...
virtual InstallCertificateResult install_ca_certificate(const std::string &certificate, const CaCertificateType &certificate_type)=0
Installs the CA certificate for the given certificate_type . This function respects the requirements ...
virtual std::string get_verify_location(const CaCertificateType &certificate_type)=0
Retrieves the PEM formatted CA bundle location for the given certificate_type.
Definition: types.hpp:596
Definition: types.hpp:558
Definition: types.hpp:696
Definition: types.hpp:677
Struct for OCSPRequestData.
Definition: types.hpp:654
Definition: ocpp_types.hpp:271
Definition: ocpp_types.hpp:202
Definition: ocpp_types.hpp:52