1#ifndef LIBFILEZILLA_TLS_PARAMS_HEADER
2#define LIBFILEZILLA_TLS_PARAMS_HEADER
51#include "basic_tls_params.hpp"
58template <
typename T, std::enable_if_t<std::is_same_v<std::remove_cv_t<std::remove_reference_t<T>>, std::
string> || std::is_same_v<T, std::
string_view>>* =
nullptr>
70template <
typename T, std::enable_if_t<!(std::is_same_v<std::remove_cv_t<std::remove_reference_t<T>>, std::
string> || std::is_same_v<T, std::
string_view>) && std::is_constructible_v<std::
string, T>>* =
nullptr>
79template <
typename T, std::enable_if_t<std::is_same_v<std::remove_cv_t<std::remove_reference_t<T>>, native_
string>>* =
nullptr>
91template <
typename T, std::enable_if_t<!(std::is_same_v<std::remove_cv_t<std::remove_reference_t<T>>, native_
string>) && std::is_constructible_v<native_
string, T>>* =
nullptr>
101template <
typename T, std::enable_if_t<std::is_same_v<std::remove_cv_t<std::remove_reference_t<T>>, std::
string>>* =
nullptr>
113template <
typename T, std::enable_if_t<!std::is_same_v<std::remove_cv_t<std::remove_reference_t<T>>, std::
string> && std::is_constructible_v<std::
string, T>>* =
nullptr>
121 std::string_view
const,
151 constexpr std::string_view
delimiters{
" \n\r\t"};
152 constexpr std::string_view
pem_begin{
"-----BEGIN"};
The namespace used by libfilezilla.
Definition apply.hpp:17
basic_tls_param_variant< std::string, native_string, std::string > tls_param
Acts as an instance of one of a fz::tls_blob, fz::tls_filepath or fz::tls_pkcs11url.
Definition tls_params.hpp:134
std::wstring native_string
A string in the system's native character type and encoding. Note: This typedef changes depending on...
Definition string.hpp:34
basic_tls_pkcs11url< T > tls_pkcs11url(T &&v)
Creates a tls_pkcs11url object.
Definition tls_params.hpp:102
bool dispatch(event_base const &ev, F &&f)
Dispatch for simple_event<> based events to simple functors.
Definition event_handler.hpp:199
bool is_pem(std::string_view blob)
returns true if the blob is in PEM format. Uses a simple heuristic.
Definition tls_params.hpp:149
bool starts_with(String const &s, String const &beginning)
Tests whether the first string starts with the second string.
Definition string.hpp:673
basic_tls_filepath< T > tls_filepath(T &&v)
Creates a tls_filepath object.
Definition tls_params.hpp:80
basic_tls_param_variant< std::string_view const, native_string const &, std::string const & > const_tls_param_ref
Acts as a const lvalue reference to one of a fz::tls_blob, fz::tls_filepath or fz::tls_pkcs11url.
Definition tls_params.hpp:120
basic_tls_blob< T > tls_blob(T &&v)
Creates a tls_blob object.
Definition tls_params.hpp:59
tls_data_format
The encoding type of a fz::tls_blob or the file pointed to by a fz::tls_filepath.
Definition tls_params.hpp:142
@ autodetect
The type will be detected automatically using an heuristic.
@ der
The provided data is in DER format.
@ pem
The provided data is in PEM format.
basic_tls_param_variant< std::string &, native_string const &, std::string const & > tls_param_ref
Acts as a lvalue reference to one of a fz::tls_blob, fz::tls_filepath or fz::tls_pkcs11url.
Definition tls_params.hpp:127