Botan  2.7.0
Crypto and TLS for C++11
Public Member Functions | List of all members
Botan::PK_Encryptor Class Referenceabstract

#include <pubkey.h>

Inheritance diagram for Botan::PK_Encryptor:
Botan::DLIES_Encryptor Botan::ECIES_Encryptor Botan::PK_Encryptor_EME

Public Member Functions

std::vector< uint8_t > encrypt (const uint8_t in[], size_t length, RandomNumberGenerator &rng) const
 
template<typename Alloc >
std::vector< uint8_t > encrypt (const std::vector< uint8_t, Alloc > &in, RandomNumberGenerator &rng) const
 
virtual size_t maximum_input_size () const =0
 
PK_Encryptoroperator= (const PK_Encryptor &)=delete
 
 PK_Encryptor ()=default
 
 PK_Encryptor (const PK_Encryptor &)=delete
 
virtual ~PK_Encryptor ()=default
 

Detailed Description

Public Key Encryptor This is the primary interface for public key encryption

Definition at line 33 of file pubkey.h.

Constructor & Destructor Documentation

◆ PK_Encryptor() [1/2]

Botan::PK_Encryptor::PK_Encryptor ( )
default

◆ ~PK_Encryptor()

virtual Botan::PK_Encryptor::~PK_Encryptor ( )
virtualdefault

◆ PK_Encryptor() [2/2]

Botan::PK_Encryptor::PK_Encryptor ( const PK_Encryptor )
delete

Member Function Documentation

◆ encrypt() [1/2]

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

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 44 of file pubkey.h.

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

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

◆ encrypt() [2/2]

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

Encrypt a message.

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

Definition at line 57 of file pubkey.h.

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

◆ maximum_input_size()

virtual size_t Botan::PK_Encryptor::maximum_input_size ( ) const
pure virtual

Return the maximum allowed message size in bytes.

Returns
maximum message size in bytes

Implemented in Botan::PK_Encryptor_EME.

◆ operator=()

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

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