00001 #ifndef DV_SSL_X509CERT_H 00002 #define DV_SSL_X509CERT_H 00003 00004 // $Id: x509cert.h,v 1.8 2008/03/15 10:15:25 dvermeir Exp $ 00005 00006 #include <stdexcept> 00007 #include <dvssl/sslsocket.h> 00008 00009 namespace Dv { 00010 namespace Ssl { 00011 /** Represents a X509 certificate. */ 00012 class X509Certificate { 00013 public: 00014 /** Constructor. The server certificate is retrieved from the client socket. 00015 * @param so open Dv::Ssl::Socket 00016 * @exception std::runtime_error if no certificate obtained. 00017 */ 00018 X509Certificate(const Socket& so) throw (std::runtime_error); 00019 /** Destructor. */ 00020 ~X509Certificate() {} 00021 00022 /** Name appearing in certificate. 00023 * @return name appearing in certificate 00024 */ 00025 const std::string& name() const { return name_; } 00026 /** Issuer appearing in certificate. 00027 * @return issuer appearing in certificate 00028 */ 00029 const std::string& issuer() const { return issuer_; } 00030 private: 00031 std::string name_; 00032 std::string issuer_; 00033 }; 00034 } 00035 } 00036 #endif 00037