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_KEM_Decryptor Class Referencefinal

`#include <pubkey.h>`

## Public Member Functions
secure_vector< uint8_t > | decrypt (const uint8_t encap_key[], size_t encap_key_len, size_t desired_shared_key_len, const uint8_t salt[], size_t salt_len)
secure_vector< uint8_t > | decrypt (const uint8_t encap_key[], size_t encap_key_len, size_t desired_shared_key_len)
template<typename Alloc1 , typename Alloc2 >
secure_vector< uint8_t > | decrypt (const std::vector< uint8_t, Alloc1 > &encap_key, size_t desired_shared_key_len, const std::vector< uint8_t, Alloc2 > &salt)
PK_KEM_Decryptor & | operator= (const PK_KEM_Decryptor &)=delete
| PK_KEM_Decryptor (const Private_Key &key, RandomNumberGenerator &rng, const std::string &kem_param="", const std::string &provider="")
| PK_KEM_Decryptor (const PK_KEM_Decryptor &)=delete
| ~PK_KEM_Decryptor ()

## Detailed Description

Public Key Key Encapsulation Mechanism Decryption.

Definition at line 691 of file pubkey.h.

## Constructor & Destructor Documentation

Botan::PK_KEM_Decryptor::PK_KEM_Decryptor | ( | const Private_Key & | key,
|  | RandomNumberGenerator & | rng,
|  | const std::string & | kem_param = `""`,
|  | const std::string & | provider = `""`
| ) |  |

Construct an instance.

Parameters

  key | the key to use inside the decryptor
  rng | the RNG to use
  kem_param | additional KEM parameters
  provider | the provider to use

Definition at line 154 of file pubkey.cpp.

References Botan::Public_Key::algo_name(), and Botan::Private_Key::create_kem_decryption_op().

158 {
159 m_op = key.create_kem_decryption_op(rng, param, provider);
160 if(!m_op)
161 throw Invalid_Argument("Key type " + key.algo_name() + " does not support KEM decryption");
162 }

Botan::PK_KEM_Decryptor::~PK_KEM_Decryptor | ( |  | ) |

Definition at line 164 of file pubkey.cpp.

164 { /* for unique_ptr */ }

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

## Member Function Documentation

secure_vector< uint8_t > Botan::PK_KEM_Decryptor::decrypt | ( | const uint8_t | encap_key[],
|  | size_t | encap_key_len,
|  | size_t | desired_shared_key_len,
|  | const uint8_t | salt[],
|  | size_t | salt_len
| ) |  |

Decrypts the shared key for data encryption.

Parameters

  encap_key | the encapsulated key
  encap_key_len | size of the encapsulated key in bytes
  desired_shared_key_len | desired size of the shared key in bytes
  salt | a salt value used in the KDF
  salt_len | size of the salt value in bytes

Returns
  the shared data encryption key

Definition at line 166 of file pubkey.cpp.

Referenced by Botan::mceies_decrypt().

171 {
172 return m_op->kem_decrypt(encap_key, encap_key_len,
173 desired_shared_key_len,
174 salt, salt_len);
175 }

secure_vector<uint8_t> Botan::PK_KEM_Decryptor::decrypt | ( | const uint8_t | encap_key[],
|  | size_t | encap_key_len,
|  | size_t | desired_shared_key_len
| ) |  |
| inline

Decrypts the shared key for data encryption.

Parameters

  encap_key | the encapsulated key
  encap_key_len | size of the encapsulated key in bytes
  desired_shared_key_len | desired size of the shared key in bytes

Returns
  the shared data encryption key

Definition at line 741 of file pubkey.h.

References Botan::CryptoBox::decrypt().

744 {
745 return this->decrypt(encap_key, encap_key_len,
746 desired_shared_key_len,
747 nullptr, 0);
748 }
Botan::PK_KEM_Decryptor::decrypt
secure_vector< uint8_t > decrypt(const uint8_t encap_key[], size_t encap_key_len, size_t desired_shared_key_len, const uint8_t salt[], size_t salt_len)
Definition: pubkey.cpp:166
template<typename Alloc1 , typename Alloc2 >

secure_vector<uint8_t> Botan::PK_KEM_Decryptor::decrypt | ( | const std::vector< uint8_t, Alloc1 > & | encap_key,
|  | size_t | desired_shared_key_len,
|  | const std::vector< uint8_t, Alloc2 > & | salt
| ) |  |
| inline

Decrypts the shared key for data encryption.

Parameters

  encap_key | the encapsulated key
  desired_shared_key_len | desired size of the shared key in bytes
  salt | a salt value used in the KDF

Returns
  the shared data encryption key

Definition at line 758 of file pubkey.h.

References Botan::CryptoBox::decrypt().

761 {
762 return this->decrypt(encap_key.data(), encap_key.size(),
763 desired_shared_key_len,
764 salt.data(), salt.size());
765 }
Botan::PK_KEM_Decryptor::decrypt
secure_vector< uint8_t > decrypt(const uint8_t encap_key[], size_t encap_key_len, size_t desired_shared_key_len, const uint8_t salt[], size_t salt_len)
Definition: pubkey.cpp:166

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

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

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