#include <pk_ops_impl.h>
Definition at line 53 of file pk_ops_impl.h.
◆ ~Verification_with_EMSA()
Botan::PK_Ops::Verification_with_EMSA::~Verification_with_EMSA |
( |
| ) |
|
|
default |
◆ Verification_with_EMSA()
Botan::PK_Ops::Verification_with_EMSA::Verification_with_EMSA |
( |
const std::string & |
emsa | ) |
|
|
explicitprotected |
Definition at line 95 of file pk_ops.cpp.
95 :
96 Verification(),
99 m_prefix_used(false)
100 {
101 if(!m_emsa)
102 throw Algorithm_Not_Found(emsa);
103 }
std::string hash_for_emsa(const std::string &algo_spec)
EMSA * get_emsa(const std::string &algo_spec)
◆ clone_emsa()
std::unique_ptr< EMSA > Botan::PK_Ops::Verification_with_EMSA::clone_emsa |
( |
| ) |
const |
|
inlineprotected |
Definition at line 119 of file pk_ops_impl.h.
119{ return std::unique_ptr<EMSA>(m_emsa->clone()); }
◆ do_check()
bool Botan::PK_Ops::Verification_with_EMSA::do_check |
( |
const secure_vector< uint8_t > & |
msg, |
|
|
const uint8_t |
sig[], |
|
|
size_t |
sig_len |
|
) |
| |
◆ has_prefix()
virtual bool Botan::PK_Ops::Verification_with_EMSA::has_prefix |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ hash_for_signature()
std::string Botan::PK_Ops::Verification_with_EMSA::hash_for_signature |
( |
| ) |
|
|
inline |
◆ is_valid_signature()
bool Botan::PK_Ops::Verification_with_EMSA::is_valid_signature |
( |
const uint8_t |
sig[], |
|
|
size_t |
sig_len |
|
) |
| |
|
overridevirtual |
Implements Botan::PK_Ops::Verification.
Definition at line 116 of file pk_ops.cpp.
117 {
118 m_prefix_used = false;
119 const secure_vector<uint8_t> msg = m_emsa->raw_data();
120
122 {
123 secure_vector<uint8_t> output_of_key =
verify_mr(sig, sig_len);
125 }
126 else
127 {
128 Null_RNG rng;
129 secure_vector<uint8_t> encoded = m_emsa->encoding_of(msg,
max_input_bits(), rng);
130 return verify(encoded.data(), encoded.size(), sig, sig_len);
131 }
132 }
virtual bool with_recovery() const =0
virtual size_t max_input_bits() const =0
virtual secure_vector< uint8_t > verify_mr(const uint8_t[], size_t)
virtual bool verify(const uint8_t[], size_t, const uint8_t[], size_t)
◆ max_input_bits()
virtual size_t Botan::PK_Ops::Verification_with_EMSA::max_input_bits |
( |
| ) |
const |
|
protectedpure virtual |
Get the maximum message size in bits supported by this public key.
- Returns
- maximum message in bits
◆ message_prefix()
virtual secure_vector< uint8_t > Botan::PK_Ops::Verification_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 85 of file pk_ops_impl.h.
85{ throw Invalid_State("No prefix"); }
◆ update()
void Botan::PK_Ops::Verification_with_EMSA::update |
( |
const uint8_t |
msg[], |
|
|
size_t |
msg_len |
|
) |
| |
|
overridevirtual |
Implements Botan::PK_Ops::Verification.
Definition at line 105 of file pk_ops.cpp.
106 {
108 {
109 m_prefix_used = true;
111 m_emsa->update(prefix.data(), prefix.size());
112 }
113 m_emsa->update(msg, msg_len);
114 }
virtual secure_vector< uint8_t > message_prefix() const
virtual bool has_prefix()
◆ verify()
virtual bool Botan::PK_Ops::Verification_with_EMSA::verify |
( |
const uint8_t |
[], |
|
|
size_t |
, |
|
|
const uint8_t |
[], |
|
|
size_t |
|
|
) |
| |
|
inlineprotectedvirtual |
Definition at line 101 of file pk_ops_impl.h.
103 {
104 throw Invalid_State("Message recovery required");
105 }
◆ verify_mr()
virtual secure_vector< uint8_t > Botan::PK_Ops::Verification_with_EMSA::verify_mr |
( |
const uint8_t |
[], |
|
|
size_t |
|
|
) |
| |
|
inlineprotectedvirtual |
Definition at line 114 of file pk_ops_impl.h.
115 {
116 throw Invalid_State("Message recovery not supported");
117 }
◆ with_recovery()
virtual bool Botan::PK_Ops::Verification_with_EMSA::with_recovery |
( |
| ) |
const |
|
protectedpure virtual |
- Returns
- boolean specifying if this key type supports message recovery and thus if you need to call verify() or verify_mr()
The documentation for this class was generated from the following files: