#include <pk_ops_impl.h>
Definition at line 127 of file pk_ops_impl.h.
◆ Signature_with_EMSA()
Botan::PK_Ops::Signature_with_EMSA::Signature_with_EMSA |
( |
const std::string & |
emsa | ) |
|
|
explicitprotected |
Definition at line 66 of file pk_ops.cpp.
66 :
67 Signature(),
70 m_prefix_used(false)
71 {
72 if(!m_emsa)
73 throw Algorithm_Not_Found(emsa);
74 }
std::string hash_for_emsa(const std::string &algo_spec)
EMSA * get_emsa(const std::string &algo_spec)
◆ ~Signature_with_EMSA()
Botan::PK_Ops::Signature_with_EMSA::~Signature_with_EMSA |
( |
| ) |
|
|
protecteddefault |
◆ clone_emsa()
std::unique_ptr< EMSA > Botan::PK_Ops::Signature_with_EMSA::clone_emsa |
( |
| ) |
const |
|
inlineprotected |
Definition at line 151 of file pk_ops_impl.h.
151{ return std::unique_ptr<EMSA>(m_emsa->clone()); }
◆ has_prefix()
virtual bool Botan::PK_Ops::Signature_with_EMSA::has_prefix |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ hash_for_signature()
std::string Botan::PK_Ops::Signature_with_EMSA::hash_for_signature |
( |
| ) |
|
|
inlineprotected |
◆ message_prefix()
virtual secure_vector< uint8_t > Botan::PK_Ops::Signature_with_EMSA::message_prefix |
( |
| ) |
const |
|
inlineprotectedvirtual |
- Returns
- the message prefix if this signature scheme uses a message prefix, signaled via has_prefix()
Definition at line 149 of file pk_ops_impl.h.
149{ throw Invalid_State("No prefix"); }
◆ sign()
Implements Botan::PK_Ops::Signature.
Definition at line 87 of file pk_ops.cpp.
88 {
89 m_prefix_used = false;
90 const secure_vector<uint8_t> msg = m_emsa->raw_data();
91 const auto padded = m_emsa->encoding_of(msg, this->max_input_bits(), rng);
92 return raw_sign(padded.data(), padded.size(), rng);
93 }
◆ signature_length()
virtual size_t Botan::PK_Ops::Signature::signature_length |
( |
| ) |
const |
|
pure virtualinherited |
◆ update()
void Botan::PK_Ops::Signature_with_EMSA::update |
( |
const uint8_t |
msg[], |
|
|
size_t |
msg_len |
|
) |
| |
|
overridevirtual |
Implements Botan::PK_Ops::Signature.
Definition at line 76 of file pk_ops.cpp.
77 {
79 {
80 m_prefix_used = true;
82 m_emsa->update(prefix.data(), prefix.size());
83 }
84 m_emsa->update(msg, msg_len);
85 }
virtual secure_vector< uint8_t > message_prefix() const
virtual bool has_prefix()
The documentation for this class was generated from the following files: