.TH "KSSL" kde3 "11 Jun 2005" "Version Version 3.4.1" "kio Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KSSL \- \fBKDE\fP SSL Wrapper Class \fBKDE\fP SSL Class.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kssl.h>\fP
.PP
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKSSL\fP (bool init=true)"
.br
.ti -1c
.RI "\fB~KSSL\fP ()"
.br
.ti -1c
.RI "bool \fBinitialize\fP ()"
.br
.ti -1c
.RI "bool \fBTLSInit\fP ()"
.br
.ti -1c
.RI "bool \fBsetSession\fP (const \fBKSSLSession\fP *session)"
.br
.ti -1c
.RI "void \fBclose\fP ()"
.br
.ti -1c
.RI "bool \fBreInitialize\fP ()"
.br
.ti -1c
.RI "bool \fBreconfig\fP ()"
.br
.ti -1c
.RI "void \fBsetAutoReconfig\fP (bool ar)"
.br
.ti -1c
.RI "int \fBseedWithEGD\fP ()"
.br
.ti -1c
.RI "bool \fBsetSettings\fP (\fBKSSLSettings\fP *settings)"
.br
.ti -1c
.RI "\fBKSSLSettings\fP * \fBsettings\fP ()"
.br
.ti -1c
.RI "bool \fBsetClientCertificate\fP (\fBKSSLPKCS12\fP *pkcs)"
.br
.ti -1c
.RI "void \fBsetProxyUse\fP (bool active, \fBQString\fP realIP=QString::null, int realPort=0, \fBQString\fP proxy=QString::null) KDE_DEPRECATED"
.br
.ti -1c
.RI "void \fBsetPeerHost\fP (\fBQString\fP realHost=QString::null)"
.br
.ti -1c
.RI "int \fBconnect\fP (int sock)"
.br
.ti -1c
.RI "int \fBaccept\fP (int sock)"
.br
.ti -1c
.RI "int \fBread\fP (void *buf, int len)"
.br
.ti -1c
.RI "int \fBpeek\fP (void *buf, int len)"
.br
.ti -1c
.RI "int \fBwrite\fP (const void *buf, int len)"
.br
.ti -1c
.RI "int \fBpending\fP ()"
.br
.ti -1c
.RI "\fBKSSLConnectionInfo\fP & \fBconnectionInfo\fP ()"
.br
.ti -1c
.RI "\fBKSSLPeerInfo\fP & \fBpeerInfo\fP ()"
.br
.ti -1c
.RI "const \fBKSSLSession\fP * \fBsession\fP () const "
.br
.ti -1c
.RI "bool \fBreusingSession\fP () const "
.br
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "static bool \fBdoesSSLWork\fP ()"
.br
.in -1c
.SH "Detailed Description"
.PP 
\fBKDE\fP SSL Wrapper Class \fBKDE\fP SSL Class. 

This class implements KDE's SSL support by wrapping OpenSSL.
.PP
\fBAuthor:\fP
.RS 4
George Staikos <staikos@kde.org> 
.RE
.PP
\fBSee also:\fP
.RS 4
KExtendedSocket, TCPSlaveBase 
.RE
.PP

.PP
Definition at line 42 of file kssl.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KSSL::KSSL (bool init = \fCtrue\fP)"
.PP
Construct a KSSL object. 
.PP
\fBParameters:\fP
.RS 4
\fIinit\fP Set this to false if you do not want this class to immediately initialize OpenSSL.
.RE
.PP

.PP
Definition at line 83 of file kssl.cc.
.PP
References initialize().
.SS "KSSL::~\fBKSSL\fP ()"
.PP
Destroy this KSSL object. 
.PP
Does not close any socket.
.PP
Definition at line 97 of file kssl.cc.
.PP
References close().
.SH "Member Function Documentation"
.PP 
.SS "bool KSSL::doesSSLWork ()\fC [static]\fP"
.PP
Determine if SSL is available and works. 
.PP
\fBReturns:\fP
.RS 4
true is SSL is available and usable
.RE
.PP

.PP
Definition at line 565 of file kssl.cc.
.SS "bool KSSL::initialize ()"
.PP
Initialize OpenSSL. 
.PP
\fBReturns:\fP
.RS 4
true on success
.RE
.PP
This will do nothing if it is already initialized. 
.PP
\fBSee also:\fP
.RS 4
\fBreInitialize\fP
.RE
.PP

.PP
Definition at line 160 of file kssl.cc.
.PP
References QString::ascii(), endl(), KSSLSettings::getCipherList(), QString::isEmpty(), kdDebug(), KSSLSettings::load(), KSSLPeerInfo::reset(), seedWithEGD(), KSSLSettings::sslv2(), and KSSLSettings::sslv3().
.PP
Referenced by KSSL(), and reInitialize().
.SS "bool KSSL::TLSInit ()"
.PP
This is used for applicationss which do STARTTLS or something similar. 
.PP
It creates a TLS method regardless of the user's settings.
.PP
\fBReturns:\fP
.RS 4
true if TLS is successfully initialized
.RE
.PP

