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