8#include <botan/tls_signature_scheme.h>
10#include <botan/ec_group.h>
11#include <botan/tls_exceptn.h>
12#include <botan/tls_version.h>
13#include <botan/internal/stl_util.h>
22 static const std::vector<Signature_Scheme> all_schemes = {
68 return m_code !=
NONE;
76 return "RSA_PKCS1_SHA1";
78 return "RSA_PKCS1_SHA256";
80 return "RSA_PKCS1_SHA384";
82 return "RSA_PKCS1_SHA512";
87 return "ECDSA_SHA256";
89 return "ECDSA_SHA384";
91 return "ECDSA_SHA512";
94 return "RSA_PSS_SHA256";
96 return "RSA_PSS_SHA384";
98 return "RSA_PSS_SHA512";
101 return "EDDSA_25519";
151 return "Unknown hash function";
160 return "EMSA_PKCS1(SHA-1)";
162 return "EMSA_PKCS1(SHA-256)";
164 return "EMSA_PKCS1(SHA-384)";
166 return "EMSA_PKCS1(SHA-512)";
169 return "EMSA1(SHA-1)";
171 return "EMSA1(SHA-256)";
173 return "EMSA1(SHA-384)";
175 return "EMSA1(SHA-512)";
178 return "PSSR(SHA-256,MGF1,32)";
180 return "PSSR(SHA-384,MGF1,48)";
182 return "PSSR(SHA-512,MGF1,64)";
190 return "Unknown padding";
226 return "Unknown algorithm";
296 if(hash_function_name() ==
"SHA-1")
304 if(!protocol_version.is_pre_tls_13() &&
305 (m_code == RSA_PKCS1_SHA1 ||
306 m_code == RSA_PKCS1_SHA256 ||
307 m_code == RSA_PKCS1_SHA384 ||
308 m_code == RSA_PKCS1_SHA512))
316 if(algorithm_name() != private_key.algo_name())
320 const auto keylen = private_key.key_length();
324 if(m_code == ECDSA_SHA256 && !(keylen >= 250 && keylen <= 350))
327 if(m_code == ECDSA_SHA384 && !(keylen >= 350 && keylen <= 450))
330 if(m_code == ECDSA_SHA512 && !(keylen >= 450 && keylen <= 550))
std::vector< uint8_t > DER_encode(EC_Group_Encoding form) const
std::string hash_function_name() const noexcept
bool is_compatible_with(const Protocol_Version &protocol_version) const noexcept
AlgorithmIdentifier algorithm_identifier() const noexcept
std::optional< Signature_Format > format() const noexcept
bool is_suitable_for(const Private_Key &private_key) const noexcept
std::string to_string() const noexcept
bool is_set() const noexcept
static const std::vector< Signature_Scheme > & all_available_schemes()
std::string padding_string() const noexcept
bool is_available() const noexcept
std::string algorithm_name() const noexcept
std::string to_string(const BER_Object &obj)
bool value_exists(const std::vector< T > &vec, const T &val)