8#ifndef BOTAN_STATEFUL_KEY_INDEX_REGISTRY_H_
9#define BOTAN_STATEFUL_KEY_INDEX_REGISTRY_H_
11#include <botan/mutex.h>
12#include <botan/types.h>
13#include <botan/internal/os_utils.h>
52 KeyId(std::string_view algo_name,
53 std::span<const uint8_t> algo_params,
55 std::span<const uint8_t> key_material_1,
56 std::span<const uint8_t> key_material_2);
71 std::array<uint8_t, 32> m_val{};
73 uint64_t m_max_operations = 0;
113 typedef std::map<KeyId, uint64_t> RegistryMap;
115 RegistryMap::iterator lookup(
const KeyId& key_id);
116 bool fork_detected(
const KeyId& key_id);
121 RegistryMap m_registry;
123 bool m_fork_detected =
false;
KeyId(std::string_view algo_name, std::span< const uint8_t > algo_params, uint64_t max_operations, std::span< const uint8_t > key_material_1, std::span< const uint8_t > key_material_2)
uint64_t max_operations() const
friend class Stateful_Key_Index_Registry
bool operator==(const KeyId &other) const
auto operator<=>(const KeyId &other) const
uint64_t current_index(const KeyId &key_id)
Stateful_Key_Index_Registry & operator=(Stateful_Key_Index_Registry &&)=delete
uint64_t remaining_operations(const KeyId &key_id)
std::optional< uint64_t > reserve_next_index(const KeyId &key_id)
Stateful_Key_Index_Registry & operator=(const Stateful_Key_Index_Registry &)=delete
Stateful_Key_Index_Registry(Stateful_Key_Index_Registry &&)=delete
void set_index_lower_bound(const KeyId &key_id, uint64_t min)
static Stateful_Key_Index_Registry & global()
Stateful_Key_Index_Registry(const Stateful_Key_Index_Registry &)=delete
~Stateful_Key_Index_Registry()