• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeio/kssl
 

tdeio/kssl

Public Member Functions | Static Public Member Functions | List of all members
KSSL Class Reference

#include <kssl.h>

Public Member Functions

 KSSL (bool init=true)
 
 ~KSSL ()
 
bool initialize ()
 
bool TLSInit ()
 
bool takeSession (KSSLSession *session)
 
void close ()
 
bool reInitialize ()
 
bool reconfig ()
 
void setAutoReconfig (bool ar)
 
int seedWithEGD ()
 
bool setSettings (KSSLSettings *settings)
 
KSSLSettings * settings ()
 
bool setClientCertificate (KSSLPKCS12 *pkcs)
 
void setProxyUse (bool active, TQString realIP=TQString::null, int realPort=0, TQString proxy=TQString::null) TDE_DEPRECATED
 
void setPeerHost (TQString realHost=TQString::null)
 
int connect (int sock)
 
int accept (int sock)
 
int read (void *buf, int len)
 
int peek (void *buf, int len)
 
int write (const void *buf, int len)
 
int pending ()
 
KSSLConnectionInfo & connectionInfo ()
 
KSSLPeerInfo & peerInfo ()
 
const KSSLSession * session () const
 
bool reusingSession () const
 

Static Public Member Functions

static bool doesSSLWork ()
 

Detailed Description

KDE SSL Wrapper Class.

This class implements KDE's SSL support by wrapping OpenSSL.

Author
George Staikos staik.nosp@m.os@k.nosp@m.de.or.nosp@m.g
See also
KExtendedSocket, TCPSlaveBase

KDE SSL Class

Definition at line 42 of file kssl.h.

Constructor & Destructor Documentation

◆ KSSL()

KSSL::KSSL ( bool  init = true)

Construct a KSSL object.

Parameters
initSet this to false if you do not want this class to immediately initialize OpenSSL.

Definition at line 82 of file kssl.cpp.

◆ ~KSSL()

KSSL::~KSSL ( )

Destroy this KSSL object.

Does not close any socket.

Definition at line 96 of file kssl.cpp.

Member Function Documentation

◆ accept()

int KSSL::accept ( int  sock)

Connect the SSL session to the remote host using the provided socket descriptor.

This is for use with an SSL server application.

Parameters
sockthe socket descriptor to connect with. This must be an already connected socket.
Returns
1 on success, 0 on error setting the file descriptor, -1 on other error.

Definition at line 276 of file kssl.cpp.

◆ close()

void KSSL::close ( )

Close the SSL session.

Definition at line 231 of file kssl.cpp.

◆ connect()

int KSSL::connect ( int  sock)

Connect the SSL session to the remote host using the provided socket descriptor.

Parameters
sockthe socket descriptor to connect with. This must be an already connected socket.
Returns
1 on success, 0 on error setting the file descriptor, -1 on other error.

Definition at line 374 of file kssl.cpp.

◆ connectionInfo()

KSSLConnectionInfo & KSSL::connectionInfo ( )

Obtain a reference to the connection information.

Returns
a reference to the connection information, valid after connected
See also
KSSLConnectionInfo

Definition at line 636 of file kssl.cpp.

◆ doesSSLWork()

bool KSSL::doesSSLWork ( )
static

Determine if SSL is available and works.

Returns
true is SSL is available and usable

Definition at line 594 of file kssl.cpp.

◆ initialize()

bool KSSL::initialize ( )

Initialize OpenSSL.

Returns
true on success

This will do nothing if it is already initialized.

See also
reInitialize

Definition at line 161 of file kssl.cpp.

◆ peek()

int KSSL::peek ( void *  buf,
int  len 
)

Peek at available data from the remote host via SSL.

Parameters
bufthe buffer to read the data into.
lenthe maximum length of data to read.
Returns
the number of bytes read, 0 on an exception, or -1 on error.

Definition at line 492 of file kssl.cpp.

◆ peerInfo()

KSSLPeerInfo & KSSL::peerInfo ( )

Obtain a reference to the information about the peer.

Returns
a reference to the peer information, valid after connected
See also
KSSLPeerInfo

Definition at line 651 of file kssl.cpp.

◆ pending()

int KSSL::pending ( )

Determine if data is waiting to be read.

Returns
-1 on error, 0 if no data is waiting, > 0 if data is waiting.

Definition at line 481 of file kssl.cpp.

◆ read()

int KSSL::read ( void *  buf,
int  len 
)

Read data from the remote host via SSL.

Parameters
bufthe buffer to read the data into.
lenthe maximum length of data to read.
Returns
the number of bytes read, 0 on an exception, or -1 on error.

Definition at line 504 of file kssl.cpp.

