8#ifndef BOTAN_TLS_CIPHER_SUITES_H_
9#define BOTAN_TLS_CIPHER_SUITES_H_
11#include <botan/types.h>
12#include <botan/tls_algos.h>
13#include <botan/tls_version.h>
33 static std::optional<Ciphersuite> by_id(uint16_t suite);
40 static std::optional<Ciphersuite> from_name(
const std::string&
name);
45 static bool is_scsv(uint16_t suite);
52 static const std::vector<Ciphersuite>& all_known_ciphersuites();
58 std::string
to_string()
const {
return (!m_iana_id) ?
"unknown cipher suite" : m_iana_id; }
68 bool psk_ciphersuite()
const;
73 bool ecc_ciphersuite()
const;
78 bool cbc_ciphersuite()
const;
80 bool signature_used()
const;
104 std::string
mac_algo()
const {
return m_mac_algo; }
116 size_t nonce_bytes_from_handshake()
const;
127 bool valid()
const {
return m_usable; }
132 bool operator<(
const uint16_t c)
const {
return ciphersuite_code() < c; }
136 bool is_usable()
const;
142 const char* cipher_algo,
143 size_t cipher_keylen,
144 const char* mac_algo,
148 m_ciphersuite_code(ciphersuite_code),
150 m_auth_method(auth_method),
151 m_kex_algo(kex_algo),
152 m_prf_algo(prf_algo),
153 m_nonce_format(nonce_format),
154 m_cipher_algo(cipher_algo),
155 m_mac_algo(mac_algo),
156 m_cipher_keylen(cipher_keylen),
157 m_mac_keylen(mac_keylen)
159 m_usable = is_usable();
162 uint16_t m_ciphersuite_code = 0;
168 const char* m_iana_id;
175 const char* m_cipher_algo;
176 const char* m_mac_algo;
178 size_t m_cipher_keylen;
181 bool m_usable =
false;
uint16_t ciphersuite_code() const
bool operator<(const uint16_t c) const
Auth_Method auth_method() const
Nonce_Format nonce_format() const
std::string to_string() const
size_t mac_keylen() const
size_t cipher_keylen() const
Kex_Algo kex_method() const
std::string kex_algo() const
std::string mac_algo() const
std::string sig_algo() const
std::string prf_algo() const
bool operator<(const Ciphersuite &o) const
std::string cipher_algo() const
int(* final)(unsigned char *, CTX *)
#define BOTAN_PUBLIC_API(maj, min)
std::string kdf_algo_to_string(KDF_Algo algo)
std::string kex_method_to_string(Kex_Algo method)
std::string auth_method_to_string(Auth_Method method)