Files
MicrOBU/obu-firmware/external/vanetza-idf/vanetza/security/v2/persistence.hpp
T
Ashin Walpola d107534eb2 Keep vanetza-idf in obu-firmware, so a plain clone builds the firmware
obu-firmware builds against the vanetza-idf C-ITS library, which until now
came from the colleague's microbu-esp32c5 tree beside the repository and was
not tracked here, so a clone of this repository could not build the firmware
it ships. The library alone is now part of obu-firmware, as
obu-firmware/external/vanetza-idf: their external/vanetza-idf at commit
cf4b99f, unchanged (9775 files; see its PROVENANCE.md). CMake takes it from
there by default; -DVANETZA_IDF_DIR still points the build elsewhere.

The rest of the colleague's tree (their own VAM firmware, PKI tooling,
station-link Python tools, the V2X2MAP bridge) stays out of this repository
and gitignored; nothing is pushed to their repository. NOTES.md, docs/06,
TODO.md and the pcap verifier's usage line point at the new location.
2026-09-24 10:56:05 +02:00

64 lines
1.7 KiB
C++

#ifndef VANETZA_SECURITY_PERSISTENCE_HPP
#define VANETZA_SECURITY_PERSISTENCE_HPP
#include <vanetza/security/ecdsa256.hpp>
#include <vanetza/security/v2/certificate.hpp>
#include <vanetza/security/v2/public_key.hpp>
#include <iosfwd>
namespace vanetza
{
namespace security
{
namespace v2
{
/**
* \brief Loads a private key from a file
* \param key_path file to load the key from
* \return loaded key
*/
ecdsa256::KeyPair load_private_key_from_file(const std::string& key_path);
/**
* \brief Save a private key pair to a stream in PKCS#8 DER format (secp256r1)
* \param os destination stream
* \param key_pair key pair to be stored
* \return true if successfully written
*/
bool save_private_key_pkcs8_der(std::ostream& os, const ecdsa256::KeyPair& key_pair);
/**
* \brief Loads a public key from a file
* \param key_path file to load the key from
* \return loaded key
*/
PublicKey load_public_key_from_file(const std::string& key_path);
/**
* \brief Saves a public key to a file
* \param key_path file to save the key to
* \param public_key key to save
*/
void save_public_key_to_file(const std::string& key_path, const PublicKey& public_key);
/**
* \brief Loads a certificate from a file
* \param certificate_path file to load the certificate from
* \return loaded certificate
*/
Certificate load_certificate_from_file(const std::string& certificate_path);
/**
* \brief Saves a certificate to a file
* \param certificate_path file to save the certificate to
* \param certificate certificate to save
*/
void save_certificate_to_file(const std::string& certificate_path, const Certificate& certificate);
} // namespace v2
} // namespace security
} // namespace vanetza
#endif /* VANETZA_SECURITY_PERSISTENCE_HPP */