00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file SSLIOP_Factory.h 00006 * 00007 * $Id: SSLIOP_Factory.h 71526 2006-03-14 06:14:35Z jtc $ 00008 * 00009 * SSLIOP implementation of PP Framework Protocol_Factory interface. 00010 * 00011 * @author Carlos O'Ryan <coryan@uci.edu> 00012 * @author Ossama Othman <ossama@uci.edu> 00013 */ 00014 //============================================================================= 00015 00016 00017 #ifndef TAO_SSLIOP_FACTORY_H 00018 #define TAO_SSLIOP_FACTORY_H 00019 00020 #include /**/ "ace/pre.h" 00021 00022 #include "orbsvcs/SSLIOP/SSLIOP_Export.h" 00023 00024 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00025 # pragma once 00026 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00027 00028 #include "orbsvcs/SecurityC.h" 00029 #include "orbsvcs/CSIIOPC.h" 00030 00031 #include "tao/Protocol_Factory.h" 00032 00033 #include "ace/Service_Config.h" 00034 00035 00036 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00037 00038 class TAO_Acceptor; 00039 class TAO_Connector; 00040 00041 namespace TAO 00042 { 00043 namespace SSLIOP 00044 { 00045 00046 /** 00047 * @class Protocol_Factory 00048 * 00049 * @brief SSLIOP-specific protocol factory implementation. 00050 * 00051 * This class implements the SSLIOP-specific protocol factory 00052 * implementation for use in TAO's pluggable protocols framework. 00053 */ 00054 class TAO_SSLIOP_Export Protocol_Factory 00055 : public TAO_Protocol_Factory 00056 { 00057 public: 00058 00059 /// Constructor. 00060 Protocol_Factory (void); 00061 00062 /// Destructor. 00063 virtual ~Protocol_Factory (void); 00064 00065 // = Service Configurator hooks. 00066 /// Dynamic linking hook 00067 virtual int init (int argc, char* argv[]); 00068 00069 /// Verify prefix is a match 00070 virtual int match_prefix (const ACE_CString & prefix); 00071 00072 /// Returns the prefix used by the protocol. 00073 virtual const char * prefix (void) const; 00074 00075 /// Return the character used to mark where an endpoint ends and 00076 /// where its options begin. 00077 virtual char options_delimiter (void) const; 00078 00079 // = Check Protocol_Factory.h for a description of these methods. 00080 virtual TAO_Acceptor * make_acceptor (void); 00081 virtual TAO_Connector * make_connector (void); 00082 virtual int requires_explicit_endpoint (void) const; 00083 00084 private: 00085 00086 /// Parse an X509 file path, which is expected to looks like: 00087 /// <X509Path> ::= <Prefix> ':' <Path> 00088 /// <Prefix> ::= 'PEM' | 'ASN1' 00089 /// <Path> ::= any-string 00090 /// Returns either SSL_FILETYPE_ASN1, SSL_FILETYPE_PEM or -1 00091 /// if the prefix can not be recognized. The *path will point 00092 /// to the part of the original buffer, after the initial ':', 00093 /// or will contain 0, if no path was specified. 00094 /// 00095 /// Beware: This function modifies the buffer pointed to by arg! 00096 /// 00097 static int parse_x509_file (char *arg, char **path); 00098 00099 /// Create and register the SSLIOP ORB initializer. 00100 int register_orb_initializer ( 00101 CSIIOP::AssociationOptions csiv2_target_supports, 00102 CSIIOP::AssociationOptions csiv2_target_requires); 00103 00104 private: 00105 00106 /// Default quality-of-protection settings for the SSLIOP 00107 /// pluggable protocol. 00108 ::Security::QOP qop_; 00109 00110 /// The accept() timeout. 00111 /** 00112 * This timeout includes the overall time to complete the SSL 00113 * handshake. This includes both the TCP handshake and the SSL 00114 * handshake. 00115 */ 00116 ACE_Time_Value timeout_; 00117 00118 /// The SSLIOP-specific CSIv2 transport mechanism component. 00119 /** 00120 * This SSLIOP-specific structure is embedded in the CSIv2 transport 00121 * mechanism list of the @c CSIIOP::CompoundSecMechList IOR tagged 00122 * component. 00123 */ 00124 // CSIIOP::TLS_SEC_TRANS * csiv2_component_; 00125 00126 }; 00127 } // End SSLIOP namespace. 00128 } // End TAO namespace. 00129 00130 // Work around preprocessor tokenization. 00131 typedef TAO::SSLIOP::Protocol_Factory TAO_SSLIOP_Protocol_Factory; 00132 00133 TAO_END_VERSIONED_NAMESPACE_DECL 00134 00135 ACE_STATIC_SVC_DECLARE_EXPORT (TAO_SSLIOP, TAO_SSLIOP_Protocol_Factory) 00136 ACE_STATIC_SVC_REQUIRE (TAO_SSLIOP_Protocol_Factory) 00137 ACE_FACTORY_DECLARE (TAO_SSLIOP, TAO_SSLIOP_Protocol_Factory) 00138 00139 #include /**/ "ace/post.h" 00140 00141 #endif /* TAO_SSLIOP_FACTORY_H */