Botan  2.4.0
Crypto and TLS for C++11
Public Member Functions | List of all members
Botan::PK_Key_Agreement Class Referencefinal

#include <pubkey.h>

Public Member Functions

SymmetricKey derive_key (size_t key_len, const uint8_t in[], size_t in_len, const uint8_t params[], size_t params_len) const
 
SymmetricKey derive_key (size_t key_len, const std::vector< uint8_t > &in, const uint8_t params[], size_t params_len) const
 
SymmetricKey derive_key (size_t key_len, const uint8_t in[], size_t in_len, const std::string &params="") const
 
SymmetricKey derive_key (size_t key_len, const std::vector< uint8_t > &in, const std::string &params="") const
 
PK_Key_Agreementoperator= (PK_Key_Agreement &&)
 
PK_Key_Agreementoperator= (const PK_Key_Agreement &)=delete
 
 PK_Key_Agreement (const Private_Key &key, RandomNumberGenerator &rng, const std::string &kdf, const std::string &provider="")
 
 PK_Key_Agreement (PK_Key_Agreement &&)
 
 PK_Key_Agreement (const PK_Key_Agreement &)=delete
 
 ~PK_Key_Agreement ()
 

Detailed Description

Key used for key agreement

Definition at line 398 of file pubkey.h.

Constructor & Destructor Documentation

◆ PK_Key_Agreement() [1/3]

Botan::PK_Key_Agreement::PK_Key_Agreement ( const Private_Key key,
RandomNumberGenerator rng,
const std::string &  kdf,
const std::string &  provider = "" 
)

Construct a PK Key Agreement.

Parameters
keythe key to use
rngthe random generator to use
kdfname of the KDF to use (or 'Raw' for no KDF)
providerthe algo provider to use (or empty for default)

Definition at line 178 of file pubkey.cpp.

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

182  {
183  m_op = key.create_key_agreement_op(rng, kdf, provider);
184  if(!m_op)
185  throw Invalid_Argument("Key type " + key.algo_name() + " does not support key agreement");
186  }

◆ ~PK_Key_Agreement()

Botan::PK_Key_Agreement::~PK_Key_Agreement ( )

Definition at line 188 of file pubkey.cpp.

188 { /* for unique_ptr */ }

◆ PK_Key_Agreement() [2/3]

Botan::PK_Key_Agreement::PK_Key_Agreement ( PK_Key_Agreement &&  other)

Definition at line 199 of file pubkey.cpp.

199  :
200  m_op(std::move(other.m_op))
201  {}

◆ PK_Key_Agreement() [3/3]

Botan::PK_Key_Agreement::PK_Key_Agreement ( const PK_Key_Agreement )
delete

Member Function Documentation

◆ derive_key() [1/4]

SymmetricKey Botan::PK_Key_Agreement::derive_key ( size_t  key_len,
const uint8_t  in[],
size_t  in_len,
const uint8_t  params[],
size_t  params_len 
) const

◆ derive_key() [2/4]

SymmetricKey Botan::PK_Key_Agreement::derive_key ( size_t  key_len,
const std::vector< uint8_t > &  in,
const uint8_t  params[],
size_t  params_len 
) const
inline

Definition at line 460 of file pubkey.h.

464  {
465  return derive_key(key_len, in.data(), in.size(),
466  params, params_len);
467  }
SymmetricKey derive_key(size_t key_len, const uint8_t in[], size_t in_len, const uint8_t params[], size_t params_len) const
Definition: pubkey.cpp:203

◆ derive_key() [3/4]

SymmetricKey Botan::PK_Key_Agreement::derive_key ( size_t  key_len,
const uint8_t  in[],
size_t  in_len,
const std::string &  params = "" 
) const
inline

Definition at line 476 of file pubkey.h.

References Botan::cast_char_ptr_to_uint8().

479  {
480  return derive_key(key_len, in, in_len,
481  cast_char_ptr_to_uint8(params.data()),
482  params.length());
483  }
const uint8_t * cast_char_ptr_to_uint8(const char *s)
Definition: mem_ops.h:120
SymmetricKey derive_key(size_t key_len, const uint8_t in[], size_t in_len, const uint8_t params[], size_t params_len) const
Definition: pubkey.cpp:203

◆ derive_key() [4/4]

SymmetricKey Botan::PK_Key_Agreement::derive_key ( size_t  key_len,
const std::vector< uint8_t > &  in,
const std::string &  params = "" 
) const
inline

Definition at line 491 of file pubkey.h.

References Botan::cast_char_ptr_to_uint8().

494  {
495  return derive_key(key_len, in.data(), in.size(),
496  cast_char_ptr_to_uint8(params.data()),
497  params.length());
498  }
const uint8_t * cast_char_ptr_to_uint8(const char *s)
Definition: mem_ops.h:120
SymmetricKey derive_key(size_t key_len, const uint8_t in[], size_t in_len, const uint8_t params[], size_t params_len) const
Definition: pubkey.cpp:203

◆ operator=() [1/2]

PK_Key_Agreement & Botan::PK_Key_Agreement::operator= ( PK_Key_Agreement &&  other)

Definition at line 190 of file pubkey.cpp.

191  {
192  if(this != &other)
193  {
194  m_op = std::move(other.m_op);
195  }
196  return (*this);
197  }

◆ operator=() [2/2]

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

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