Botan
1.10.9
|
#include <pubkey.h>
Public Member Functions | |
PK_Signer (const Private_Key &key, const std::string &emsa, Signature_Format format=IEEE_1363, Fault_Protection prot=ENABLE_FAULT_PROTECTION) | |
void | set_output_format (Signature_Format format) |
SecureVector< byte > | sign_message (const byte in[], size_t length, RandomNumberGenerator &rng) |
SecureVector< byte > | sign_message (const MemoryRegion< byte > &in, RandomNumberGenerator &rng) |
SecureVector< byte > | signature (RandomNumberGenerator &rng) |
void | update (byte in) |
void | update (const byte in[], size_t length) |
void | update (const MemoryRegion< byte > &in) |
~PK_Signer () | |
Public Key Signer. Use the sign_message() functions for small messages. Use multiple calls update() to process large messages and generate the signature by finally calling signature().
Botan::PK_Signer::PK_Signer | ( | const Private_Key & | key, |
const std::string & | emsa, | ||
Signature_Format | format = IEEE_1363 , |
||
Fault_Protection | prot = ENABLE_FAULT_PROTECTION |
||
) |
Construct a PK Signer.
key | the key to use inside this signer |
emsa | the EMSA to use An example would be "EMSA1(SHA-224)". |
format | the signature format to use |
prot | says if fault protection should be enabled |
Definition at line 128 of file pubkey.cpp.
References Botan::Public_Key::algo_name(), Botan::DISABLE_FAULT_PROTECTION, Botan::ENABLE_FAULT_PROTECTION, Botan::get_emsa(), Botan::Global_State_Management::global_state(), and Botan::Algorithm_Factory::Engine_Iterator::next().
|
inline |
|
inline |
SecureVector< byte > Botan::PK_Signer::sign_message | ( | const byte | in[], |
size_t | length, | ||
RandomNumberGenerator & | rng | ||
) |
Sign a message.
in | the message to sign as a byte array |
length | the length of the above byte array |
rng | the rng to use |
Definition at line 160 of file pubkey.cpp.
References signature(), and update().
Referenced by Botan::EAC1_1_ADO::make_signed(), Botan::X509_Object::make_signed(), Botan::EAC1_1_gen_CVC< Derived >::make_signed(), and Botan::KeyPair::signature_consistency_check().
|
inline |
Sign a message.
in | the message to sign |
rng | the rng to use |
Definition at line 142 of file pubkey.h.
References rng, and Botan::MemoryRegion< T >::size().
SecureVector< byte > Botan::PK_Signer::signature | ( | RandomNumberGenerator & | rng | ) |
Get the signature of the so far processed message (provided by the calls to update()).
rng | the rng to use |
Definition at line 210 of file pubkey.cpp.
References BOTAN_ASSERT, Botan::DER_SEQUENCE, Botan::DER_Encoder::encode_list(), Botan::EMSA::encoding_of(), Botan::DER_Encoder::end_cons(), Botan::DER_Encoder::get_contents(), Botan::IEEE_1363, Botan::PK_Ops::Signature::max_input_bits(), Botan::PK_Ops::Signature::message_parts(), Botan::EMSA::raw_data(), rng, Botan::SEQUENCE, Botan::PK_Ops::Signature::sign(), Botan::MemoryRegion< T >::size(), Botan::DER_Encoder::start_cons(), and Botan::to_string().
Referenced by Botan::PK_Signer_Filter::end_msg(), Botan::CMS_Encoder::sign(), and sign_message().
|
inline |
Add a message part (single byte).
in | the byte to add |
Definition at line 150 of file pubkey.h.
References update().
Referenced by Botan::CMS_Encoder::sign(), sign_message(), update(), and Botan::PK_Signer_Filter::write().
void Botan::PK_Signer::update | ( | const byte | in[], |
size_t | length | ||
) |
Add a message part.
in | the message part to add as a byte array |
length | the length of the above byte array |
Definition at line 170 of file pubkey.cpp.
References Botan::EMSA::update().
|
inline |
Add a message part.
in | the message part to add |
Definition at line 163 of file pubkey.h.
References Botan::MemoryRegion< T >::size(), and update().
Referenced by update().