.PP
Definition at line 125 of file kssl.cc.
.PP
References QString::ascii(), KSSLSettings::getCipherList(), QString::isEmpty(), KSSLSettings::load(), seedWithEGD(), and KSSLSettings::tlsv1().
.SS "bool KSSL::setSession (const \fBKSSLSession\fP * session)"
.PP
Set an SSL session to use. 
.PP
This deep copies the session so it doesn't have to remain valid. You need to call it after calling initialize or reInitialize. The ID is cleared in \fBclose()\fP.
.PP
\fBParameters:\fP
.RS 4
\fIsession\fP A valid session to reuse. If 0L, it will clear the session ID in memory.
.RE
.PP
\fBReturns:\fP
.RS 4
true on success
.RE
.PP

.PP
Definition at line 206 of file kssl.cc.
.PP
References KSSLSession::_session, and session().
.SS "void KSSL::close ()"
.PP
Close the SSL session. 
.PP

.PP
Definition at line 227 of file kssl.cc.
.PP
References KSSLSettings::getEGDPath(), QString::isEmpty(), QString::latin1(), and KSSLSettings::useEFile().
.PP
Referenced by reInitialize(), and ~KSSL().
.SS "bool KSSL::reInitialize ()"
.PP
Reinitialize OpenSSL. 
.PP
\fBReturns:\fP
.RS 4
true on success
.RE
.PP
This is not generally needed unless you are reusing the KSSL object for a new session. 
.PP
\fBSee also:\fP
.RS 4
\fBinitialize\fP
.RE
.PP

.PP
Definition at line 252 of file kssl.cc.
.PP
References close(), and initialize().
.PP
Referenced by reconfig().
.SS "bool KSSL::reconfig ()"
.PP
Trigger a reread of KSSL configuration and \fBreInitialize()\fP KSSL. 
.PP
\fBReturns:\fP
.RS 4
true on successful reinitalizations
.RE
.PP
If you \fBsetAutoReconfig()\fP to false, then this will simply \fBreInitialize()\fP and not read in the new configuration. 
.PP
\fBSee also:\fP
.RS 4
\fBsetAutoReconfig\fP
.RE
.PP

.PP
Definition at line 542 of file kssl.cc.
.PP
References reInitialize().
.PP
Referenced by setSettings().
.SS "void KSSL::setAutoReconfig (bool ar)"
.PP
Enable or disable automatic reconfiguration on \fBinitialize()\fP. 
.PP
\fBParameters:\fP
.RS 4
\fIar\fP Set to false in order to disable auto-reloading of the KSSL configuration during \fBinitialize()\fP.
.RE
.PP
By default, KSSL will read its configuration on \fBinitialize()\fP. You might want to disable this for performance reasons.
.PP
Definition at line 547 of file kssl.cc.
.SS "int KSSL::seedWithEGD ()"
.PP
This will reseed the pseudo-random number generator with the EGD (entropy gathering daemon) if the EGD is configured and enabled. 
.PP
You don't need to call this yourself normally.
.PP
\fBReturns:\fP
.RS 4
0 on success
.RE
.PP

.PP
Definition at line 104 of file kssl.cc.
.PP
References endl(), KSSLSettings::getEGDPath(), QString::isEmpty(), kdDebug(), QString::latin1(), KSSLSettings::useEFile(), and KSSLSettings::useEGD().
.PP
Referenced by initialize(), and TLSInit().
.SS "bool KSSL::setSettings (\fBKSSLSettings\fP * settings)"
.PP
Set a new \fBKSSLSettings\fP instance as the settings. 
.PP
This deletes the current instance of \fBKSSLSettings\fP.
.PP
\fBParameters:\fP
.RS 4
\fIsettings\fP A new, valid settings object.
.RE
.PP
\fBReturns:\fP
.RS 4
true on success
.RE
.PP

.PP
Definition at line 552 of file kssl.cc.
.PP
References reconfig(), and settings().
.SS "\fBKSSLSettings\fP* KSSL::settings ()\fC [inline]\fP"
.PP
One is built by the constructor, so this will only return a NULL pointer if you set one with \fBsetSettings()\fP. 
.PP
\fBReturns:\fP
.RS 4
the current settings instance
.RE
.PP

.PP
Definition at line 159 of file kssl.h.
.PP
Referenced by setSettings().
.SS "bool KSSL::setClientCertificate (\fBKSSLPKCS12\fP * pkcs)"
.PP
Use this to set the certificate to send to the server. 
.PP
Do NOT delete the \fBKSSLPKCS12\fP object until you are done with the session. It is not defined when KSSL will be done with this.
.PP
\fBParameters:\fP
.RS 4
\fIpkcs\fP the valid PKCS#12 object to send.
.RE
.PP
\fBReturns:\fP
.RS 4
true if the certificate was properly set to the session.
.RE
.PP

