CBS_HTTPSMole Class Reference

An HTTPS mole, this class is design to communicate with a client browser. More...

Inheritance diagram for CBS_HTTPSMole:

Inheritance graph
[legend]
Collaboration diagram for CBS_HTTPSMole:

Collaboration graph
[legend]
List of all members.

Public Types

typedef int(* GetPWD_CB )(char *pData, int iSize, int iRWflag, void *pUserData)

Public Member Functions

 CBS_HTTPSMole (CBS_Trace *pTrace, LPCTSTR lpTitle, LPCTSTR lpServerCertFile, GetPWD_CB fpGetPWD, LPVOID lpUserData)
 DECLARE_BS_GENERAL_DRIVE_FUNCTIONS (CBS_HTTPSMole, CBS_HTTPMole)
LPCSTR GetCertChainFile ()
BOOL HaveValidCertificate ()
BOOL HaveValidPKey ()
virtual BOOL ReadyToGo ()
BOOL Renegotiate ()
virtual ~CBS_HTTPSMole ()

Protected Member Functions

virtual BOOL CheckClientAccess (PSOCKADDR_IN ca)
virtual BOOL DoServer ()
virtual DWORD Read (LPTSTR pBuf, DWORD dwSize)
virtual DWORD Send (LPCSTR pBuf, DWORD dwSize=0)

Protected Attributes

LPVOID m_lpHTTPSMoleData
 Private member for internal use.

Detailed Description

An HTTPS mole, this class is design to communicate with a client browser.

Author:
Dror Otmi
Date:
12.07.2003
Version:
V 1.0 Initial version
The HTTPS Mole allow secure SSL connection from a browser to the running application. See also CBS_HTTPMole.


Member Typedef Documentation

void(* CBS_HTTPSMole::GetPWD_CB)(char *pData, int iSize, int iRWflag, void *pUserData)
 

An application defined callback function for getting the password for the private key.


Constructor & Destructor Documentation

CBS_HTTPSMole::CBS_HTTPSMole CBS_Trace pTrace,
LPCTSTR  lpTitle,
LPCTSTR  lpServerCertFile,
CBS_HTTPSMole::GetPWD_CB  fpGetPWD,
LPVOID  lpUserData
 

Constructor

Parameters:
pTrace The trace for the extern manipulation.
lpTitle The titel of the HTML page.
lpServerCertFile A file with the server certificate, private key and any additional CA Certificates.
fpGetPWD A callback for getting the password.
lpUserData An application defined pointer that will be pass to the application when fpGetPWD is invoked.

CBS_HTTPSMole::~CBS_HTTPSMole  )  [virtual]
 

Destructor.


Member Function Documentation

BOOL CBS_HTTPSMole::CheckClientAccess PSOCKADDR_IN  sa  )  [protected, virtual]
 

Verifies the client certificate with SSL Accept.

Parameters:
sa The client source address.
Returns:
TRUE if the verification was successfull.

Reimplemented from CBS_HTTPMole.

CBS_HTTPSMole::DECLARE_BS_GENERAL_DRIVE_FUNCTIONS CBS_HTTPSMole  ,
CBS_HTTPMole 
 

Declares LPCTSTR GetClassName( ), virtual LPCTSTR GetBaseClassName( ) and BOOL IsKindOf( LPCTSTR pCmp ) for CBS_HTTPSMole.

BOOL CBS_HTTPSMole::DoServer  )  [protected, virtual]
 

The implementation of the HTTPS Server.

Returns:
TRUE if the request was retrieved and the response was sent.

Reimplemented from CBS_HTTPMole.

LPCSTR CBS_HTTPSMole::GetCertChainFile  ) 
 

See return.

Returns:
Return the name of the certificate file associated with the current object.

BOOL CBS_HTTPSMole::HaveValidCertificate  ) 
 

See return.

Returns:
TRUE if the object has a valid certificate.

BOOL CBS_HTTPSMole::HaveValidPKey  ) 
 

See return.

Returns:
TRUE if the object has a valid private key.

DWORD CBS_HTTPSMole::Read LPTSTR  pBuf,
DWORD  dwSize
[protected, virtual]
 

Reads bytes from the SSL connection.

Parameters:
pBuf The buffer where to save the incoming bytes.
dwSize The size in bytes of pBuf.
Returns:
The number of bytes received from the client.

Reimplemented from CBS_Mole.

BOOL CBS_HTTPSMole::ReadyToGo  )  [virtual]
 

This virtual function could be overiden by a derived class. It is, however, highly recommended to invoke this function since it confirm the startup only if the object has a valid certificate and private key.

Returns:
TRUE if the object has a valid certificate.

Reimplemented from CBS_HTTPMole.

BOOL CBS_HTTPSMole::Renegotiate  ) 
 

Force renegotiation after the next read is done.

Returns:
Allways zero.

DWORD CBS_HTTPSMole::Send LPCSTR  pBuf,
DWORD  dwSize = 0
[protected, virtual]
 

Sends the data to the client.

Parameters:
pBuf The buffer with the data.
dwSize The size in bytes of the buffer.
Returns:
The number of bytes written.

Reimplemented from CBS_Mole.

Bitspot AG


Bitspot AG
Rietlistrasse 1
CH-6345 Neuheim

Bitspot AG Logo

Phone:

+41 41 755 11 22

Fax:

+41 41 755 11 31

e-mail:

mail@bitspot.com

Web:

www.bitspot.com