Botan: Botan::PK_Decryptor_EME Class Reference

Botan 1.10.16

Public Member Functions | List of all members
Botan::PK_Decryptor_EME Class Reference

`#include <pubkey.h>`

Inheritance diagram for Botan::PK_Decryptor_EME:

## Public Member Functions
SecureVector< byte > | decrypt (const byte in[], size_t length) const
SecureVector< byte > | decrypt (const MemoryRegion< byte > &in) const
| PK_Decryptor_EME (const Private_Key &key, const std::string &eme)
| ~PK_Decryptor_EME ()

## Detailed Description

Decryption with an MR algorithm and an EME.

Definition at line 423 of file pubkey.h.

## Constructor & Destructor Documentation

## ◆ PK_Decryptor_EME()

Botan::PK_Decryptor_EME::PK_Decryptor_EME | ( | const Private_Key & | key,
|  | const std::string & | eme
| ) |  |

Construct an instance.

Parameters

  key | the key to use inside the encryptor
  eme | the EME to use

Definition at line 86 of file pubkey.cpp.

References Botan::Public_Key::algo_name(), Botan::EME::decode(), Botan::get_eme(), Botan::Global_State_Management::global_state(), Botan::PK_Ops::Encryption::max_input_bits(), and Botan::Algorithm_Factory::Engine_Iterator::next().

88 {
89 Algorithm_Factory::Engine_Iterator i(global_state().algorithm_factory());
90
91 op = 0;
92
93 while(const Engine* engine = i.next())
94 {
95 op = engine->get_decryption_op(key);
96 if(op)
97 break;
98 }
99
100 if(!op)
101 throw Lookup_Error("Decryption with " + key.algo_name() + " not supported");
102
103 eme = (eme_name == "Raw") ? 0 : get_eme(eme_name);
104 }
Botan::Algorithm_Factory::Engine_Iterator
friend class Engine_Iterator
Definition: algo_factory.h:207
Botan::Global_State_Management::global_state
Library_State & global_state()
Definition: global_state.cpp:32
Botan::get_eme
EME * get_eme(const std::string &algo_spec)
Definition: get_enc.cpp:143

## ◆ ~PK_Decryptor_EME()

Botan::PK_Decryptor_EME::~PK_Decryptor_EME | ( |  | ) |
| inline

Definition at line 434 of file pubkey.h.

434 { delete op; delete eme; }

## Member Function Documentation

## ◆ decrypt() [1/2]

SecureVector<byte> Botan::PK_Decryptor::decrypt | ( | const byte | in[],
|  | size_t | length
| ) |  | const
| inlineinherited

Decrypt a ciphertext.

Parameters

  in | the ciphertext as a byte array
  length | the length of the above byte array

Returns
  decrypted message

Definition at line 94 of file pubkey.h.

95 {
96 return dec(in, length);
97 }

## ◆ decrypt() [2/2]

SecureVector<byte> Botan::PK_Decryptor::decrypt | ( | const MemoryRegion< byte > & | in | ) | const
| inlineinherited

Decrypt a ciphertext.

Parameters

  in | the ciphertext

Returns
  decrypted message

Definition at line 104 of file pubkey.h.

References Botan::MemoryRegion< T >::size().

105 {
106 return dec(&in[0], in.size());
107 }
Botan::MemoryRegion::size
size_t size() const
Definition: secmem.h:29

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

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