Back to index

nordugrid-arc-nox  1.1.0~rc6
ConfigTLSMCC.h
Go to the documentation of this file.
00001 #ifndef __ARC_CONFIGTLSMCC_H__
00002 #define __ARC_CONFIGTLSMCC_H__
00003 
00004 #include <vector>
00005 
00006 #include <openssl/ssl.h>
00007 
00008 #include <arc/XMLNode.h>
00009 #include <arc/Logger.h>
00010 
00011 namespace Arc {
00012 
00013 class ConfigTLSMCC {
00014  private:  
00015   std::string ca_dir_;
00016   std::string ca_file_;
00017   std::string proxy_file_;
00018   std::string cert_file_;
00019   std::string key_file_;
00020   bool client_authn_;
00021   bool globus_policy_;
00022   enum {
00023     tls_handshake,
00024     ssl3_handshake
00025   } handshake_;
00026   std::vector<std::string> vomscert_trust_dn_;
00027   ConfigTLSMCC(void);
00028  public:
00029   ConfigTLSMCC(XMLNode cfg,Logger& logger,bool client = false);
00030   const std::string& CADir(void) const { return ca_dir_; };
00031   const std::string& CAFile(void) const { return ca_file_; };
00032   const std::string& ProxyFile(void) const { return proxy_file_; };
00033   const std::string& CertFile(void) const { return cert_file_; };
00034   const std::string& KeyFile(void) const { return key_file_; };
00035   bool GlobusPolicy(void) const { return globus_policy_; };
00036   const std::vector<std::string>& VOMSCertTrustDN(void) { return vomscert_trust_dn_; };
00037   bool Set(SSL_CTX* sslctx,Logger& logger);
00038   bool IfClientAuthn(void) const { return client_authn_; };
00039   bool IfTLSHandshake(void) const { return handshake_ == tls_handshake; };
00040   bool IfSSLv3Handshake(void) const { return handshake_ == ssl3_handshake; };
00041 };
00042 
00043 } // namespace Arc 
00044 
00045 #endif /* __ARC_CONFIGTLSMCC_H__ */
00046