/***************************************************************************** $Id: ssl.h 2473 2006-05-11 06:37:31Z francis $ File: ssl.h Date: 30Apr06 Copyright (C) 2006 by Francis Cianfrocca. All Rights Reserved. Gmail: garbagecat20 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *****************************************************************************/ #ifndef __SslBox__H_ #define __SslBox__H_ #ifdef WITH_SSL /****************** class SslContext_t ******************/ class SslContext_t { public: SslContext_t (bool is_server); virtual ~SslContext_t(); private: static bool bLibraryInitialized; private: bool bIsServer; SSL_CTX *pCtx; EVP_PKEY *PrivateKey; X509 *Certificate; friend class SslBox_t; }; /************** class SslBox_t **************/ class SslBox_t { public: SslBox_t (bool is_server); virtual ~SslBox_t(); int PutPlaintext (const char*, int); int GetPlaintext (char*, int); bool PutCiphertext (const char*, int); bool CanGetCiphertext(); int GetCiphertext (char*, int); void Shutdown(); protected: SslContext_t *Context; bool bIsServer; SSL *pSSL; BIO *pbioRead; BIO *pbioWrite; PageList OutboundQ; }; #endif // WITH_SSL #endif // __SslBox__H_