Botan
1.10.9
|
#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_Management::global_state(), and Botan::Algorithm_Factory::Engine_Iterator::next().
|
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::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::MemoryRegion< T >::size(), Botan::BER_Decoder::start_cons(), and Botan::to_string().
Referenced by Botan::PK_Verifier_Filter::end_msg(), 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 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::PK_Ops::Verification::message_parts().
|
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(), verify_message(), and Botan::PK_Verifier_Filter::write().
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.
References Botan::EMSA::update().
|
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().
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::EAC_Signed_Object::check_signature(), Botan::X509_Object::check_signature(), and Botan::KeyPair::signature_consistency_check().
|
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().