|
Botan 3.12.0
Crypto and TLS for C&
|
#include <tls_psk_13.h>
Public Member Functions | |
| ExternalPSK | derive_imported_psk (Protocol_Version version, std::string_view target_hash) const |
| PSKImporter (std::span< const uint8_t > key, std::span< const uint8_t > identity, std::span< const uint8_t > context, std::string_view hash="SHA-256") | |
RFC 9258 PSK Importer.
Holds the base key material and identity for a pre-shared key and derives imported PSKs for specific TLS protocol versions and cipher suite hash algorithms using the PSK importer mechanism
Definition at line 86 of file tls_psk_13.h.
| Botan::TLS::PSKImporter::PSKImporter | ( | std::span< const uint8_t > | key, |
| std::span< const uint8_t > | identity, | ||
| std::span< const uint8_t > | context, | ||
| std::string_view | hash = "SHA-256" ) |
| key | the base pre-shared key |
| identity | the external PSK identity |
| context | optional importer context |
| Hashes | the hash algorithm provisioned with this PSK ("SHA-256" or "SHA-384") which defaults to SHA-256 due to RFC 9258's "If the EPSK does not have [...] an associated hash function, SHA-256 SHOULD be used." |
Definition at line 19 of file tls_psk_importer_13.cpp.
References BOTAN_ARG_CHECK.
| ExternalPSK Botan::TLS::PSKImporter::derive_imported_psk | ( | Protocol_Version | version, |
| std::string_view | target_hash ) const |
Derive an imported PSK for the given target protocol version and cipher suite hash algorithm.
| version | target TLS protocol version (must be TLS 1.3) |
| target_hash | hash algorithm of the target cipher suite ("SHA-256" or "SHA-384") |
Definition at line 44 of file tls_psk_importer_13.cpp.
References BOTAN_ARG_CHECK, Botan::concat(), Botan::HashFunction::create_or_throw(), Botan::KDF::create_or_throw(), Botan::store_be(), and Botan::TLS::Protocol_Version::version_code().