|
| bool | check_signature (const byte sig[], size_t length) |
| |
| template<typename Alloc > |
| bool | check_signature (const std::vector< byte, 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) |
| |
| | PK_Verifier (const PK_Verifier &)=delete |
| |
| void | set_input_format (Signature_Format format) |
| |
| void | update (byte in) |
| |
| void | update (const byte msg_part[], size_t length) |
| |
| void | update (const std::vector< byte > &in) |
| |
| bool | verify_message (const byte msg[], size_t msg_length, const byte sig[], size_t sig_length) |
| |
| template<typename Alloc , typename Alloc2 > |
| bool | verify_message (const std::vector< byte, Alloc > &msg, const std::vector< byte, 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 220 of file pubkey.h.
| bool Botan::PK_Verifier::check_signature |
( |
const byte |
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 297 of file pubkey.cpp.
References Botan::BER_Decoder::decode(), Botan::DER_SEQUENCE, Botan::BigInt::encode_1363(), Botan::IEEE_1363, Botan::PK_Ops::Verification::message_part_size(), Botan::PK_Ops::Verification::message_parts(), Botan::BER_Decoder::more_items(), Botan::EMSA::raw_data(), Botan::SEQUENCE, Botan::BER_Decoder::start_cons(), and Botan::ASN1::to_string().
Referenced by Botan::PK_Verifier_Filter::end_msg(), Botan::TLS::Server_Key_Exchange::verify(), and verify_message().
301 return validate_signature(emsa->
raw_data(), sig, length);
304 BER_Decoder decoder(sig, length);
305 BER_Decoder ber_sig = decoder.start_cons(
SEQUENCE);
308 std::vector<byte> real_sig;
309 while(ber_sig.more_items())
312 ber_sig.decode(sig_part);
318 throw Decoding_Error(
"PK_Verifier: signature size invalid");
320 return validate_signature(emsa->
raw_data(),
321 &real_sig[0], real_sig.size());
324 throw Decoding_Error(
"PK_Verifier: Unknown signature format " +