sockets::SSLInfo Class Reference

SSL encapsulation. More...

#include <ssl.h>

List of all members.

Public Member Functions

 ~SSLInfo ()
 Destructor.
bool assign (int fd)
 Transforms the given socket file descriptor into a SSL connection.
ssize_t read (void *buf, size_t len)
 Reads data from the SSL connection.
ssize_t write (void const *buf, size_t len)
 Writes data to the SSL connection.
int shutdown ()
 Sends the close-notify alert to the peer.
bool got_shutdown () const
 Did we get the close-alert?
bool sent_shutdown () const
 Did we send the close alert?
char const * version () const
 Returns the version of this SSL connection protocol.
char const * cipher_version () const
 Returns the cipher version.
char const * cipher_name () const
 Returns the cipher name.
char const * cipher_desc () const
 Returns the cipher description.
char const * peer_cert_key () const
 Returns the peer certificate key info.
SSLContextcontext () const
 Returns the context associated with this object.
TCPClientclient () const
 Returns the client associated with this object.

Friends

class SSLContext
 Add SSLContext as a friend.


Detailed Description

This class encapsulates the SSL structure. It also creates the underlying BIO whenever the assign method is called. This class may only be created by SSLContext.

Member Function Documentation

bool sockets::SSLInfo::assign ( int  fd  ) 

Transforms the given socket file descriptor into a SSL connection.

Parameters:
[in] fd The socket file descriptor
Returns:
true if successful, false otherwise.

ssize_t sockets::SSLInfo::read ( void *  buf,
size_t  len 
)

Reads data from the SSL connection.

Parameters:
[in] buf The buffer that receives the data.
[in] len The length of the buffer, in bytes.
Returns:
-1 if there was an error, 0 if the (possibly SSL only) connection has been shutdown gracefully, else the number of bytes read.

ssize_t sockets::SSLInfo::write ( void const *  buf,
size_t  len 
)

Writes data to the SSL connection.

Parameters:
[in] buf The buffer to write.
[in] len The length of the buffer, in bytes.
Returns:
-1 if there was an error, or the number of bytes written to the socket.

int sockets::SSLInfo::shutdown (  ) 

Sends the close-notify alert to the peer. See SSL_shutdown(3) for more information.

This method automatically clears the ssReadable or ssWritable flag of the socket and calls Socket::watch() if needed.

Returns:
1 if the shutdown is complete, 0 if it is in progress, -1 if there was a fatal error.


The documentation for this class was generated from the following file:
Generated on Fri Apr 18 22:03:29 2008 for Epona API by  doxygen 1.5.3