30 if( m_this ==
nullptr )
36 if( m_this ==
nullptr )
51 void GSsl::Library::add(
const std::string & ,
const std::string & ,
const std::string & ,
const std::string & )
77 return std::string() ;
102 return Result_error ;
107 return Result_error ;
112 return Result_error ;
117 return std::string() ;
122 return std::make_pair( std::string() ,
false ) ;
static Library * instance()
Returns a pointer to a library object, if any.
An interface to an underlying TLS library.
Protocol(const Profile &, LogFn log_fn)
Constructor.
An abstract interface for reading and writing from a non-blocking i/o channel.
bool has(const std::string &profile_name) const
Returns true if the named profile has been add()ed.
void add(const std::string &profile_name, const std::string &key_and_cert_file=std::string(), const std::string &ca_file=std::string(), const std::string &profile_extra_config=std::string())
Creates a named Profile object that can be retrieved by profile().
static std::string str(Result result)
Converts a result enumeration into a printable string.
~Library()
Destructor. Cleans up the underlying TLS library.
std::pair< std::string, bool > peerCertificate(int format=0)
Returns the peer certificate and a verified flag.
Library(bool active=true, const std::string &extra_config=std::string())
Constructor.
Result stop()
Initiates the protocol shutdown.
Result accept(G::ReadWrite &io)
Starts the protocol passively (as a server).
Result connect(G::ReadWrite &io)
Starts the protocol actively (as a client).
static std::string credit(const std::string &prefix, const std::string &eol, const std::string &eot)
Returns a library credit string.
const Profile & profile(const std::string &profile_name) const
Returns an opaque reference to the named profile.
A general-purpose exception class derived from std::exception and containing a std::string.
Result read(char *buffer, size_type buffer_size_in, ssize_type &data_size_out)
Reads user data into the supplied buffer.
A singleton class for initialising the underlying TLS library.
static std::string id()
Returns a library identifier (typically name and version).
bool enabled() const
Returns true if this is a real TLS library and the constructor's active parameter was set...
Result write(const char *buffer, size_type data_size_in, ssize_type &data_size_out)
Writes user data.