ldapsdk  0.0.1
TlsOptions.h
Go to the documentation of this file.
1 // $OpenLDAP$
2 /*
3  * Copyright 2010-2011 The OpenLDAP Foundation, All Rights Reserved.
4  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
5  */
6 #ifndef TLS_OPTIONS_H
7 #define TLS_OPTIONS_H
8 #include <string>
9 #include <ldap.h>
10 
21 class TlsOptions {
22  public:
23 
27  enum tls_option {
39  LASTOPT /* dummy */
41  };
42 
46  enum verifyMode {
47  NEVER=0,
52  };
53 
57  enum crlMode {
61  };
62 
63 
67  TlsOptions();
68 
99  void setOption(tls_option opt, const std::string& value) const;
100 
121  void setOption(tls_option opt, int value) const;
122 
127  void setOption(tls_option opt, void *value) const;
128 
135  int getIntOption(tls_option opt) const;
136 
143  std::string getStringOption(tls_option opt) const;
144 
152  void getOption(tls_option opt, void *value ) const;
153 
154  private:
155  TlsOptions( LDAP* ld );
156  void newCtx() const;
157  LDAP *m_ld;
158 
159  friend class LDAPAsynConnection;
160 };
161 
162 #endif /* TLS_OPTIONS_H */