Botan  2.4.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 689 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 155 of file pubkey.cpp.

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

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

◆ ~PK_KEM_Decryptor()

Botan::PK_KEM_Decryptor::~PK_KEM_Decryptor ( )

Definition at line 165 of file pubkey.cpp.

165 { /* 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 167 of file pubkey.cpp.

Referenced by Botan::mceies_decrypt().

172  {
173  return m_op->kem_decrypt(encap_key, encap_key_len,
174  desired_shared_key_len,
175  salt, salt_len);
176  }
size_t salt_len
Definition: x509_obj.cpp:25

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

References Botan::CryptoBox::decrypt().

742  {
743  return this->decrypt(encap_key, encap_key_len,
744  desired_shared_key_len,
745  nullptr, 0);
746  }
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:167

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

References Botan::CryptoBox::decrypt().

759  {
760  return this->decrypt(encap_key.data(), encap_key.size(),
761  desired_shared_key_len,
762  salt.data(), salt.size());
763  }
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:167

◆ 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: