Vanetza
 
Loading...
Searching...
No Matches
vanetza::security::BackendOpenSsl Class Reference

Backend implementation based on OpenSSL. More...

#include <backend_openssl.hpp>

Inheritance diagram for vanetza::security::BackendOpenSsl:

Public Member Functions

EcdsaSignature sign_data (const ecdsa256::PrivateKey &private_key, const ByteBuffer &data_buffer) override
 
bool verify_data (const ecdsa256::PublicKey &public_key, const ByteBuffer &data, const EcdsaSignature &sig) override
 
bool verify_digest (const PublicKey &, const ByteBuffer &digest, const Signature &) override
 
ByteBuffer calculate_hash (KeyType, const ByteBuffer &) override
 
boost::optional< Uncompresseddecompress_point (const EccPoint &ecc_point) override
 

Static Public Attributes

static constexpr auto backend_name = "OpenSSL"
 

Private Member Functions

std::array< uint8_t, 32 > calculate_sha256_digest (const ByteBuffer &data) const
 calculate SHA256 digest of data buffer
 
std::array< uint8_t, 48 > calculate_sha384_digest (const ByteBuffer &data) const
 calculate SHA384 digest of data buffer
 
openssl::Key internal_private_key (const ecdsa256::PrivateKey &) const
 convert to internal format of private key
 
openssl::Key internal_public_key (const ecdsa256::PublicKey &) const
 convert to internal format of public key
 
openssl::Key internal_public_key (const PublicKey &) const
 
openssl::Point internal_ec_point (const PublicKey &) const
 convert to internal format of an EC point
 

Detailed Description

Backend implementation based on OpenSSL.

Definition at line 25 of file backend_openssl.hpp.

Constructor & Destructor Documentation

◆ BackendOpenSsl()

vanetza::security::BackendOpenSsl::BackendOpenSsl ( )

Definition at line 43 of file backend_openssl.cpp.

Member Function Documentation

◆ calculate_hash()

ByteBuffer vanetza::security::BackendOpenSsl::calculate_hash ( KeyType  key,
const ByteBuffer &  data 
)
overridevirtual

Implements vanetza::security::Backend.

Definition at line 175 of file backend_openssl.cpp.

◆ calculate_sha256_digest()

std::array< uint8_t, 32 > vanetza::security::BackendOpenSsl::calculate_sha256_digest ( const ByteBuffer &  data) const
private

calculate SHA256 digest of data buffer

Definition at line 197 of file backend_openssl.cpp.

◆ calculate_sha384_digest()

std::array< uint8_t, 48 > vanetza::security::BackendOpenSsl::calculate_sha384_digest ( const ByteBuffer &  data) const
private

calculate SHA384 digest of data buffer

Definition at line 209 of file backend_openssl.cpp.

◆ decompress_point()

boost::optional< Uncompressed > vanetza::security::BackendOpenSsl::decompress_point ( const EccPoint &  ecc_point)
overridevirtual
See also
Backend::decompress_point

Implements vanetza::security::Backend.

Definition at line 111 of file backend_openssl.cpp.

◆ internal_ec_point()

openssl::Point vanetza::security::BackendOpenSsl::internal_ec_point ( const PublicKey generic) const
private

convert to internal format of an EC point

Definition at line 256 of file backend_openssl.cpp.

◆ internal_private_key()

openssl::Key vanetza::security::BackendOpenSsl::internal_private_key ( const ecdsa256::PrivateKey generic) const
private

convert to internal format of private key

Definition at line 218 of file backend_openssl.cpp.

◆ internal_public_key() [1/2]

openssl::Key vanetza::security::BackendOpenSsl::internal_public_key ( const ecdsa256::PublicKey generic) const
private

convert to internal format of public key

Definition at line 235 of file backend_openssl.cpp.

◆ internal_public_key() [2/2]

openssl::Key vanetza::security::BackendOpenSsl::internal_public_key ( const PublicKey generic) const
private

Definition at line 246 of file backend_openssl.cpp.

◆ sign_data()

EcdsaSignature vanetza::security::BackendOpenSsl::sign_data ( const ecdsa256::PrivateKey private_key,
const ByteBuffer &  data_buffer 
)
overridevirtual
See also
Backend::sign_data

Implements vanetza::security::Backend.

Definition at line 52 of file backend_openssl.cpp.

◆ verify_data()

bool vanetza::security::BackendOpenSsl::verify_data ( const ecdsa256::PublicKey public_key,
const ByteBuffer &  data,
const EcdsaSignature sig 
)
overridevirtual
See also
Backend::verify_data

Implements vanetza::security::Backend.

Definition at line 91 of file backend_openssl.cpp.

◆ verify_digest()

bool vanetza::security::BackendOpenSsl::verify_digest ( const PublicKey gpub,
const ByteBuffer &  digest,
const Signature gsig 
)
overridevirtual
See also
Backend::verify_digest

Implements vanetza::security::Backend.

Definition at line 100 of file backend_openssl.cpp.

Member Data Documentation

◆ backend_name

constexpr auto vanetza::security::BackendOpenSsl::backend_name = "OpenSSL"
staticconstexpr

Definition at line 28 of file backend_openssl.hpp.


The documentation for this class was generated from the following files: