Botan 3.6.0
Crypto and TLS for C&
tpm2_crypto_backend.h
Go to the documentation of this file.
1/*
2* TPM 2 TSS crypto callbacks backend
3* (C) 2024 Jack Lloyd
4* (C) 2024 René Meusel, Amos Treiber - Rohde & Schwarz Cybersecurity GmbH, financed by LANCOM Systems GmbH
5*
6* Botan is released under the Simplified BSD License (see license.txt)
7*/
8
9#ifndef BOTAN_TPM2_CRYPTO_BACKEND_H_
10#define BOTAN_TPM2_CRYPTO_BACKEND_H_
11
12#include <memory>
13
14namespace Botan {
15class RandomNumberGenerator;
16}
17
18namespace Botan::TPM2 {
19
20class Context;
21
22/**
23 * This state object is available to all crypto callbacks.
24 * Its lifetime is managed by the TPM2::Context.
25 */
27 CryptoCallbackState(std::shared_ptr<Botan::RandomNumberGenerator> rng_in) : rng(std::move(rng_in)) {}
28
29 std::shared_ptr<Botan::RandomNumberGenerator> rng; // NOLINT(misc-non-private-member-variables-in-classes)
30};
31
32/**
33 * Enable Botan's crypto callbacks in the TPM2-TSS for the given @p context.
34 * @throws Not_Implemented if the TPM2-TSS does not support crypto callbacks.
35 */
36void enable_crypto_callbacks(const std::shared_ptr<Context>& context);
37
38} // namespace Botan::TPM2
39
40#endif
void enable_crypto_callbacks(const std::shared_ptr< Context > &ctx)
std::shared_ptr< Botan::RandomNumberGenerator > rng
CryptoCallbackState(std::shared_ptr< Botan::RandomNumberGenerator > rng_in)