Files
MicrOBU/obu-firmware/external/vanetza-idf/tools/pki/keys.hpp
T
Ashin Walpola d107534eb2 Keep vanetza-idf in obu-firmware, so a plain clone builds the firmware
obu-firmware builds against the vanetza-idf C-ITS library, which until now
came from the colleague's microbu-esp32c5 tree beside the repository and was
not tracked here, so a clone of this repository could not build the firmware
it ships. The library alone is now part of obu-firmware, as
obu-firmware/external/vanetza-idf: their external/vanetza-idf at commit
cf4b99f, unchanged (9775 files; see its PROVENANCE.md). CMake takes it from
there by default; -DVANETZA_IDF_DIR still points the build elsewhere.

The rest of the colleague's tree (their own VAM firmware, PKI tooling,
station-link Python tools, the V2X2MAP bridge) stays out of this repository
and gitignored; nothing is pushed to their repository. NOTES.md, docs/06,
TODO.md and the pcap verifier's usage line point at the new location.
2026-09-24 10:56:05 +02:00

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