Botan 3.7.1
Crypto and TLS for C&
|
#include <pubkey.h>
Public Member Functions | |
size_t | agreed_value_size () const |
SymmetricKey | derive_key (size_t key_len, const uint8_t peer_key[], size_t peer_key_len, const uint8_t salt[], size_t salt_len) const |
SymmetricKey | derive_key (size_t key_len, const uint8_t peer_key[], size_t peer_key_len, std::string_view salt="") const |
SymmetricKey | derive_key (size_t key_len, std::span< const uint8_t > peer_key, const uint8_t salt[], size_t salt_len) const |
SymmetricKey | derive_key (size_t key_len, std::span< const uint8_t > peer_key, std::string_view salt="") const |
PK_Key_Agreement & | operator= (const PK_Key_Agreement &)=delete |
PK_Key_Agreement & | operator= (PK_Key_Agreement &&) noexcept |
PK_Key_Agreement (const PK_Key_Agreement &)=delete | |
PK_Key_Agreement (const Private_Key &key, RandomNumberGenerator &rng, std::string_view kdf, std::string_view provider="") | |
PK_Key_Agreement (PK_Key_Agreement &&) noexcept | |
~PK_Key_Agreement () | |
Botan::PK_Key_Agreement::PK_Key_Agreement | ( | const Private_Key & | key, |
RandomNumberGenerator & | rng, | ||
std::string_view | kdf, | ||
std::string_view | provider = "" ) |
Construct a PK Key Agreement.
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 215 of file pubkey.cpp.
References Botan::Asymmetric_Key::algo_name(), Botan::Private_Key::create_key_agreement_op(), and Botan::fmt().
|
default |
|
delete |
|
defaultnoexcept |
size_t Botan::PK_Key_Agreement::agreed_value_size | ( | ) | const |
Return the underlying size of the value that is agreed. If derive_key is called with a length of 0 with a "Raw" KDF, it will return a value of this size.
Definition at line 230 of file pubkey.cpp.
References agreed_value_size().
Referenced by agreed_value_size().
SymmetricKey Botan::PK_Key_Agreement::derive_key | ( | size_t | key_len, |
const uint8_t | peer_key[], | ||
size_t | peer_key_len, | ||
const uint8_t | salt[], | ||
size_t | salt_len ) const |
Perform Key Agreement Operation
key_len | the desired key output size (ignored if "Raw" KDF is used) |
peer_key | the other parties key |
peer_key_len | the length of peer_key in bytes |
salt | extra derivation salt |
salt_len | the length of salt in bytes |
Definition at line 248 of file pubkey.cpp.
Referenced by derive_key(), derive_key(), Botan::ECIES_KA_Operation::derive_secret(), and Botan::TLS::Callbacks::tls_ephemeral_key_agreement().
SymmetricKey Botan::PK_Key_Agreement::derive_key | ( | size_t | key_len, |
const uint8_t | peer_key[], | ||
size_t | peer_key_len, | ||
std::string_view | salt = "" ) const |
Perform Key Agreement Operation
key_len | the desired key output size (ignored if "Raw" KDF is used) |
peer_key | the other parties key |
peer_key_len | the length of peer_key in bytes |
salt | extra derivation info |
Definition at line 234 of file pubkey.cpp.
References Botan::cast_char_ptr_to_uint8(), and derive_key().
|
inline |
Perform Key Agreement Operation
key_len | the desired key output size (ignored if "Raw" KDF is used) |
peer_key | the other parties key |
salt | extra derivation salt |
salt_len | the length of salt in bytes |
SymmetricKey Botan::PK_Key_Agreement::derive_key | ( | size_t | key_len, |
std::span< const uint8_t > | peer_key, | ||
std::string_view | salt = "" ) const |
Perform Key Agreement Operation
key_len | the desired key output size (ignored if "Raw" KDF is used) |
peer_key | the other parties key |
salt | extra derivation info |
Definition at line 241 of file pubkey.cpp.
References Botan::cast_char_ptr_to_uint8(), and derive_key().
|
delete |
|
defaultnoexcept |