00001 /*************************************************************************** 00002 * Copyright (C) 2001 by Rick L. Vinyard, Jr. * 00003 * rvinyard@cs.nmsu.edu * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU Lesser General Public License as * 00007 * published by the Free Software Foundation version 2.1. * 00008 * * 00009 * This program is distributed in the hope that it will be useful, * 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00012 * GNU General Public License for more details. * 00013 * * 00014 * You should have received a copy of the GNU Lesser General Public * 00015 * License along with this library; if not, write to the * 00016 * Free Software Foundation, Inc., * 00017 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * 00018 ***************************************************************************/ 00019 #ifndef CONEXUSEXCEPT_NSS_H 00020 #define CONEXUSEXCEPT_NSS_H 00021 00022 #include <conexus/except.h> 00023 #include <iostream> 00024 00025 namespace Conexus { 00026 00032 class nss_exception: public conexus_exception { 00033 public: 00034 nss_exception( int e = 0 ) : conexus_exception( "Unknown NSS exception.", e, "nss" ) { } 00035 nss_exception( const std::string s, int e = 0 ) : conexus_exception( s, e, "nss" ) { } 00036 } 00037 ; 00038 00039 namespace exception { 00040 00041 00042 namespace nss { 00043 00049 class ssl_socket_import: public nss_exception { 00050 public: 00051 ssl_socket_import() : nss_exception( "Error importing NSPR socket into NSS." ) { } 00052 } 00053 ; 00054 00060 class option_ssl_security: public nss_exception { 00061 public: 00062 option_ssl_security() : nss_exception( "Error setting option SSL_SECURITY." ) { } 00063 } 00064 ; 00065 00071 class option_ssl_handshake_as_server: public nss_exception { 00072 public: 00073 option_ssl_handshake_as_server() : nss_exception( "Error setting option SSL_HANDSHAKE_AS_SERVER." ) { } 00074 } 00075 ; 00076 00082 class option_ssl_handshake_as_client: public nss_exception { 00083 public: 00084 option_ssl_handshake_as_client() : nss_exception( "Error setting option SSL_HANDSHAKE_AS_CLIENT." ) { } 00085 } 00086 ; 00087 00093 class option_ssl_request_certificate: public nss_exception { 00094 public: 00095 option_ssl_request_certificate() : nss_exception( "Error setting option SSL_REQUEST_CERTIFICATE." ) { } 00096 } 00097 ; 00098 00104 class option_ssl_require_certificate: public nss_exception { 00105 public: 00106 option_ssl_require_certificate() : nss_exception( "Error setting option SSL_REQUIRE_CERTIFICATE." ) { } 00107 } 00108 ; 00109 00115 class ssl_getclientauthdatahook: public nss_exception { 00116 public: 00117 ssl_getclientauthdatahook() : nss_exception( "Error setting callback SSL_GetClientAuthDataHook." ) { } 00118 } 00119 ; 00120 00126 class ssl_authcertificatehook: public nss_exception { 00127 public: 00128 ssl_authcertificatehook() : nss_exception( "Error setting callback SSL_AuthCertificateHook." ) { } 00129 } 00130 ; 00131 00137 class ssl_badcerthook: public nss_exception { 00138 public: 00139 ssl_badcerthook() : nss_exception( "Error setting callback SSL_BadCertHook." ) { } 00140 } 00141 ; 00142 00148 class ssl_handshakecallback: public nss_exception { 00149 public: 00150 ssl_handshakecallback() : nss_exception( "Error setting callback SSL_HandshakeCallback." ) { } 00151 } 00152 ; 00153 00159 class ssl_pkcs11pinarg: public nss_exception { 00160 public: 00161 ssl_pkcs11pinarg() : nss_exception( "Error setting SSL_PKCS11PinArg." ) { } 00162 } 00163 ; 00164 00165 00166 } 00167 } 00168 } 00169 00170 #endif