|
Botan
2.13.0
Crypto and TLS for C++11
|
#include <pubkey.h>
Public Member Functions | |
| 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) |
| template<typename Alloc > | |
| void | update (const std::vector< uint8_t, Alloc > &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().
| Botan::PK_Verifier::PK_Verifier | ( | const Public_Key & | pub_key, |
| const std::string & | emsa, | ||
| Signature_Format | format = IEEE_1363, |
||
| const std::string & | provider = "" |
||
| ) |
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 |
| provider | the provider to use |
Definition at line 302 of file pubkey.cpp.
References Botan::Public_Key::algo_name(), Botan::Public_Key::create_verification_op(), Botan::Public_Key::message_part_size(), and Botan::Public_Key::message_parts().
| Botan::PK_Verifier::~PK_Verifier | ( | ) |
Definition at line 315 of file pubkey.cpp.
|
delete |
| 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.
| sig | the signature to be verified as a byte array |
| length | the length of the above byte array |
Definition at line 336 of file pubkey.cpp.
References BOTAN_ASSERT_NOMSG, Botan::BER_Decoder::decode(), Botan::DER_SEQUENCE, Botan::BigInt::encode_1363(), Botan::IEEE_1363, Botan::BER_Decoder::more_items(), Botan::same_mem(), Botan::SEQUENCE, and Botan::BER_Decoder::start_cons().
Referenced by botan_pk_op_verify_finish(), Botan::Roughtime::Response::validate(), 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 393 of file pubkey.h.
|
delete |
| 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 317 of file pubkey.cpp.
References Botan::IEEE_1363.
|
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 347 of file pubkey.h.
References update().
Referenced by botan_pk_op_verify_update(), update(), Botan::Roughtime::Response::validate(), and verify_message().
| void Botan::PK_Verifier::update | ( | const uint8_t | 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 331 of file pubkey.cpp.
|
inline |
|
inline |
Add a message part of the message corresponding to the signature to be verified.
Definition at line 372 of file pubkey.h.
References Botan::cast_char_ptr_to_uint8(), and update.
| bool Botan::PK_Verifier::verify_message | ( | const uint8_t | msg[], |
| size_t | msg_length, | ||
| const uint8_t | 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 324 of file pubkey.cpp.
References check_signature(), and update().
Referenced by Botan::KeyPair::signature_consistency_check(), Botan::TLS::Callbacks::tls_verify_message(), Botan::X509_Object::verify_signature(), and Botan::OCSP::Response::verify_signature().
|
inline |
Verify a signature.
| msg | the message that the signature belongs to |
| sig | the signature |
Definition at line 335 of file pubkey.h.
1.8.9.1