Botan 3.14.1
Crypto and TLS for C&
Botan::PK_Ops::Signature_with_Hash Class Referenceabstract

#include <pk_ops_impl.h>

Inheritance diagram for Botan::PK_Ops::Signature_with_Hash:
Botan::PK_Ops::Signature

Public Member Functions

virtual AlgorithmIdentifier algorithm_identifier () const
std::vector< uint8_t > sign (RandomNumberGenerator &rng) override
virtual size_t signature_length () const =0
void update (std::span< const uint8_t > input) override
 ~Signature_with_Hash () override

Protected Member Functions

std::string hash_function () const final
 Signature_with_Hash (const PK_Signature_Options_Reader &options)

Detailed Description

Definition at line 103 of file pk_ops_impl.h.

Constructor & Destructor Documentation

◆ ~Signature_with_Hash()

Botan::PK_Ops::Signature_with_Hash::~Signature_with_Hash ( )
overridedefault

References Signature_with_Hash().

◆ Signature_with_Hash()

Botan::PK_Ops::Signature_with_Hash::Signature_with_Hash ( const PK_Signature_Options_Reader & options)
explicitprotected

Definition at line 136 of file pk_ops.cpp.

136 :
137 Signature(), m_hash(validate_options_returning_hash(options)) {}

Referenced by ~Signature_with_Hash().

Member Function Documentation

◆ algorithm_identifier()

AlgorithmIdentifier Botan::PK_Ops::Signature::algorithm_identifier ( ) const
virtualinherited

Return an algorithm identifier associated with this signature scheme.

Default implementation throws an exception

Reimplemented in Botan::XMSS_Signature_Operation.

Definition at line 30 of file pk_ops.cpp.

30 {
31 throw Not_Implemented("This signature scheme does not have an algorithm identifier available");
32}

Referenced by signature_length().

◆ hash_function()

std::string Botan::PK_Ops::Signature_with_Hash::hash_function ( ) const
finalprotectedvirtual

Return the hash function being used by this signer

Implements Botan::PK_Ops::Signature.

Definition at line 151 of file pk_ops.cpp.

151 {
152 return m_hash->name();
153}

◆ sign()

std::vector< uint8_t > Botan::PK_Ops::Signature_with_Hash::sign ( RandomNumberGenerator & rng)
overridevirtual

Perform a signature operation

Parameters
Random Number Generatorsa random number generator

Implements Botan::PK_Ops::Signature.

Definition at line 159 of file pk_ops.cpp.

159 {
160 const std::vector<uint8_t> msg = m_hash->final_stdvec();
161 return raw_sign(msg, rng);
162}

◆ signature_length()

virtual size_t Botan::PK_Ops::Signature::signature_length ( ) const
pure virtualinherited

Return an upper bound on the length of the output signature

Implemented in Botan::XMSS_Signature_Operation.

References algorithm_identifier().

◆ update()

void Botan::PK_Ops::Signature_with_Hash::update ( std::span< const uint8_t > input)
overridevirtual

Add more data to the message currently being signed

Parameters
inputthe input to be hashed/signed

Implements Botan::PK_Ops::Signature.

Definition at line 155 of file pk_ops.cpp.

155 {
156 m_hash->update(msg);
157}

References Botan::PK_Ops::Signature::update().


The documentation for this class was generated from the following files: