Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

OW32::CAsyncSecureSocket< T > Class Template Reference

Asynchronous secure socket io support. More...

#include <AsyncSecureSocket.h>

Inheritance diagram for OW32::CAsyncSecureSocket< T >:

OW32::CAsyncSecureSocketClient< T > OW32::CAsyncSecureSocketServer< T > List of all members.

Public Member Functions

void SetCallback (CAsyncSocketCallback *pCallback)
 Set the callback class.
CAsyncSocketCallbackGetCallback () const
 Get the callback class
virtual void onConnectCompletion (BOOL)
virtual void onCloseCompletion (BOOL)
virtual void onSendCompletion (BOOL bRet, DWORD cbSent)
virtual void onReadCompletion (BOOL bRet, DWORD cbReceived)
virtual void onTimeout ()=0
 CAsyncSecureSocket (CAsyncSocketCallback *pCallback, SOCKET s)
 Construct an asynchronous secure socket.
 CAsyncSecureSocket (CAsyncSocketCallback *pCallback)
 Construct an asynchronous secure socket.
void negotiate ()
 Called to perform the SSL handshake for a connection.
 ~CAsyncSecureSocket ()
 Tidy up an asychronous socket.
virtual int send (const char *buf, int len)
virtual int recv (char *buf, int len)
void setCredentials (CredHandle hCreds)
 Set the credentials handles to be used.
void setRequireClientAuth (bool bRequireClientAuth)
 Require client authnetication.
SECURITY_STATUS getRemoteCert (PCCERT_CONTEXT *pRemoteCertContext)
 Get the remote certificate.
void freeCredentials ()
 Free any acquired credentials.

Static Public Member Functions

SECURITY_STATUS createCredentialsFromCertificate (CredHandle *phCreds, PCCERT_CONTEXT pCertContext, DWORD dwDirection, DWORD dwEnabledProtocols=0)
 Create credentials from the given certificate context.

Protected Types

enum  ConnectionState {
  State_Initial, State_Negotiate, State_Connected, State_Renegotiate,
  State_Shutdown
}

Protected Member Functions

virtual void negotiateLoop ()=0
 The actual negotiation loop.
void ReadCompletion (BOOL bRet, DWORD cbReceived)
void SendCompletion (BOOL bRet, DWORD cbSent)
SECURITY_STATUS querySizes ()

Protected Attributes

friend CAsyncSecureSocketCallback
CAsyncSecureSocketCallback m_callback
SecPkgContext_StreamSizes m_Sizes
CtxtHandle m_hContext
CredHandle m_hCreds
auto_array_ptr< char > m_Extra
int m_ExtraCount
int m_ExtraDecrypted
int m_ExtraDecryptedPos
int m_recvLen
char * m_recvBuf
auto_array_ptr< char > m_SendBuf
const char * m_sendData
int m_bufferSent
int m_totalBuffered
int m_sendProcessed
int m_sendLength
bool m_bRequireClientAuth
bool m_ownCredentials
bool m_fUseIoCompletion
ConnectionState m_State
CAsyncSocketCallbackm_pCallback

Detailed Description

template<class T>
class OW32::CAsyncSecureSocket< T >

Asynchronous secure socket io support.


Constructor & Destructor Documentation

template<class T>
OW32::CAsyncSecureSocket< T >::CAsyncSecureSocket CAsyncSocketCallback pCallback,
SOCKET  s
[inline]
 

Construct an asynchronous secure socket.

Parameters:
pCallback The callback class.
s An existing socket handle.

template<class T>
OW32::CAsyncSecureSocket< T >::CAsyncSecureSocket CAsyncSocketCallback pCallback  )  [inline]
 

Construct an asynchronous secure socket.

Parameters:
pCallback The callback class.


Member Function Documentation

template<class T>
SECURITY_STATUS OW32::CAsyncSecureSocket< T >::createCredentialsFromCertificate CredHandle *  phCreds,
PCCERT_CONTEXT  pCertContext,
DWORD  dwDirection,
DWORD  dwEnabledProtocols = 0
[static]
 

Create credentials from the given certificate context.

Parameters:
phCreds Output - the new credentials handle.
pCertContext The certificate to create from.
dwDirection The direction that the certificate will be used in (server->client, client->server)
dwEnabledProtocols The protocols that can be used with these credentials

template<class T>
SECURITY_STATUS OW32::CAsyncSecureSocket< T >::getRemoteCert PCCERT_CONTEXT *  pRemoteCertContext  ) 
 

Get the remote certificate.

Parameters:
pRemoteCertContext Output - the remote certificate context.

template<class T>
void OW32::CAsyncSecureSocket< T >::setCredentials CredHandle  hCreds  )  [inline]
 

Set the credentials handles to be used.

Parameters:
hCreds The credentials handle.

template<class T>
void OW32::CAsyncSecureSocket< T >::setRequireClientAuth bool  bRequireClientAuth  )  [inline]
 

Require client authnetication.

Parameters:
bRequireClientAuth Set to true to require client authentication.


The documentation for this class was generated from the following file:
Generated on Sun Jun 5 01:29:22 2005 for OW32 by  doxygen 1.3.9.1