Botan  2.9.0
Crypto and TLS for C++11
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_Decryptoroperator= (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 723 of file pubkey.h.

Constructor & Destructor Documentation

◆ PK_KEM_Decryptor() [1/2]

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
keythe key to use inside the decryptor
rngthe RNG to use
kem_paramadditional KEM parameters
providerthe provider to use

Definition at line 165 of file pubkey.cpp.

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

169  {
170  m_op = key.create_kem_decryption_op(rng, param, provider);
171  if(!m_op)
172  throw Invalid_Argument("Key type " + key.algo_name() + " does not support KEM decryption");
173  }

◆ ~PK_KEM_Decryptor()

Botan::PK_KEM_Decryptor::~PK_KEM_Decryptor ( )

Definition at line 175 of file pubkey.cpp.

175 { /* for unique_ptr */ }

◆ PK_KEM_Decryptor() [2/2]

Botan::PK_KEM_Decryptor::PK_KEM_Decryptor ( const PK_KEM_Decryptor )
delete

Member Function Documentation

◆ decrypt() [1/3]

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_keythe encapsulated key
encap_key_lensize of the encapsulated key in bytes
desired_shared_key_lendesired size of the shared key in bytes
salta salt value used in the KDF
salt_lensize of the salt value in bytes
Returns
the shared data encryption key

Definition at line 177 of file pubkey.cpp.

References salt_len.

Referenced by Botan::mceies_decrypt().

182  {
183  return m_op->kem_decrypt(encap_key, encap_key_len,
184  desired_shared_key_len,
185  salt, salt_len);
186  }
size_t salt_len
Definition: x509_obj.cpp:26

◆ decrypt() [2/3]

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_keythe encapsulated key
encap_key_lensize of the encapsulated key in bytes
desired_shared_key_lendesired size of the shared key in bytes
Returns
the shared data encryption key

Definition at line 773 of file pubkey.h.

References Botan::CryptoBox::decrypt().

776  {
777  return this->decrypt(encap_key, encap_key_len,
778  desired_shared_key_len,
779  nullptr, 0);
780  }
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:177

◆ decrypt() [3/3]

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_keythe encapsulated key
desired_shared_key_lendesired size of the shared key in bytes
salta salt value used in the KDF
Returns
the shared data encryption key

Definition at line 790 of file pubkey.h.

References Botan::CryptoBox::decrypt().

793  {
794  return this->decrypt(encap_key.data(), encap_key.size(),
795  desired_shared_key_len,
796  salt.data(), salt.size());
797  }
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:177

◆ operator=()

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

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