All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
SSLSettings.h
1 // Copyright eeGeo Ltd (2012-2015), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Types.h"
6 #include "Web.h"
7 #include "ISSLSettings.h"
8 #include <string>
9 #include <vector>
10 
11 namespace Eegeo
12 {
13  namespace Web
14  {
15  class SSLSettings : public ISSLSettings
16  {
17  public:
18  SSLSettings();
19 
20  void EnableSSL();
21  void DisableSSL();
22  const bool SSLEnabled() const { return m_sslEnabled; };
23 
24  void AddSSLIgnorePattern(const std::string& sslIgnorePattern);
25  void RemoveSSLIgnorePattern(const std::string& sslIgnorePattern);
26  const bool ShouldIgnoreSSL(const std::string& url) const;
27 
28  void AddClientCertificateAuthenticationPattern(const std::string& clientCertificateAuthenticationPattern);
29  void RemoveClientCertificateAuthenticationPattern(const std::string& clientCertificateAuthenticationPattern);
30  const bool ShouldAuthenticateWithClientCertificate(const std::string& url) const;
31 
32  const void SetClientCertificateFilename(const std::string& clientCertFilename);
33  const std::string& GetClientCertificateFilename() const;
34 
35  const void SetKeyFilename(const std::string& keyFilename);
36  const std::string& GetKeyFilename() const;
37 
38  const void SetKeyPassword(const std::string& keyPassword);
39  const std::string& GetKeyPassword() const;
40 
41  private:
42  bool m_sslEnabled;
43  std::vector<std::string> m_sslIgnorePatterns;
44  std::vector<std::string> m_clientCertificateAuthenticationPatterns;
45  std::string m_clientCertificateFilename;
46  std::string m_keyFilename;
47  std::string m_keyPassword;
48  };
49  }
50 }