16 return "BCP195-Basic";
18 return "BCP195-NonDowngrading";
20 return "BCP195-Extended";
26 if (str ==
"BCP195-Basic" || str ==
"basic")
28 if (str ==
"BCP195-NonDowngrading" || str ==
"non-downgrading")
30 if (str ==
"BCP195-Extended" || str ==
"extended")
43 min_version_(min_ver),
44 max_version_(max_ver),
45 non_downgrading_(non_downgrade),
46 ciphers_(std::move(ciphers)),
47 cert_constraints_(std::move(certs)) {}
59 {2048, 256, 5,
true}};
68 {2048, 256, 5,
true}};
77 {3072, 256, 4,
true}};
129 return version >= min_version_ && version <= max_version_;
133 return bits >= cert_constraints_.min_rsa_key_bits;
137 return bits >= cert_constraints_.min_ecdsa_curve_bits;
TLS security policy configuration.
static tls_policy bcp195_extended_profile()
Create an extended profile (TLS 1.3 only)
uint16_t min_protocol_version() const noexcept
bool is_version_allowed(uint16_t version) const noexcept
Check if a TLS version is allowed by this policy.
const cipher_suite_spec & cipher_suites() const noexcept
std::string_view profile_name() const noexcept
tls_policy(tls_profile prof, uint16_t min_ver, uint16_t max_ver, bool non_downgrade, cipher_suite_spec ciphers, certificate_constraints certs)
static constexpr uint16_t kTls13Version
std::string_view tls12_ciphersuites() const noexcept
Get the TLS 1.2 cipher suites string for OpenSSL.
static tls_policy bcp195_non_downgrading_profile()
Create a BCP 195 non-downgrading profile policy.
tls_profile profile() const noexcept
static constexpr std::string_view kTls13Required
TLS 1.3 required cipher suites (BCP 195)
certificate_constraints cert_constraints_
static constexpr std::string_view kTls12Recommended
TLS 1.2 BCP 195 recommended cipher suites.
const certificate_constraints & cert_constraints() const noexcept
bool non_downgrading() const noexcept
uint16_t max_protocol_version() const noexcept
std::string_view tls13_ciphersuites() const noexcept
Get the TLS 1.3 cipher suites string for OpenSSL.
static constexpr std::string_view kTls13Strict
TLS 1.3 strict cipher suites (extended profile)
bool is_rsa_key_acceptable(uint16_t bits) const noexcept
Check if an RSA key size meets minimum requirements.
static constexpr uint16_t kTls12Version
cipher_suite_spec ciphers_
static tls_policy from_profile(tls_profile profile)
Create a policy from a named profile.
static tls_policy bcp195_basic_profile()
Create a BCP 195 basic profile policy.
bool is_ecdsa_key_acceptable(uint16_t bits) const noexcept
Check if an ECDSA curve size meets minimum requirements.
std::optional< tls_profile > parse_tls_profile(std::string_view str) noexcept
Parse TLS profile from string.
constexpr auto to_string(anonymization_profile profile) noexcept -> std::string_view
Convert profile enum to string representation.
tls_profile
TLS policy profile levels.
@ bcp195_basic
BCP 195 basic profile: TLS 1.2 minimum, standard cipher suites.
@ bcp195_non_downgrading
BCP 195 non-downgrading profile: TLS 1.2+ with no downgrade This is the DICOM PS3....
@ bcp195_extended
Extended profile: TLS 1.3 only, strictest cipher suites.
std::vector< tls_profile > available_tls_profiles()
Get a list of all available TLS profiles.
Certificate validation constraints.
TLS cipher suite specification.
std::string tls12_ciphers
TLS 1.2 cipher suites (OpenSSL cipher string format)
std::string tls13_ciphers
TLS 1.3 cipher suites (OpenSSL ciphersuites string format)
TLS security policy for BCP 195 compliance (DICOM PS3.15)