SSLIOP_CredentialsAcquirer.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  * @file SSLIOP_CredentialsAcquirer.h
00006  *
00007  * $Id: SSLIOP_CredentialsAcquirer.h 81490 2008-04-28 14:32:24Z johnnyw $
00008  *
00009  * @author Ossama Othman <ossama@dre.vanderbilt.edu>
00010  */
00011 //=============================================================================
00012 
00013 
00014 #ifndef TAO_SSLIOP_CREDENTIALS_ACQUIRER_H
00015 #define TAO_SSLIOP_CREDENTIALS_ACQUIRER_H
00016 
00017 #include /**/ "ace/pre.h"
00018 #include "orbsvcs/SSLIOP/SSLIOP_Export.h"
00019 
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 # pragma once
00022 #endif /* ACE_LACKS_PRAGMA_ONCE */
00023 
00024 #include "orbsvcs/Security/SL3_CredentialsCurator.h"
00025 
00026 #include "orbsvcs/SSLIOPC.h"
00027 #include "orbsvcs/SecurityLevel3C.h"
00028 
00029 #include "tao/LocalObject.h"
00030 
00031 #include <openssl/opensslconf.h>
00032 
00033 
00034 #if defined(_MSC_VER)
00035 #pragma warning(push)
00036 #pragma warning(disable:4250)
00037 #endif /* _MSC_VER */
00038 
00039 
00040 /// Forward declarations for OpenSSL data structures.
00041 extern "C"
00042 {
00043   typedef struct x509_st X509;
00044   typedef struct evp_pkey_st EVP_PKEY;
00045 }
00046 
00047 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00048 
00049 namespace TAO
00050 {
00051   namespace SSLIOP
00052   {
00053     /**
00054      * @class CredentialsAcquirer
00055      *
00056      * @brief SSLIOP-specific SecurityLevel3::CredentialsAcquirer
00057      *        implementation.
00058      *
00059      * This class generates SSLIOP-specific credentials.
00060      */
00061     class TAO_SSLIOP_Export CredentialsAcquirer
00062       : public virtual SecurityLevel3::CredentialsAcquirer,
00063         public virtual ::CORBA::LocalObject
00064     {
00065     public:
00066 
00067       /// Constructor
00068       CredentialsAcquirer (TAO::SL3::CredentialsCurator_ptr curator,
00069                            const CORBA::Any & acquisition_arguments);
00070 
00071       /**
00072        * @name SecurityLevel3::CredentialsAcquirer Methods
00073        *
00074        * Methods required by the SecurityLevel3::CredentialsAcquirer
00075        * interface.
00076        */
00077       //@{
00078       virtual char * acquisition_method (void);
00079 
00080       virtual SecurityLevel3::AcquisitionStatus current_status ();
00081 
00082       virtual CORBA::ULong nth_iteration (void);
00083 
00084       virtual CORBA::Any * get_continuation_data (void);
00085 
00086       virtual SecurityLevel3::AcquisitionStatus continue_acquisition (
00087           const CORBA::Any & acquisition_arguments);
00088 
00089       virtual SecurityLevel3::OwnCredentials_ptr get_credentials (
00090           CORBA::Boolean on_list);
00091 
00092       virtual void destroy (void);
00093       //@}
00094 
00095     protected:
00096 
00097       /// Destructor
00098       /**
00099        * Protected destructor to enforce proper memory management
00100        * through the reference counting mechanism.
00101        */
00102       ~CredentialsAcquirer (void);
00103 
00104     private:
00105 
00106       /// Verify that this CredentialsAcquirer object is still valid,
00107       /// i.e. hasn't been destroyed.
00108       void check_validity (void);
00109 
00110       /// Create an OpenSSL X.509 certificate data structure.
00111       static ::X509 * make_X509 (const ::SSLIOP::File &certificate);
00112 
00113       /// Create an OpenSSL EVP_PKEY key data structure.
00114       static ::EVP_PKEY * make_EVP_PKEY (const ::SSLIOP::File &key);
00115 
00116     private:
00117 
00118       /// Lock used for synchronization.
00119       TAO_SYNCH_MUTEX lock_;
00120 
00121       /// Reference to the TAO CredentialsCurator implementation.
00122       TAO::SL3::CredentialsCurator_var curator_;
00123 
00124       /// SSLIOP-specific credentials acquisition arguments.
00125       const CORBA::Any & acquisition_arguments_;
00126 
00127       /// Has this CredentialsAcquirer object completed credentials
00128       /// acquisition or been explicitly destroyed?
00129       bool destroyed_;
00130 
00131     };
00132 
00133   } // End SSLIOP namespace
00134 }  // End TAO namespace
00135 
00136 TAO_END_VERSIONED_NAMESPACE_DECL
00137 
00138 #if defined(_MSC_VER)
00139 #pragma warning(pop)
00140 #endif /* _MSC_VER */
00141 
00142 #include /**/ "ace/post.h"
00143 
00144 #endif  /* TAO_SSLIOP_CREDENTIALS_ACQUIRER_H */

Generated on Tue Feb 2 17:48:44 2010 for TAO_SSLIOP by  doxygen 1.4.7