00001 // -*- C++ -*- 00002 00003 // =================================================================== 00004 /** 00005 * @file SSLIOP_Current_Impl.h 00006 * 00007 * $Id: SSLIOP_Current_Impl.h 77001 2007-02-12 07:54:49Z johnnyw $ 00008 * 00009 * @author Ossama Othman <ossama@uci.edu> 00010 */ 00011 // =================================================================== 00012 00013 #ifndef TAO_SSLIOP_CURRENT_IMPL_H 00014 #define TAO_SSLIOP_CURRENT_IMPL_H 00015 00016 #include /**/ "ace/pre.h" 00017 00018 #include "ace/config-all.h" 00019 00020 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00021 # pragma once 00022 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00023 00024 #include "orbsvcs/SSLIOPC.h" 00025 #include "orbsvcs/Security/SL3_SecurityCurrent_Impl.h" 00026 00027 #include <openssl/ssl.h> 00028 00029 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00030 00031 namespace TAO 00032 { 00033 namespace SSLIOP 00034 { 00035 /** 00036 * @class Current_Impl 00037 * 00038 * @brief TSS portion of the TAO SSLIOP::Current extension, and 00039 * the SSLIOP-specific SecurityLevel3::SecurityCurrent 00040 * object. 00041 * 00042 * This class encapsulates the thread-specific state of an SSL 00043 * session during a given upcall. 00044 */ 00045 class Current_Impl : public TAO::SL3::SecurityCurrent_Impl 00046 { 00047 public: 00048 00049 /// Constructor. 00050 Current_Impl (void); 00051 00052 /// Destructor 00053 ~Current_Impl (void); 00054 00055 /// Implementation of the SSLIOP-specific 00056 /// SecurityLevel3::client_credentials() method. 00057 virtual SecurityLevel3::ClientCredentials_ptr client_credentials (); 00058 00059 /// Implementation of the SSLIOP-specific 00060 /// SecurityLevel3::request_is_local() method. 00061 virtual CORBA::Boolean request_is_local (); 00062 00063 /// Return the SSL peer certificate associated with the 00064 /// current request as an octet sequence, i.e. a DER encoded 00065 /// certificate. 00066 void get_peer_certificate (::SSLIOP::ASN_1_Cert *certificate); 00067 00068 /// Return the SSL peer certificate chain associated with the 00069 /// current request as a sequence of DER encoded certificates. 00070 void get_peer_certificate_chain (::SSLIOP::SSL_Cert *cert_chain); 00071 00072 /// Set the pointer to the underlying SSL session state. 00073 void ssl (SSL *s); 00074 00075 /// Return pointer to the SSL session state for the current upcall. 00076 SSL *ssl (void); 00077 00078 protected: 00079 00080 /// Return the unique tag that identifies the concrete subclass. 00081 virtual CORBA::ULong tag (void) const; 00082 00083 private: 00084 00085 /// Prevent copying through the copy constructor and the assignment 00086 /// operator. 00087 //@{ 00088 Current_Impl (const Current_Impl &); 00089 void operator= (const Current_Impl &); 00090 //@} 00091 00092 private: 00093 00094 /// The SSL session state corresponding to the current upcall. 00095 SSL *ssl_; 00096 00097 }; 00098 } // End SSLIOP namespace. 00099 } // End TAO namespace. 00100 00101 TAO_END_VERSIONED_NAMESPACE_DECL 00102 00103 #if defined (__ACE_INLINE__) 00104 # include "orbsvcs/SSLIOP/SSLIOP_Current_Impl.inl" 00105 #endif /* __ACE_INLINE__ */ 00106 00107 #include /**/ "ace/post.h" 00108 00109 #endif /* TAO_SSLIOP_CURRENT_IMPL_H */