◆ reconfig()

bool KSSL::reconfig ( )

Trigger a reread of KSSL configuration and reInitialize() KSSL.

Returns
true on successful reinitalizations

If you setAutoReconfig() to false, then this will simply reInitialize() and not read in the new configuration.

See also
setAutoReconfig

Definition at line 571 of file kssl.cpp.

◆ reInitialize()

bool KSSL::reInitialize ( )

Reinitialize OpenSSL.

Returns
true on success

This is not generally needed unless you are reusing the KSSL object for a new session.

See also
initialize

Definition at line 256 of file kssl.cpp.

◆ reusingSession()

bool KSSL::reusingSession ( ) const

Determine if we are currently reusing an SSL session ID.

Returns
true if we are reusing a session ID.

Definition at line 692 of file kssl.cpp.

◆ seedWithEGD()

int KSSL::seedWithEGD ( )

This will reseed the pseudo-random number generator with the EGD (entropy gathering daemon) if the EGD is configured and enabled.

You don't need to call this yourself normally.

Returns
0 on success

Definition at line 103 of file kssl.cpp.

◆ session()

const KSSLSession * KSSL::session ( ) const

Obtain a pointer to the session information.

Returns
a pointer to the session information. This is valid after connected, while connected. It is deleted by the KSSL object which returns it. May return 0L if no valid session exists.
See also
KSSLSession

Definition at line 688 of file kssl.cpp.

◆ setAutoReconfig()

void KSSL::setAutoReconfig ( bool  ar)

Enable or disable automatic reconfiguration on initialize().

Parameters
arSet to false in order to disable auto-reloading of the KSSL configuration during initialize().

By default, KSSL will read its configuration on initialize(). You might want to disable this for performance reasons.

Definition at line 576 of file kssl.cpp.

◆ setClientCertificate()

bool KSSL::setClientCertificate ( KSSLPKCS12 *  pkcs)

Use this to set the certificate to send to the server.

Do NOT delete the KSSLPKCS12 object until you are done with the session. It is not defined when KSSL will be done with this.

Parameters
pkcsthe valid PKCS#12 object to send.
Returns
true if the certificate was properly set to the session.

Definition at line 656 of file kssl.cpp.

◆ setPeerHost()

void KSSL::setPeerHost ( TQString  realHost = TQString::null)

Set the peer hostname to be used for certificate verification.

Parameters
realHostthe remote hostname as the user believes to be connecting to

Definition at line 642 of file kssl.cpp.

◆ setProxyUse()

void KSSL::setProxyUse ( bool  active,
TQString  realIP = TQString::null,
int  realPort = 0,
TQString  proxy = TQString::null 
)

Set the status of the connection with respect to proxies.

Parameters
activeis not used
realIPis the IP address of the host you're connecting to
realPortis the port of the host you're connecting to
proxyis the IP or hostname of the proxy server
Deprecated:

Definition at line 647 of file kssl.cpp.

◆ setSettings()

bool KSSL::setSettings ( KSSLSettings *  settings)

Set a new KSSLSettings instance as the settings.

This deletes the current instance of KSSLSettings.

Parameters
settingsA new, valid settings object.
Returns
true on success

Definition at line 581 of file kssl.cpp.

◆ settings()

KSSLSettings * KSSL::settings ( )
inline

One is built by the constructor, so this will only return a NULL pointer if you set one with setSettings().

Returns
the current settings instance

Definition at line 158 of file kssl.h.

◆ takeSession()

bool KSSL::takeSession ( KSSLSession *  session)

Set an SSL session to use.

This takes the session from the original KSSL object, so it is in fact a session move operation.

Parameters
sessionA valid session to reuse. If 0L, it will clear the session ID in memory.
Returns
true on success

Definition at line 211 of file kssl.cpp.

◆ TLSInit()

bool KSSL::TLSInit ( )

This is used for applicationss which do STARTTLS or something similar.

It creates a TLS method regardless of the user's settings.

Returns
true if TLS is successfully initialized

Definition at line 124 of file kssl.cpp.

◆ write()

int KSSL::write ( const void *  buf,
int  len 
)

Write data to the remote host via SSL.

Parameters
bufthe buffer to read the data from.
lenthe length of data to send from the buffer.
Returns
the number of bytes written, 0 on an exception, or -1 on error.

Definition at line 543 of file kssl.cpp.


The documentation for this class was generated from the following files:
  • kssl.h
  • kssl.cpp

tdeio/kssl

Skip menu "tdeio/kssl"
  • Main Page
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

tdeio/kssl

Skip menu "tdeio/kssl"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeio/kssl by doxygen 1.9.4
This website is maintained by Timothy Pearson.