.PP
Definition at line 627 of file kssl.cc.
.PP
References endl(), and kdDebug().
.SS "void KSSL::setProxyUse (bool active, \fBQString\fP realIP = \fCQString::null\fP, int realPort = \fC0\fP, \fBQString\fP proxy = \fCQString::null\fP)"
.PP
Set the status of the connection with respect to proxies. 
.PP
\fBParameters:\fP
.RS 4
\fIrealIP\fP is the IP address of the host you're connecting to 
.br
\fIrealPort\fP is the port of the host you're connecting to 
.br
\fIproxy\fP is the IP or hostname of the proxy server 
.RE
.PP
\fBDeprecated\fP
.RS 4
.RE
.PP

.PP
Definition at line 618 of file kssl.cc.
.SS "void KSSL::setPeerHost (\fBQString\fP realHost = \fCQString::null\fP)"
.PP
Set the peer hostname to be used for certificate verification. 
.PP
\fBParameters:\fP
.RS 4
\fIrealHost\fP the remote hostname as the user believes to be connecting to
.RE
.PP

.PP
Definition at line 613 of file kssl.cc.
.SS "int KSSL::connect (int sock)"
.PP
Connect the SSL session to the remote host using the provided socket descriptor. 
.PP
\fBParameters:\fP
.RS 4
\fIsock\fP the socket descriptor to connect with. This must be an already connected socket. 
.RE
.PP
\fBReturns:\fP
.RS 4
1 on success, 0 on error setting the file descriptor, -1 on other error.
.RE
.PP

.PP
Definition at line 358 of file kssl.cc.
.PP
References endl(), and kdDebug().
.SS "int KSSL::accept (int sock)"
.PP
Connect the SSL session to the remote host using the provided socket descriptor. 
.PP
This is for use with an SSL server application.
.PP
\fBParameters:\fP
.RS 4
\fIsock\fP the socket descriptor to connect with. This must be an already connected socket. 
.RE
.PP
\fBReturns:\fP
.RS 4
1 on success, 0 on error setting the file descriptor, -1 on other error.
.RE
.PP

.PP
Definition at line 272 of file kssl.cc.
.PP
References endl(), and kdDebug().
.SS "int KSSL::read (void * buf, int len)"
.PP
Read data from the remote host via SSL. 
.PP
\fBParameters:\fP
.RS 4
\fIbuf\fP the buffer to read the data into. 
.br
\fIlen\fP the maximum length of data to read. 
.RE
.PP
\fBReturns:\fP
.RS 4
the number of bytes read, 0 on an exception, or -1 on error.
.RE
.PP

.PP
Definition at line 476 of file kssl.cc.
.PP
References endl(), and kdDebug().
.SS "int KSSL::peek (void * buf, int len)"
.PP
Peek at available data from the remote host via SSL. 
.PP
\fBParameters:\fP
.RS 4
\fIbuf\fP the buffer to read the data into. 
.br
\fIlen\fP the maximum length of data to read. 
.RE
.PP
\fBReturns:\fP
.RS 4
the number of bytes read, 0 on an exception, or -1 on error.
.RE
.PP

.PP
Definition at line 464 of file kssl.cc.
.SS "int KSSL::write (const void * buf, int len)"
.PP
Write data to the remote host via SSL. 
.PP
\fBParameters:\fP
.RS 4
\fIbuf\fP the buffer to read the data from. 
.br
\fIlen\fP the length of data to send from the buffer. 
.RE
.PP
\fBReturns:\fP
.RS 4
the number of bytes written, 0 on an exception, or -1 on error.
.RE
.PP

.PP
Definition at line 514 of file kssl.cc.
.PP
References endl(), and kdDebug().
.SS "int KSSL::pending ()"
.PP
Determine if data is waiting to be read. 
.PP
\fBReturns:\fP
.RS 4
-1 on error, 0 if no data is waiting, > 0 if data is waiting.
.RE
.PP

.PP
Definition at line 453 of file kssl.cc.
.SS "\fBKSSLConnectionInfo\fP & KSSL::connectionInfo ()"
.PP
Obtain a reference to the connection information. 
.PP
\fBReturns:\fP
.RS 4
a reference to the connection information, valid after connected 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBKSSLConnectionInfo\fP
.RE
.PP

.PP
Definition at line 607 of file kssl.cc.
.SS "\fBKSSLPeerInfo\fP & KSSL::peerInfo ()"
.PP
Obtain a reference to the information about the peer. 
.PP
\fBReturns:\fP
.RS 4
a reference to the peer information, valid after connected 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBKSSLPeerInfo\fP
.RE
.PP

.PP
Definition at line 622 of file kssl.cc.
.SS "const \fBKSSLSession\fP * KSSL::session () const"
.PP
Obtain a pointer to the session information. 
.PP
\fBReturns:\fP
.RS 4
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. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBKSSLSession\fP
.RE
.PP

.PP
Definition at line 661 of file kssl.cc.
.PP
Referenced by setSession().
.SS "bool KSSL::reusingSession () const"
.PP
Determine if we are currently reusing an SSL session ID. 
.PP
\fBReturns:\fP
.RS 4
true if we are reusing a session ID.
.RE
.PP

.PP
Definition at line 665 of file kssl.cc.

.SH "Author"
.PP 
Generated automatically by Doxygen for kio Library from the source code.
