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