44 static std::shared_ptr<Context> create(
const std::string& tcti_nameconf);
52 static std::shared_ptr<Context> create(std::optional<std::string> tcti = {},
53 std::optional<std::string> conf = {});
66 static std::shared_ptr<Context> create(ESYS_CONTEXT* ctx);
96 static
bool supports_botan_crypto_backend() noexcept;
99 bool uses_botan_crypto_backend() const noexcept;
102 ESYS_CONTEXT* esys_context() noexcept;
104 operator ESYS_CONTEXT*() noexcept {
return esys_context(); }
107 std::string vendor()
const;
110 std::string manufacturer()
const;
118 bool supports_algorithm(std::string_view algo_name)
const;
121 size_t max_random_bytes_per_request()
const;
123 std::vector<ESYS_TR> transient_handles()
const;
127 std::optional<TPM2_HANDLE> find_free_persistent_handle()
const;
129 std::vector<TPM2_HANDLE> persistent_handles()
const;
134 std::span<const uint8_t> auth_value = {},
135 std::optional<TPM2_HANDLE> persistent_handle = std::nullopt);
138 void evict(std::unique_ptr<TPM2::PrivateKey> key,
const SessionBundle& sessions);
142 std::unique_ptr<TPM2::PrivateKey> storage_root_key(std::span<const uint8_t> auth_value,
143 const SessionBundle& sessions);
146 Context(ESYS_CONTEXT* ctx,
bool external);
148#if defined(BOTAN_HAS_TPM2_CRYPTO_BACKEND)
149 friend void enable_crypto_callbacks(
const std::shared_ptr<Context>&);
150 CryptoCallbackState& crypto_callback_state();
155 std::unique_ptr<Impl> m_impl;
Context(const Context &)=delete
Context(Context &&) noexcept
uint32_t ESYS_TR
Forward declaration of TSS2 type for convenience.
uint32_t TPM2_HANDLE
Forward declaration of TSS2 type for convenience.