Botan 2.1.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
Botan::PK_Encryptor_EME Class Referencefinal

`#include <pubkey.h>`

Inheritance diagram for 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
size_t | maximum_input_size () const override
PK_Encryptor_EME & | operator= (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 510 of file pubkey.h.

## Constructor & Destructor Documentation

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

  key | the key to use inside the encryptor
  rng | the RNG to use
  padding | the message encoding scheme to use (eg "OAEP(SHA-256)")
  provider | the 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 }

Botan::PK_Encryptor_EME::~PK_Encryptor_EME | ( |  | ) |

Definition at line 96 of file pubkey.cpp.

96 { /* for unique_ptr */ }

Botan::PK_Encryptor_EME::PK_Encryptor_EME | ( | const PK_Encryptor_EME & |  | ) |
| delete

## Member Function Documentation

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

Encrypt a message.

Parameters

  in | the message as a byte array
  length | the length of the above byte array
  rng | the random number source to use

Returns
  encrypted message

Definition at line 46 of file pubkey.h.

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

48 {
49 return enc(in, length, rng);
50 }
template<typename Alloc >

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

Encrypt a message.

Parameters

  in | the message
  rng | the random number source to use

Returns
  encrypted message

Definition at line 59 of file pubkey.h.

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

size_t Botan::PK_Encryptor_EME::maximum_input_size | ( |  | ) | const
| override virtual

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 }

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

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

- src/lib/pubkey/pubkey.h
- src/lib/pubkey/pubkey.cpp