|
Botan 3.14.1
Crypto and TLS for C&
|
#include <hpke.h>
Public Member Functions | |
| KEM_Id | kem () const |
| Public_Key | public_key () const |
| The corresponding public key. | |
| secure_vector< uint8_t > | serialize () const |
| const Botan::Private_Key & | underlying () const |
Static Public Member Functions | |
| static Private_Key | derive (KEM_Id kem, std::span< const uint8_t > ikm) |
| static Private_Key | deserialize (KEM_Id kem, std::span< const uint8_t > bytes) |
| static Private_Key | from_key (KEM_Id kem, std::unique_ptr< Botan::Private_Key > key) |
| static Private_Key | generate (KEM_Id kem, RandomNumberGenerator &rng) |
| GenerateKeyPair from RFC 9180 Section 4. | |
Friends | |
| class | HPKE::Recipient_Context |
| class | HPKE::Sender_Context |
An HPKE private key
This is a value type (cheap to copy) wrapping an asymmetric key that has been validated for use with a particular HPKE KEM. It has no inheritance relationship with Botan::Private_Key or with HPKE::Public_Key; the corresponding public key is obtained with public_key().
|
static |
DeriveKeyPair from RFC 9180 Section 7.1.3
Deterministically derives a key pair from input keying material, which must be full-entropy secret data of at least Nsk bytes; as an exception DHKEM(P-521) accepts 64 bytes, since MLS (RFC 9420 Section 7.4) derives P-521 key pairs from 64-byte node secrets.
Definition at line 293 of file hpke.cpp.
References Botan::HPKE::KEM_Ops::create(), and kem().
|
static |
DeserializePrivateKey from RFC 9180 Section 7.1.2
Accepts Nsk raw bytes. The scalar is range-checked for the NIST curves, and clamped (RFC 7748 Section 5) for X25519 and X448.
Definition at line 299 of file hpke.cpp.
References Botan::HPKE::KEM_Ops::create(), and kem().
|
static |
Adopt an existing key (eg loaded from PKCS #8) for use with HPKE
As for Public_Key::from_key, ECDSA keys on the NIST curves are accepted and converted to ECDH, while other EC algorithms are rejected. Throws Invalid_Argument unless the key's algorithm (and, for the NIST curves, its group) matches the KEM.
Definition at line 305 of file hpke.cpp.
References BOTAN_ARG_CHECK, Botan::HPKE::KEM_Ops::create(), and kem().
|
static |
GenerateKeyPair from RFC 9180 Section 4.
Definition at line 287 of file hpke.cpp.
References Botan::HPKE::KEM_Ops::create(), and kem().
| KEM_Id Botan::HPKE::Private_Key::kem | ( | ) | const |
Definition at line 312 of file hpke.cpp.
Referenced by derive(), deserialize(), from_key(), and generate().
| Public_Key Botan::HPKE::Private_Key::public_key | ( | ) | const |
| secure_vector< uint8_t > Botan::HPKE::Private_Key::serialize | ( | ) | const |
| const Botan::Private_Key & Botan::HPKE::Private_Key::underlying | ( | ) | const |
|
friend |
|
friend |