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
Signature sign_digest (const PrivateKey &, const ByteBuffer &digest) 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 (HashAlgorithm, const ByteBuffer &) override
 calculate hash value of data
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_private_key (const PrivateKey &) const
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 ( HashAlgorithm algo,
const ByteBuffer & data )
overridevirtual

calculate hash value of data

Parameters
algohash algorithm
databuffer with data
Returns
buffer containing calculated hash value

Implements vanetza::security::Backend.

Definition at line 211 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 224 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 236 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 147 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 300 of file backend_openssl.cpp.

◆ internal_private_key() [1/2]

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

convert to internal format of private key

Definition at line 245 of file backend_openssl.cpp.

◆ internal_private_key() [2/2]

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

Definition at line 262 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 279 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 290 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.

◆ sign_digest()

Signature vanetza::security::BackendOpenSsl::sign_digest ( const PrivateKey & key,
const ByteBuffer & digest )
overridevirtual
See also
Backend::sign_digest

Implements vanetza::security::Backend.

Definition at line 91 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 127 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 136 of file backend_openssl.cpp.

Member Data Documentation

◆ backend_name

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: