#ifndef SSL_H_ #define SSL_H_ #include namespace dcpp { namespace ssl { template class scoped_handle { public: explicit scoped_handle(T* t_ = 0) : t(t_) { } ~scoped_handle() { Release(t); } operator T*() { return t; } operator const T*() const { return t; } T* operator->() { return t; } const T* operator->() const { return t; } void reset(T* t_ = NULL) { Release(t); t = t_; } private: scoped_handle(const scoped_handle&); scoped_handle& operator=(const scoped_handle&); T* t; }; typedef scoped_handle BIGNUM; typedef scoped_handle DH; typedef scoped_handle DSA; typedef scoped_handle EVP_PKEY; typedef scoped_handle RSA; typedef scoped_handle SSL; typedef scoped_handle SSL_CTX; typedef scoped_handle X509; typedef scoped_handle X509_NAME; std::string X509_digest(::X509* x509, const ::EVP_MD* md); } } #endif /*SSL_H_*/