Botan 3.6.1
Crypto and TLS for C&
|
#include <pubkey.h>
Public Member Functions | |
AlgorithmIdentifier | algorithm_identifier () const |
std::string | hash_function () const |
PK_Signer & | operator= (const PK_Signer &)=delete |
PK_Signer & | operator= (PK_Signer &&) noexcept |
PK_Signer (const PK_Signer &)=delete | |
PK_Signer (const Private_Key &key, RandomNumberGenerator &rng, std::string_view padding, Signature_Format format=Signature_Format::Standard, std::string_view provider="") | |
PK_Signer (PK_Signer &&) noexcept | |
void | set_output_format (Signature_Format format) |
std::vector< uint8_t > | sign_message (const uint8_t in[], size_t length, RandomNumberGenerator &rng) |
std::vector< uint8_t > | sign_message (std::span< const uint8_t > in, RandomNumberGenerator &rng) |
std::vector< uint8_t > | signature (RandomNumberGenerator &rng) |
size_t | signature_length () const |
void | update (const uint8_t in[], size_t length) |
void | update (std::span< const uint8_t > in) |
void | update (std::string_view in) |
void | update (uint8_t in) |
~PK_Signer () | |
Public Key Signer. Use the sign_message() functions for small messages. Use multiple calls update() to process large messages and generate the signature by finally calling signature().
Botan::PK_Signer::PK_Signer | ( | const Private_Key & | key, |
RandomNumberGenerator & | rng, | ||
std::string_view | padding, | ||
Signature_Format | format = Signature_Format::Standard, | ||
std::string_view | provider = "" ) |
Construct a PK Signer.
key | the key to use inside this signer |
rng | the random generator to use |
padding | the padding/hash to use, eg "EMSA_PKCS1(SHA-256)" |
format | the signature format to use |
provider | the provider to use |
Definition at line 247 of file pubkey.cpp.
References Botan::Asymmetric_Key::algo_name(), Botan::Private_Key::create_signature_op(), Botan::fmt(), Botan::Public_Key::message_part_size(), and Botan::Public_Key::message_parts().
|
default |
|
delete |
|
defaultnoexcept |
AlgorithmIdentifier Botan::PK_Signer::algorithm_identifier | ( | ) | const |
Return an AlgorithmIdentifier appropriate for identifying the signature method being generated by this PK_Signer. Throws an exception if this is not available for the current signature scheme.
Definition at line 262 of file pubkey.cpp.
std::string Botan::PK_Signer::hash_function | ( | ) | const |
Return the hash function which is being used to create signatures. This should never return an empty string however it may return a string which does not map directly to a hash function, in particular if "Raw" (unhashed) encoding is being used.
Definition at line 266 of file pubkey.cpp.
|
inline |
|
inline |
Sign a message all in one go
in | the message to sign as a byte array |
length | the length of the above byte array |
rng | the rng to use |
Definition at line 186 of file pubkey.h.
References update.
Referenced by Botan::X509_Object::make_signed(), Botan::KeyPair::signature_consistency_check(), and Botan::TLS::Callbacks::tls_sign_message().
|
inline |
Sign a message.
in | the message to sign |
rng | the rng to use |
Definition at line 197 of file pubkey.h.
References Botan::sign_message().
std::vector< uint8_t > Botan::PK_Signer::signature | ( | RandomNumberGenerator & | rng | ) |
Get the signature of the so far processed message (provided by the calls to update()).
rng | the rng to use |
Definition at line 316 of file pubkey.cpp.
References Botan::DerSequence, and Botan::Standard.
size_t Botan::PK_Signer::signature_length | ( | ) | const |
Return an upper bound on the length of the signatures this PK_Signer will produce
Definition at line 304 of file pubkey.cpp.
References Botan::DerSequence, and Botan::Standard.
void Botan::PK_Signer::update | ( | const uint8_t | in[], |
size_t | length ) |
Add a message part.
in | the message part to add as a byte array |
length | the length of the above byte array |
Definition at line 279 of file pubkey.cpp.
|
inline |
void Botan::PK_Signer::update | ( | std::string_view | in | ) |
Add a message part.
in | the message part to add |
Definition at line 275 of file pubkey.cpp.
References Botan::cast_char_ptr_to_uint8(), and update.
|
inline |