#pragma once

#include <vector>

#include "ec_keys.hh"

/*!
 * \class security_db_record
 * \brief This class provides security record description for security database
 */
class security_db_record {
  
  ec_elliptic_curves _algorithm;
  std::string _certificate_id;                    /*!< certificate storage*/
  std::vector<unsigned char> _certificate;        /*!< Certificate storage */
  std::vector<unsigned char> _hashed_id_issuer;   /*!< Certificate hash id 8 storage */
  std::vector<unsigned char> _hashed_id;          /*!< Certificate hash id 8 storage */
  std::vector<unsigned char> _pr_key;             /*!< Private key storage */
  std::vector<unsigned char> _pu_key_x;           /*!< Public key X storage */
  std::vector<unsigned char> _pu_key_y;           /*!< Public key Y storage */
  
public: /*! \publicsection */
  /*!
   * \brief Default private ctor
   */
  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() { };
  
  security_db_record(
                     const std::string& p_certificate_id,
                     const std::vector<unsigned char>& p_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
                     ): _algorithm{ec_elliptic_curves::nist_p_256}, _certificate_id(p_certificate_id), _certificate(p_certificate), _hashed_id_issuer(p_hashed_id_issuer), _hashed_id(p_hashed_id), _pr_key(p_pr_key), _pu_key_x(p_pu_key_x), _pu_key_y(p_pu_key_y) { };
  
  /*!
   * \brief Default private dtor
   */
  ~security_db_record() { };

  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>& hashed_id_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; };
}; // End of class security_db_record
