/* */ #ifndef D_LIBGNUTLS_TLS_CONTEXT_H #define D_LIBGNUTLS_TLS_CONTEXT_H #include "common.h" #include #include #include "DlAbortEx.h" namespace aria2 { class TLSContext { private: gnutls_certificate_credentials_t certCred_; bool good_; bool peerVerificationEnabled_; public: TLSContext(); ~TLSContext(); // private key `keyfile' must be decrypted. bool addClientKeyFile(const std::string& certfile, const std::string& keyfile); // certfile can contain multiple certificates. bool addTrustedCACertFile(const std::string& certfile); bool good() const; bool bad() const; gnutls_certificate_credentials_t getCertCred() const; void enablePeerVerification(); void disablePeerVerification(); bool peerVerificationEnabled() const; }; } // namespace aria2 #endif // D_LIBGNUTLS_TLS_CONTEXT_H