Botan
1.11.15
|
#include <pubkey.h>
Public Member Functions | |
std::vector< byte > | encrypt (const byte in[], size_t length, RandomNumberGenerator &rng) const |
template<typename Alloc > | |
std::vector< byte > | encrypt (const std::vector< byte, Alloc > &in, RandomNumberGenerator &rng) const |
size_t | maximum_input_size () const |
PK_Encryptor_EME (const Public_Key &key, const std::string &eme) |
Botan::PK_Encryptor_EME::PK_Encryptor_EME | ( | const Public_Key & | key, |
const std::string & | eme | ||
) |
Construct an instance.
key | the key to use inside the decryptor |
eme | the EME to use |
Definition at line 37 of file pubkey.cpp.
References Botan::Public_Key::algo_name(), and Botan::get_eme().
{ m_op.reset(get_pk_op<PK_Ops::Encryption>(key, eme_name)); if(!m_op) throw Lookup_Error("Encryption with " + key.algo_name() + " not supported"); m_eme.reset(get_eme(eme_name)); }
std::vector<byte> Botan::PK_Encryptor::encrypt | ( | const byte | in[], |
size_t | length, | ||
RandomNumberGenerator & | rng | ||
) | const [inline, inherited] |
Encrypt a message.
in | the message as a byte array |
length | the length of the above byte array |
rng | the random number source to use |
Definition at line 48 of file pubkey.h.
Referenced by Botan::TLS::Client_Key_Exchange::Client_Key_Exchange(), and Botan::KeyPair::encryption_consistency_check().
{
return enc(in, length, rng);
}
std::vector<byte> Botan::PK_Encryptor::encrypt | ( | const std::vector< byte, Alloc > & | in, |
RandomNumberGenerator & | rng | ||
) | const [inline, inherited] |
size_t Botan::PK_Encryptor_EME::maximum_input_size | ( | ) | const [virtual] |
Return the maximum allowed message size in bytes.
Implements Botan::PK_Encryptor.
Definition at line 78 of file pubkey.cpp.
Referenced by Botan::KeyPair::encryption_consistency_check().
{ if(!m_eme) return (m_op->max_input_bits() / 8); else return m_eme->maximum_input_size(m_op->max_input_bits()); }