Botan  1.11.34
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 byte in[], size_t in_len, const byte params[], size_t params_len) const
 
SymmetricKey derive_key (size_t key_len, const std::vector< byte > &in, const byte params[], size_t params_len) const
 
SymmetricKey derive_key (size_t key_len, const byte in[], size_t in_len, const std::string &params="") const
 
SymmetricKey derive_key (size_t key_len, const std::vector< byte > &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 399 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 byte  in[],
size_t  in_len,
const byte  params[],
size_t  params_len 
) const

§ derive_key() [2/4]

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

Definition at line 461 of file pubkey.h.

465  {
466  return derive_key(key_len, in.data(), in.size(),
467  params, params_len);
468  }
SymmetricKey derive_key(size_t key_len, const byte in[], size_t in_len, const byte 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 byte  in[],
size_t  in_len,
const std::string &  params = "" 
) const
inline

Definition at line 477 of file pubkey.h.

480  {
481  return derive_key(key_len, in, in_len,
482  reinterpret_cast<const byte*>(params.data()),
483  params.length());
484  }
SymmetricKey derive_key(size_t key_len, const byte in[], size_t in_len, const byte 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< byte > &  in,
const std::string &  params = "" 
) const
inline

Definition at line 492 of file pubkey.h.

495  {
496  return derive_key(key_len, in.data(), in.size(),
497  reinterpret_cast<const byte*>(params.data()),
498  params.length());
499  }
SymmetricKey derive_key(size_t key_len, const byte in[], size_t in_len, const byte params[], size_t params_len) const
Definition: pubkey.cpp:202
std::uint8_t byte
Definition: types.h:31

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