irods  4.2.8
About: iRODS (the integrated Rule Oriented Data System) is a distributed data-management system for creating data grids, digital libraries, persistent archives, and real-time data systems.
  Fossies Dox: irods-4.2.8.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

irods_ssl_object.hpp
Go to the documentation of this file.
1 #ifndef __IRODS_SSL_OBJECT_HPP__
2 #define __IRODS_SSL_OBJECT_HPP__
3 
4 // =-=-=-=-=-=-=-
7 
8 // =-=-=-=-=-=-=-
9 // ssl includes
10 #include "openssl/ssl.h"
11 
12 namespace irods {
13 
14 // =-=-=-=-=-=-=-
15 // constant key for tcp network object
16  const std::string SSL_NETWORK_PLUGIN( "ssl" );
17 
18 // =-=-=-=-=-=-=-
19 // SSL Network Object
20  class ssl_object : public network_object {
21  public:
22  // =-=-=-=-=-=-=-
23  // Constructors
24  ssl_object();
25  ssl_object( const rcComm_t& );
26  ssl_object( const rsComm_t& );
27  ssl_object( const ssl_object& );
28 
29  // =-=-=-=-=-=-=-
30  // Destructors
31  virtual ~ssl_object();
32 
33  // =-=-=-=-=-=-=-
34  // Operators
35  virtual ssl_object& operator=( const ssl_object& );
36 
38  virtual bool operator==( const ssl_object& _rhs ) const;
39 
40  // =-=-=-=-=-=-=-
41  // plugin resolution operation
42  virtual error resolve(
43  const std::string&, // plugin interface name
44  plugin_ptr& ); // resolved plugin
45 
46  // =-=-=-=-=-=-=-
47  // convertion to client comm ptr
48  virtual error to_client( rcComm_t* );
49 
50  // =-=-=-=-=-=-=-
51  // convertion to client comm ptr
52  virtual error to_server( rsComm_t* );
53 
54  // =-=-=-=-=-=-=-
55  // accessor for rule engine variables
57 
58  // =-=-=-=-=-=-=-
59  // Accessors
60  virtual SSL_CTX* ssl_ctx() const {
61  return ssl_ctx_;
62  }
63  virtual SSL* ssl() const {
64  return ssl_;
65  }
66  virtual std::string host() const {
67  return host_;
68  }
70  return shared_secret_;
71  }
72 
73  virtual int key_size() const {
74  return key_size_;
75  }
76  virtual int salt_size() const {
77  return salt_size_;
78  }
79  virtual int num_hash_rounds() const {
80  return num_hash_rounds_;
81  }
82  virtual std::string encryption_algorithm() const {
83  return encryption_algorithm_;
84  }
85 
86  // =-=-=-=-=-=-=-
87  // mutators
88  virtual void ssl_ctx( SSL_CTX* _c ) {
89  ssl_ctx_ = _c;
90  }
91  virtual void ssl( SSL* _s ) {
92  ssl_ = _s;
93  }
94  virtual void host( const std::string& _h ) {
95  host_ = _h;
96  }
97  virtual void shared_secret( const buffer_crypt::array_t& _s ) {
98  shared_secret_ = _s;
99  }
100 
101  virtual void key_size( int _s ) {
102  key_size_ = _s;
103  }
104  virtual void salt_size( int _s ) {
105  salt_size_ = _s;
106  }
107  virtual void num_hash_rounds( int _h ) {
108  num_hash_rounds_ = _h;
109  }
110  virtual void encryption_algorithm( const std::string& _a ) {
112  }
113 
114  private:
115  SSL_CTX* ssl_ctx_;
116  SSL* ssl_;
117  std::string host_;
119 
124 
125  }; // class ssl_object
126 
129  typedef boost::shared_ptr< ssl_object > ssl_object_ptr;
130 
131 }; // namespace irods
132 
133 #endif // __IRODS_SSL_OBJECT_HPP__
irods::plugin_ptr
boost::shared_ptr< plugin_base > plugin_ptr
Definition: irods_first_class_object.hpp:18
rcComm_t
Definition: rcConnect.h:95
irods::ssl_object
Definition: irods_ssl_object.hpp:20
rsComm_t
Definition: rcConnect.h:145
irods::buffer_crypt::array_t
std::vector< unsigned char > array_t
Definition: irods_buffer_encryption.hpp:30
irods::ssl_object::get_re_vars
virtual error get_re_vars(rule_engine_vars_t &)
Definition: irods_ssl_object.cpp:163
irods::ssl_object::encryption_algorithm_
std::string encryption_algorithm_
Definition: irods_ssl_object.hpp:123
irods_network_object.hpp
irods::ssl_object::salt_size_
int salt_size_
Definition: irods_ssl_object.hpp:121
irods::ssl_object::to_client
virtual error to_client(rcComm_t *)
Definition: irods_ssl_object.cpp:192
irods::ssl_object::~ssl_object
virtual ~ssl_object()
Definition: irods_ssl_object.cpp:66
irods::ssl_object::ssl
virtual void ssl(SSL *_s)
Definition: irods_ssl_object.hpp:91
irods::ssl_object::key_size
virtual void key_size(int _s)
Definition: irods_ssl_object.hpp:101
irods::ssl_object::host
virtual std::string host() const
Definition: irods_ssl_object.hpp:66
irods::ssl_object::to_server
virtual error to_server(rsComm_t *)
Definition: irods_ssl_object.cpp:217
irods::ssl_object::salt_size
virtual int salt_size() const
Definition: irods_ssl_object.hpp:76
irods::ssl_object::shared_secret
virtual void shared_secret(const buffer_crypt::array_t &_s)
Definition: irods_ssl_object.hpp:97
irods::ssl_object::ssl
virtual SSL * ssl() const
Definition: irods_ssl_object.hpp:63
irods::ssl_object::encryption_algorithm
virtual std::string encryption_algorithm() const
Definition: irods_ssl_object.hpp:82
irods::ssl_object::num_hash_rounds
virtual int num_hash_rounds() const
Definition: irods_ssl_object.hpp:79
irods_buffer_encryption.hpp
irods::ssl_object::ssl_ctx_
SSL_CTX * ssl_ctx_
Definition: irods_ssl_object.hpp:115
irods
Definition: apiHandler.hpp:35
irods::ssl_object::ssl_ctx
virtual SSL_CTX * ssl_ctx() const
Definition: irods_ssl_object.hpp:60
irods::SSL_NETWORK_PLUGIN
const std::string SSL_NETWORK_PLUGIN("ssl")
irods::ssl_object::host
virtual void host(const std::string &_h)
Definition: irods_ssl_object.hpp:94
irods::ssl_object::resolve
virtual error resolve(const std::string &, plugin_ptr &)
Definition: irods_ssl_object.cpp:107
irods::ssl_object::ssl_
SSL * ssl_
Definition: irods_ssl_object.hpp:116
irods::error
Definition: irods_error.hpp:23
irods::ssl_object::shared_secret
virtual buffer_crypt::array_t shared_secret() const
Definition: irods_ssl_object.hpp:69
irods::ssl_object::ssl_object
ssl_object()
Definition: irods_ssl_object.cpp:13
irods::ssl_object::host_
std::string host_
Definition: irods_ssl_object.hpp:117
irods::ssl_object::num_hash_rounds
virtual void num_hash_rounds(int _h)
Definition: irods_ssl_object.hpp:107
irods::ssl_object::operator=
virtual ssl_object & operator=(const ssl_object &)
Definition: irods_ssl_object.cpp:71
irods::network_object
Definition: irods_network_object.hpp:18
irods::ssl_object_ptr
boost::shared_ptr< ssl_object > ssl_object_ptr
Definition: irods_ssl_object.hpp:129
irods::ssl_object::encryption_algorithm
virtual void encryption_algorithm(const std::string &_a)
Definition: irods_ssl_object.hpp:110
irods::ssl_object::num_hash_rounds_
int num_hash_rounds_
Definition: irods_ssl_object.hpp:122
irods::ssl_object::key_size_
int key_size_
Definition: irods_ssl_object.hpp:120
irods::ssl_object::shared_secret_
buffer_crypt::array_t shared_secret_
Definition: irods_ssl_object.hpp:118
irods::ssl_object::salt_size
virtual void salt_size(int _s)
Definition: irods_ssl_object.hpp:104
irods::ssl_object::operator==
virtual bool operator==(const ssl_object &_rhs) const
Definition: irods_ssl_object.cpp:88
irods::ssl_object::key_size
virtual int key_size() const
Definition: irods_ssl_object.hpp:73
irods::rule_engine_vars_t
std::map< std::string, std::string > rule_engine_vars_t
Definition: irods_first_class_object.hpp:20
irods::ssl_object::ssl_ctx
virtual void ssl_ctx(SSL_CTX *_c)
Definition: irods_ssl_object.hpp:88