Vanetza
Loading...
Searching...
No Matches
certificate_provider.hpp
1#pragma once
2#include <vanetza/security/private_key.hpp>
3#include <vanetza/security/v3/certificate.hpp>
4#include <vanetza/security/v3/certificate_cache.hpp>
5
6namespace vanetza
7{
8namespace security
9{
10namespace v3
11{
12
14{
15public:
16 /**
17 * Get own certificate to use for signing
18 * \return own certificate
19 */
20 virtual const Certificate& own_certificate() = 0;
21
22 /**
23 * Get private key associated with own certificate
24 * \return private key
25 */
26 virtual const PrivateKey& own_private_key() = 0;
27
28 /**
29 * Get certificate cache
30 * \return certificate cache
31 */
32 virtual CertificateCache& cache() = 0;
33 virtual const CertificateCache& cache() const = 0;
34
35 virtual ~CertificateProvider() = default;
36};
37
39{
40public:
41 const CertificateCache& cache() const override { return m_cache; }
42 CertificateCache& cache() override { return m_cache; }
43
44private:
45 CertificateCache m_cache;
46};
47
48} // namespace v3
49} // namespace security
50} // namespace vanetza
virtual CertificateCache & cache()=0
virtual const PrivateKey & own_private_key()=0
virtual const Certificate & own_certificate()=0