Vanetza
 
Loading...
Searching...
No Matches
static_certificate_provider.hpp
1#ifndef STATIC_CERTIFICATE_PROVIDER_HPP_MTULFLKX
2#define STATIC_CERTIFICATE_PROVIDER_HPP_MTULFLKX
3
4#include <vanetza/security/v2/certificate_provider.hpp>
5
6namespace vanetza
7{
8namespace security
9{
10namespace v2
11{
12
13/**
14 * \brief A simple certificate provider
15 *
16 * This certificate provider uses a static certificate and key pair that is pre-generated.
17 */
19{
20public:
21 /**
22 * Create static certificate provider with empty chain
23 * \param authorization_ticket
24 * \param ticket_key private key of given authorization ticket
25 */
26 StaticCertificateProvider(const Certificate& authorization_ticket, const ecdsa256::PrivateKey& ticket_key);
27
28 /**
29 * Create static certificate provider with given chain
30 * \param authorization_ticket
31 * \param ticket_key private key of given authorization ticket
32 * \param chain own certificate chain
33 */
34 StaticCertificateProvider(const Certificate& authorization_ticket, const ecdsa256::PrivateKey& ticket_key,
35 const std::list<Certificate>& chain);
36
37 /**
38 * Get own certificate to use for signing
39 * \return own certificate
40 */
41 virtual const Certificate& own_certificate() override;
42
43 /**
44 * Get own certificate chain, excluding the leaf certificate and root CA
45 * \return own certificate chain
46 */
47 virtual std::list<Certificate> own_chain() override;
48
49 /**
50 * Get private key associated with own certificate
51 * \return private key
52 */
53 virtual const ecdsa256::PrivateKey& own_private_key() override;
54
55private:
56 Certificate authorization_ticket;
57 ecdsa256::PrivateKey authorization_ticket_key;
58 std::list<Certificate> chain;
59};
60
61} // namespace v2
62} // namespace security
63} // namespace vanetza
64
65#endif /* STATIC_CERTIFICATE_PROVIDER_HPP_MTULFLKX */
virtual const Certificate & own_certificate() override
virtual const ecdsa256::PrivateKey & own_private_key() override
virtual std::list< Certificate > own_chain() override
described in TS 103 097 v1.2.1 (2015-06), section 6.1
Definition: certificate.hpp:28