security_db_record.hh
Go to the documentation of this file.
#pragma once
#include <string>
#include <vector>
#include "security_ecc.hh"
namespace IEEE1609dot2 {
class CertificateBase;
};
class security_db_record {
ec_elliptic_curves _algorithm;
std::string _certificate_id;
std::vector<unsigned char> _certificate;
std::vector<unsigned char> _hashed_id_issuer;
std::vector<unsigned char> _hashed_id;
std::vector<unsigned char> _pr_key;
std::vector<unsigned char> _pu_key_x;
std::vector<unsigned char> _pu_key_y;
std::vector<unsigned char> _pr_enc_key;
std::vector<unsigned char> _pu_enc_key_x;
std::vector<unsigned char> _pu_enc_key_y;
bool _to_be_saved;
IEEE1609dot2::CertificateBase* _decoded_certificate;
public:
explicit security_db_record(): _algorithm{ec_elliptic_curves::nist_p_256}, _certificate_id(), _certificate(), _hashed_id_issuer(), _hashed_id(), _pr_key(), _pu_key_x(), _pu_key_y(), _pr_enc_key(), _pu_enc_key_x(), _pu_enc_key_y(), _to_be_saved(false), _decoded_certificate(nullptr) { };
security_db_record(const std::string& p_certificate_id, const std::vector<unsigned char>& p_certificate, const IEEE1609dot2::CertificateBase& p_decoded_certificate, const std::vector<unsigned char>& p_hashed_id_issuer, const std::vector<unsigned char>& p_hashed_id, const std::vector<unsigned char>& p_pr_key, const std::vector<unsigned char>& p_pu_key_x, const std::vector<unsigned char>& p_pu_key_y, const std::vector<unsigned char>& p_pr_enc_key, const std::vector<unsigned char>& p_pu_enc_key_x, const std::vector<unsigned char>& p_pu_enc_key_y, const bool p_to_be_saved = true);
~security_db_record() { if (_decoded_certificate != nullptr) { delete _decoded_certificate; } };
const IEEE1609dot2::CertificateBase& decoded_certificate() const;
inline const std::string& certificate_id() const { return _certificate_id; };
inline const std::vector<unsigned char>& certificate() const { return _certificate; };
inline const std::vector<unsigned char>& hashed_id() const { return _hashed_id; };
inline const std::vector<unsigned char>& issuer() const { return _hashed_id_issuer; };
inline const std::vector<unsigned char>& private_key() const { return _pr_key; };
inline const std::vector<unsigned char>& public_key_x() const { return _pu_key_x; };
inline const std::vector<unsigned char>& public_key_y() const { return _pu_key_y; };
inline const std::vector<unsigned char>& private_enc_key() const { return _pr_enc_key; };
inline const std::vector<unsigned char>& public_enc_key_x() const { return _pu_enc_key_x; };
inline const std::vector<unsigned char>& public_enc_key_y() const { return _pu_enc_key_y; };
}; // End of class security_db_record
security_db_record::_to_be_saved
bool _to_be_saved
Definition: security_db_record.hh:29
security_db_record::_decoded_certificate
IEEE1609dot2::CertificateBase * _decoded_certificate
Definition: security_db_record.hh:30
security_db_record::_certificate
std::vector< unsigned char > _certificate
Definition: security_db_record.hh:20
security_db_record::_hashed_id_issuer
std::vector< unsigned char > _hashed_id_issuer
Definition: security_db_record.hh:21
security_db_record::_algorithm
ec_elliptic_curves _algorithm
Definition: security_db_record.hh:18
security_db_record::_pu_enc_key_y
std::vector< unsigned char > _pu_enc_key_y
Definition: security_db_record.hh:28
security_db_record::_pu_key_y
std::vector< unsigned char > _pu_key_y
Definition: security_db_record.hh:25
security_db_record::security_db_record
security_db_record()
Default private ctor.
Definition: security_db_record.hh:36
ec_elliptic_curves::nist_p_256
security_db_record::issuer
const std::vector< unsigned char > & issuer() const
Definition: security_db_record.hh:49
security_db_record::public_enc_key_y
const std::vector< unsigned char > & public_enc_key_y() const
Definition: security_db_record.hh:55
security_db_record::_pr_key
std::vector< unsigned char > _pr_key
Definition: security_db_record.hh:23
IEEE1609dot2
Definition: security_db_record.hh:8
security_db_record::~security_db_record
~security_db_record()
Default private dtor.
Definition: security_db_record.hh:42
security_db_record::public_key_y
const std::vector< unsigned char > & public_key_y() const
Definition: security_db_record.hh:52
security_db_record
This class provides security record description for security database.
Definition: security_db_record.hh:16
ec_elliptic_curves
ec_elliptic_curves
Definition: security_ecc.hh:23
security_ecc.hh
Header file for Elliptic Curve Cryptography.
security_db_record::_pu_enc_key_x
std::vector< unsigned char > _pu_enc_key_x
Definition: security_db_record.hh:27
security_db_record::_hashed_id
std::vector< unsigned char > _hashed_id
Definition: security_db_record.hh:22
security_db_record::public_key_x
const std::vector< unsigned char > & public_key_x() const
Definition: security_db_record.hh:51
security_db_record::certificate
const std::vector< unsigned char > & certificate() const
Definition: security_db_record.hh:47
security_db_record::_certificate_id
std::string _certificate_id
Definition: security_db_record.hh:19
security_db_record::hashed_id
const std::vector< unsigned char > & hashed_id() const
Definition: security_db_record.hh:48
security_db_record::_pu_key_x
std::vector< unsigned char > _pu_key_x
Definition: security_db_record.hh:24
security_db_record::certificate_id
const std::string & certificate_id() const
Definition: security_db_record.hh:46
security_db_record::public_enc_key_x
const std::vector< unsigned char > & public_enc_key_x() const
Definition: security_db_record.hh:54
security_db_record::_pr_enc_key
std::vector< unsigned char > _pr_enc_key
Definition: security_db_record.hh:26
security_db_record::private_enc_key
const std::vector< unsigned char > & private_enc_key() const
Definition: security_db_record.hh:53
security_db_record::private_key
const std::vector< unsigned char > & private_key() const
Definition: security_db_record.hh:50