Botan  1.11.33
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 400 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 177 of file pubkey.cpp.

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

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

§ ~PK_Key_Agreement()

Botan::PK_Key_Agreement::~PK_Key_Agreement ( )

Definition at line 187 of file pubkey.cpp.

187 { /* for unique_ptr */ }

§ PK_Key_Agreement() [2/3]

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

Definition at line 198 of file pubkey.cpp.

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

§ 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 462 of file pubkey.h.

466  {
467  return derive_key(key_len, in.data(), in.size(),
468  params, params_len);
469  }
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:202

§ 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 478 of file pubkey.h.

481  {
482  return derive_key(key_len, in, in_len,
483  reinterpret_cast<const uint8_t*>(params.data()),
484  params.length());
485  }
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:202

§ 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 493 of file pubkey.h.

496  {
497  return derive_key(key_len, in.data(), in.size(),
498  reinterpret_cast<const uint8_t*>(params.data()),
499  params.length());
500  }
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:202

§ operator=() [1/2]

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

Definition at line 189 of file pubkey.cpp.

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

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