9#ifndef BOTAN_TPM2_PKOPS_H_
10#define BOTAN_TPM2_PKOPS_H_
12#include <botan/pk_ops.h>
14#include <botan/hash.h>
15#include <botan/internal/tpm2_util.h>
25template <
typename PKOpT>
31 std::unique_ptr<Botan::HashFunction>
hash) :
34 m_scheme(algorithms.signature_scheme),
35 m_hash(std::move(
hash)),
41 void update(std::span<const uint8_t> msg)
override { m_hash->update(msg); }
52 const TPMT_SIG_SCHEME&
scheme()
const {
return m_scheme; }
54 std::optional<std::string>
padding()
const {
return m_padding; }
57 const Object& m_key_handle;
59 TPMT_SIG_SCHEME m_scheme;
60 std::unique_ptr<Botan::HashFunction> m_hash;
61 std::optional<std::string> m_padding;
#define BOTAN_ASSERT_NONNULL(ptr)
const Object & key_handle() const
Botan::HashFunction * hash()
const SessionBundle & sessions() const
void update(std::span< const uint8_t > msg) override
std::optional< std::string > padding() const
std::string hash_function() const override
Signature_Operation_Base(const Object &object, const SessionBundle &sessions, const SignatureAlgorithmSelection &algorithms, std::unique_ptr< Botan::HashFunction > hash)
const TPMT_SIG_SCHEME & scheme() const
Signature_Operation(const Object &object, const SessionBundle &sessions, const SignatureAlgorithmSelection &algorithms)
virtual std::vector< uint8_t > marshal_signature(const TPMT_SIGNATURE &signature) const =0
std::vector< uint8_t > sign(Botan::RandomNumberGenerator &rng) override
virtual TPMT_SIGNATURE unmarshal_signature(std::span< const uint8_t > sig_data) const =0
Verification_Operation(const Object &object, const SessionBundle &sessions, const SignatureAlgorithmSelection &algorithms)
bool is_valid_signature(std::span< const uint8_t > sig_data) override
TPMT_SIG_SCHEME signature_scheme
std::optional< std::string > padding