Botan 2.1.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

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_Agreement & | operator= (PK_Key_Agreement &&)
PK_Key_Agreement & | operator= (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

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

  key | the key to use
  rng | the random generator to use
  kdf | name of the KDF to use (or 'Raw' for no KDF)
  provider | the 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 }

Botan::PK_Key_Agreement::~PK_Key_Agreement | ( |  | ) |

Definition at line 187 of file pubkey.cpp.

187 { /* for unique_ptr */ }

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 {}

Botan::PK_Key_Agreement::PK_Key_Agreement | ( | const PK_Key_Agreement & |  | ) |
| delete

## Member Function Documentation

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

Definition at line 202 of file pubkey.cpp.

Referenced by Botan::TLS::Client_Key_Exchange::Client_Key_Exchange(), and Botan::ECIES_KA_Operation::derive_secret().

206 {
207 return m_op->agree(key_len, in, in_len, salt, salt_len);
208 }

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 }
Botan::PK_Key_Agreement::derive_key
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

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 }
Botan::PK_Key_Agreement::derive_key
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

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 }
Botan::PK_Key_Agreement::derive_key
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

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 }

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

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

- src/lib/pubkey/pubkey.h
- src/lib/pubkey/pubkey.cpp