Vanetza
Loading...
Searching...
No Matches
persistence.hpp
1#pragma once
2#include <vanetza/security/ecdsa256.hpp>
3#include <vanetza/security/v3/certificate.hpp>
4#include <vanetza/security/v2/public_key.hpp>
5
6namespace vanetza
7{
8namespace security
9{
10namespace v3
11{
12
13/**
14 * \brief Loads a private key from a file
15 * \param key_path file to load the key from
16 * \return loaded key
17 */
18ecdsa256::KeyPair load_private_key_from_file(const std::string& key_path);
19
20/**
21 * \brief Loads a public key from a file
22 * \param key_path file to load the key from
23 * \return loaded key
24 */
25v2::PublicKey load_public_key_from_file(const std::string& key_path);
26
27/**
28 * \brief Saves a public key to a file
29 * \param key_path file to save the key to
30 * \param public_key key to save
31 */
32void save_public_key_to_file(const std::string& key_path, const v2::PublicKey& public_key);
33
34/**
35 * \brief Loads a certificate from a file
36 * \param certificate_path file to load the certificate from
37 * \return loaded certificate
38 */
39Certificate load_certificate_from_file(const std::string& certificate_path);
40
41/**
42 * \brief Saves a certificate to a file
43 * \param certificate_path file to save the certificate to
44 * \param certificate certificate to save
45 */
46void save_certificate_to_file(const std::string& certificate_path, const Certificate& certificate);
47
48} // namespace v3
49} // namespace security
50} // namespace vanetza
51