Botan  1.11.34
Crypto and TLS for C++11
Public Member Functions | List of all members
Botan::PK_Encryptor_EME Class Referencefinal

#include <pubkey.h>

Inheritance diagram for Botan::PK_Encryptor_EME:
Botan::PK_Encryptor

Public Member Functions

std::vector< byteencrypt (const byte in[], size_t length, RandomNumberGenerator &rng) const
 
template<typename Alloc >
std::vector< byteencrypt (const std::vector< byte, Alloc > &in, RandomNumberGenerator &rng) const
 
size_t maximum_input_size () const override
 
PK_Encryptor_EMEoperator= (const PK_Encryptor_EME &)=delete
 
 PK_Encryptor_EME (const Public_Key &key, RandomNumberGenerator &rng, const std::string &padding, const std::string &provider="")
 
 PK_Encryptor_EME (const PK_Encryptor_EME &)=delete
 
 ~PK_Encryptor_EME ()
 

Detailed Description

Encryption using a standard message recovery algorithm like RSA or ElGamal, paired with an encoding scheme like OAEP.

Definition at line 509 of file pubkey.h.

Constructor & Destructor Documentation

§ PK_Encryptor_EME() [1/2]

Botan::PK_Encryptor_EME::PK_Encryptor_EME ( const Public_Key key,
RandomNumberGenerator rng,
const std::string &  padding,
const std::string &  provider = "" 
)

Construct an instance.

Parameters
keythe key to use inside the encryptor
rngthe RNG to use
paddingthe message encoding scheme to use (eg "OAEP(SHA-256)")
providerthe provider to use

Definition at line 86 of file pubkey.cpp.

References Botan::Public_Key::algo_name(), and Botan::Public_Key::create_encryption_op().

90  {
91  m_op = key.create_encryption_op(rng, padding, provider);
92  if(!m_op)
93  throw Invalid_Argument("Key type " + key.algo_name() + " does not support encryption");
94  }

§ ~PK_Encryptor_EME()

Botan::PK_Encryptor_EME::~PK_Encryptor_EME ( )

Definition at line 96 of file pubkey.cpp.

References Botan::unlock().

96 { /* for unique_ptr */ }

§ PK_Encryptor_EME() [2/2]

Botan::PK_Encryptor_EME::PK_Encryptor_EME ( const PK_Encryptor_EME )
delete

Member Function Documentation

§ encrypt() [1/2]

std::vector<byte> Botan::PK_Encryptor::encrypt ( const byte  in[],
size_t  length,
RandomNumberGenerator rng 
) const
inlineinherited

Encrypt a message.

Parameters
inthe message as a byte array
lengththe length of the above byte array
rngthe random number source to use
Returns
encrypted message

Definition at line 45 of file pubkey.h.

Referenced by Botan::TLS::Client_Key_Exchange::Client_Key_Exchange(), and Botan::KeyPair::encryption_consistency_check().

47  {
48  return enc(in, length, rng);
49  }

§ encrypt() [2/2]

template<typename Alloc >
std::vector<byte> Botan::PK_Encryptor::encrypt ( const std::vector< byte, Alloc > &  in,
RandomNumberGenerator rng 
) const
inlineinherited

Encrypt a message.

Parameters
inthe message
rngthe random number source to use
Returns
encrypted message

Definition at line 58 of file pubkey.h.

60  {
61  return enc(in.data(), in.size(), rng);
62  }

§ maximum_input_size()

size_t Botan::PK_Encryptor_EME::maximum_input_size ( ) const
overridevirtual

Return the maximum allowed message size in bytes.

Returns
maximum message size in bytes

Implements Botan::PK_Encryptor.

Definition at line 104 of file pubkey.cpp.

Referenced by Botan::KeyPair::encryption_consistency_check().

105  {
106  return m_op->max_input_bits() / 8;
107  }

§ operator=()

PK_Encryptor_EME& Botan::PK_Encryptor_EME::operator= ( const PK_Encryptor_EME )
delete

The documentation for this class was generated from the following files: