|
Botan 1.10.17
|
#include <pubkey.h>
Public Member Functions | |
| bool | check_signature (const byte sig[], size_t length) |
| bool | check_signature (const MemoryRegion< byte > &sig) |
| PK_Verifier (const Public_Key &pub_key, const std::string &emsa, Signature_Format format=IEEE_1363) | |
| void | set_input_format (Signature_Format format) |
| void | update (byte in) |
| void | update (const byte msg_part[], size_t length) |
| void | update (const MemoryRegion< byte > &in) |
| bool | verify_message (const byte msg[], size_t msg_length, const byte sig[], size_t sig_length) |
| bool | verify_message (const MemoryRegion< byte > &msg, const MemoryRegion< byte > &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().
| Botan::PK_Verifier::PK_Verifier | ( | const Public_Key & | pub_key, |
| const std::string & | emsa, | ||
| Signature_Format | format = IEEE_1363 ) |
Construct a PK Verifier.
| pub_key | the public key to verify against |
| emsa | the EMSA to use (eg "EMSA3(SHA-1)") |
| format | the signature format to use |
Definition at line 248 of file pubkey.cpp.
References Botan::Public_Key::algo_name(), Botan::get_emsa(), Botan::global_state(), Botan::Lookup_Error::Lookup_Error(), and Botan::Algorithm_Factory::Engine_Iterator::next().
Referenced by Botan::get_pk_verifier().
|
inline |
| 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.
| sig | the signature to be verified as a byte array |
| length | the length of the above byte array |
Definition at line 301 of file pubkey.cpp.
References Botan::BER_Decoder::decode(), Botan::Decoding_Error::Decoding_Error(), Botan::DER_SEQUENCE, Botan::BigInt::encode_1363(), Botan::IEEE_1363, Botan::BER_Decoder::more_items(), Botan::SEQUENCE, Botan::MemoryRegion< T >::size(), Botan::BER_Decoder::start_cons(), and Botan::to_string().
Referenced by check_signature(), Botan::Server_Key_Exchange::verify(), and verify_message().
|
inline |
Check the signature of the buffered message, i.e. the one build by successive calls to update.
| sig | the signature to be verified |
Definition at line 275 of file pubkey.h.
References check_signature(), and Botan::MemoryRegion< T >::size().
| void Botan::PK_Verifier::set_input_format | ( | Signature_Format | format | ) |
Set the format of the signatures fed to this verifier.
| format | the signature format to use |
Definition at line 273 of file pubkey.cpp.
References Botan::IEEE_1363, and Botan::Invalid_State::Invalid_State().
|
inline |
Add a message part (single byte) of the message corresponding to the signature to be verified.
| in | the byte to add |
Definition at line 242 of file pubkey.h.
References update().
Referenced by update(), update(), Botan::Server_Key_Exchange::verify(), and verify_message().
| void Botan::PK_Verifier::update | ( | const byte | msg_part[], |
| size_t | length ) |
Add a message part of the message corresponding to the signature to be verified.
| msg_part | the new message part as a byte array |
| length | the length of the above byte array |
Definition at line 293 of file pubkey.cpp.
|
inline |
Add a message part of the message corresponding to the signature to be verified.
| in | the new message part |
Definition at line 257 of file pubkey.h.
References Botan::MemoryRegion< T >::size(), and update().
| bool Botan::PK_Verifier::verify_message | ( | const byte | msg[], |
| size_t | msg_length, | ||
| const byte | sig[], | ||
| size_t | sig_length ) |
Verify a signature.
| msg | the message that the signature belongs to, as a byte array |
| msg_length | the length of the above byte array msg |
| sig | the signature as a byte array |
| sig_length | the length of the above byte array sig |
Definition at line 283 of file pubkey.cpp.
References check_signature(), and update().
Referenced by Botan::X509_Object::check_signature(), Botan::KeyPair::signature_consistency_check(), Botan::Certificate_Verify::verify(), and verify_message().
|
inline |
Verify a signature.
| msg | the message that the signature belongs to |
| sig | the signature |
Definition at line 230 of file pubkey.h.
References Botan::MemoryRegion< T >::size(), and verify_message().