Botan 3.11.0
Crypto and TLS for C&
Botan::Stateful_Key_Index_Registry::KeyId Class Reference

#include <stateful_key_index_registry.h>

Public Member Functions

 KeyId ()=default
 KeyId (std::string_view algo_name, uint32_t algo_params, std::span< const uint8_t > key_material_1, std::span< const uint8_t > key_material_2)
auto operator<=> (const KeyId &other) const =default

Detailed Description

Definition at line 30 of file stateful_key_index_registry.h.

Constructor & Destructor Documentation

◆ KeyId() [1/2]

Botan::Stateful_Key_Index_Registry::KeyId::KeyId ( std::string_view algo_name,
uint32_t algo_params,
std::span< const uint8_t > key_material_1,
std::span< const uint8_t > key_material_2 )

Create a KeyId for some kind of key material

Parameters
algo_nameAlgorithm name (ex "XMSS", "HSS-LMS")
algo_paramsAlgorithm specific parameters
key_material_1First part of key identifying material
key_material_2Second part of key identifying material (can be omitted)

Definition at line 24 of file stateful_key_index_registry.cpp.

27 :
28 m_val() {
29 auto hash = HashFunction::create_or_throw("SHA-256");
30
31 hash->update("Botan Stateful_Key_Index_Registry KeyID");
32 hash->update_be(static_cast<uint64_t>(algo_name.size()));
33 hash->update(algo_name);
34 hash->update_be(algo_params);
35 hash->update_be(static_cast<uint64_t>(key_material_1.size()));
36 hash->update(key_material_1);
37 hash->update_be(static_cast<uint64_t>(key_material_2.size()));
38 hash->update(key_material_2);
39
40 BOTAN_ASSERT_NOMSG(hash->output_length() == m_val.size());
41
42 hash->final(m_val);
43}
#define BOTAN_ASSERT_NOMSG(expr)
Definition assert.h:75
static std::unique_ptr< HashFunction > create_or_throw(std::string_view algo_spec, std::string_view provider="")
Definition hash.cpp:308

References BOTAN_ASSERT_NOMSG, and Botan::HashFunction::create_or_throw().

Referenced by operator<=>().

◆ KeyId() [2/2]

Botan::Stateful_Key_Index_Registry::KeyId::KeyId ( )
default

Member Function Documentation

◆ operator<=>()

auto Botan::Stateful_Key_Index_Registry::KeyId::operator<=> ( const KeyId & other) const
default

References KeyId().


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