|
bool | check_signature (const uint8_t sig[], size_t length) |
|
template<typename Alloc > |
bool | check_signature (const std::vector< uint8_t, Alloc > &sig) |
|
PK_Verifier & | operator= (const PK_Verifier &)=delete |
|
| PK_Verifier (const Public_Key &pub_key, const std::string &emsa, Signature_Format format=IEEE_1363, const std::string &provider="") |
|
| PK_Verifier (const PK_Verifier &)=delete |
|
void | set_input_format (Signature_Format format) |
|
void | update (uint8_t in) |
|
void | update (const uint8_t msg_part[], size_t length) |
|
void | update (const std::vector< uint8_t > &in) |
|
void | update (const std::string &in) |
|
bool | verify_message (const uint8_t msg[], size_t msg_length, const uint8_t sig[], size_t sig_length) |
|
template<typename Alloc , typename Alloc2 > |
bool | verify_message (const std::vector< uint8_t, Alloc > &msg, const std::vector< uint8_t, Alloc2 > &sig) |
|
| ~PK_Verifier () |
|
Public Key Verifier. Use the verify_message() functions for small messages. Use multiple calls update() to process large messages and verify the signature by finally calling check_signature().
Definition at line 288 of file pubkey.h.
bool Botan::PK_Verifier::check_signature |
( |
const uint8_t |
sig[], |
|
|
size_t |
length |
|
) |
| |
Check the signature of the buffered message, i.e. the one build by successive calls to update.
- Parameters
-
sig | the signature to be verified as a byte array |
length | the length of the above byte array |
- Returns
- true if the signature is valid, false otherwise
Definition at line 292 of file pubkey.cpp.
References Botan::BER_Decoder::decode(), Botan::DER_SEQUENCE, Botan::BigInt::encode_1363(), Botan::IEEE_1363, Botan::BER_Decoder::more_items(), Botan::SEQUENCE, and Botan::BER_Decoder::start_cons().
Referenced by Botan::TLS::Server_Key_Exchange::verify(), and verify_message().
297 return m_op->is_valid_signature(sig, length);
301 std::vector<uint8_t> real_sig;
302 BER_Decoder decoder(sig, length);
303 BER_Decoder ber_sig = decoder.start_cons(
SEQUENCE);
306 while(ber_sig.more_items())
309 ber_sig.decode(sig_part);
315 throw Decoding_Error(
"PK_Verifier: signature size invalid");
317 return m_op->is_valid_signature(real_sig.data(), real_sig.size());
320 throw Internal_Error(
"PK_Verifier: Invalid signature format enum");
322 catch(Invalid_Argument&) {
return false; }
static secure_vector< uint8_t > encode_1363(const BigInt &n, size_t bytes)