Vanetza
 
Loading...
Searching...
No Matches
subject_info.hpp
1#ifndef SUBJECT_INFO_HPP_WCKSWSKY
2#define SUBJECT_INFO_HPP_WCKSWSKY
3
4#include <vanetza/security/v2/serialization.hpp>
5#include <vanetza/common/byte_buffer.hpp>
6#include <array>
7#include <cstdint>
8
9namespace vanetza
10{
11namespace security
12{
13namespace v2
14{
15
16/// described in TS 103 097 v1.2.1, section 6.3
17enum class SubjectType : uint8_t
18{
19 Enrollment_Credential = 0,
20 Authorization_Ticket = 1,
21 Authorization_Authority = 2,
22 Enrollment_Authority = 3,
23 Root_CA = 4,
24 CRL_Signer = 5
25};
26
27/// described in TS 103 097 v1.2.1, section 6.2
29{
30 SubjectType subject_type;
31 ByteBuffer subject_name;
32};
33
34/**
35 * \brief Serializes a SubjectInfo into a binary archive
36 */
37void serialize(OutputArchive&, const SubjectInfo&);
38
39/**
40 * \brief Deserializes a SubjectInfo from a binary archive
41 * \param archive with a serialized SubjectInfo at the beginning
42 * \param SubjectInfo
43 * \return size of the deserialized SubjectInfo
44 */
45size_t deserialize(InputArchive&, SubjectInfo&);
46
47/**
48 * \brief Calculates size of a SubjectInfo
49 * \param SubjectInfo
50 * \return number of octets needed to serialize SubjectInfo
51 */
52size_t get_size(const SubjectInfo&);
53
54} // namespace v2
55} // namespace security
56} // namespace vanetza
57
58#endif /* SUBJECT_INFO_HPP_WCKSWSKY */
described in TS 103 097 v1.2.1, section 6.2