Botan 3.6.1
Crypto and TLS for C&
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

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

Detailed Description

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

Definition at line 28 of file pubkey.h.

Constructor & Destructor Documentation

◆ PK_Encryptor() [1/3]

Botan::PK_Encryptor::PK_Encryptor ( )
default

◆ ~PK_Encryptor()

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

◆ PK_Encryptor() [2/3]

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

◆ PK_Encryptor() [3/3]

Botan::PK_Encryptor::PK_Encryptor ( PK_Encryptor && )
defaultnoexcept

Member Function Documentation

◆ ciphertext_length()

virtual size_t Botan::PK_Encryptor::ciphertext_length ( size_t ctext_len) const
pure virtual

Return an upper bound on the ciphertext length

Implemented in Botan::PK_Encryptor_EME.

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

37 {
38 return enc(in, length, rng);
39 }

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

◆ encrypt() [2/2]

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

Encrypt a message.

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

Definition at line 47 of file pubkey.h.

47 {
48 return enc(in.data(), in.size(), rng);
49 }

◆ 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=() [1/2]

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

◆ operator=() [2/2]

PK_Encryptor & Botan::PK_Encryptor::operator= ( PK_Encryptor && )
defaultnoexcept

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