Botan
3.6.1
Crypto and TLS for C&
src
lib
prov
tpm2
tpm2_crypto_backend
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
14
namespace
Botan
{
15
class
RandomNumberGenerator;
16
}
17
18
namespace
Botan::TPM2
{
19
20
class
Context;
21
22
/**
23
* This state object is available to all crypto callbacks.
24
* Its lifetime is managed by the TPM2::Context.
25
*/
26
struct
CryptoCallbackState
{
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
*/
36
void
enable_crypto_callbacks
(
const
std::shared_ptr<Context>& context);
37
38
}
// namespace Botan::TPM2
39
40
#endif
Botan::TPM2
Definition
tpm2_algo_mappings.h:24
Botan::TPM2::enable_crypto_callbacks
void enable_crypto_callbacks(const std::shared_ptr< Context > &ctx)
Definition
tpm2_crypto_backend.cpp:867
Botan
Definition
alg_id.cpp:13
Botan::TPM2::CryptoCallbackState
Definition
tpm2_crypto_backend.h:26
Botan::TPM2::CryptoCallbackState::rng
std::shared_ptr< Botan::RandomNumberGenerator > rng
Definition
tpm2_crypto_backend.h:29
Botan::TPM2::CryptoCallbackState::CryptoCallbackState
CryptoCallbackState(std::shared_ptr< Botan::RandomNumberGenerator > rng_in)
Definition
tpm2_crypto_backend.h:27
Generated by
1.12.0