obu-firmware builds against vanetza-idf from microbu-esp32c5/external, but that tree was gitignored, so a clone of this repository could not build the firmware it ships. It is now committed here as ordinary files in its own folder, microbu-esp32c5/: the colleague's commit cf4b99f plus the V2X2MAP bridge's signature verification (--trust) used on the bench. Nothing is fetched from or pushed to the colleague's repository; this repository and its remotes carry everything. The folder's own .gitignore keeps build output, downloaded components and private key material out, as it did there; the committed file set is identical to that repository's tracked files. The ESP32-C5 is still flashed from obu-firmware/, which only takes vanetza-idf from microbu-esp32c5/, so the two stay separate folders. FLASHING.md says how to take a newer version of the colleague's tree (copy it over the folder, rebuild, test, commit).
52 lines
1.4 KiB
C++
52 lines
1.4 KiB
C++
#pragma once
|
|
|
|
#include <vanetza/common/byte_buffer.hpp>
|
|
#include <vanetza/security/key_type.hpp>
|
|
#include <vanetza/security/private_key.hpp>
|
|
#include <vanetza/security/public_key.hpp>
|
|
#include <vanetza/security/signature.hpp>
|
|
|
|
// forward declarations
|
|
struct Vanetza_Security_Signature;
|
|
struct Vanetza_Security_PublicVerificationKey;
|
|
struct Vanetza_Security_PublicEncryptionKey;
|
|
|
|
namespace vanetza
|
|
{
|
|
namespace pki
|
|
{
|
|
|
|
using security::KeyCompression;
|
|
using security::KeyType;
|
|
using security::PrivateKey;
|
|
using security::PublicKey;
|
|
using security::Signature;
|
|
|
|
PublicKey derive_public_key(const PrivateKey&);
|
|
Signature make_signature(const struct Vanetza_Security_Signature&);
|
|
|
|
/**
|
|
* Generate a fresh random EC private key on the curve matching `type`.
|
|
*
|
|
* \throws OpenSslException on generation failure
|
|
*/
|
|
PrivateKey generate_private_key(KeyType type);
|
|
|
|
/**
|
|
* Populate an ASN.1 PublicVerificationKey CHOICE from a PublicKey.
|
|
*
|
|
* \throws std::invalid_argument on unsupported key types
|
|
*/
|
|
void set_verification_key(struct Vanetza_Security_PublicVerificationKey&, const PublicKey&);
|
|
|
|
/**
|
|
* Populate an ASN.1 PublicEncryptionKey from a PublicKey.
|
|
* Sets supportedSymmAlg to AES-128-CCM.
|
|
*
|
|
* \throws std::invalid_argument on unsupported key types
|
|
*/
|
|
void set_encryption_key(struct Vanetza_Security_PublicEncryptionKey&, const PublicKey&);
|
|
|
|
} // namespace pki
|
|
} // namespace vanetza
|