Merge pull request #2216 from jwillemsen/jwi-cxxversionchecks
[ACE_TAO.git] / ACE / protocols / ace / INet / SSL_CertificateCallback.h
blobf6f49912f53c5fe9a207c1d215014ed04043e4f3
1 /**
2 * @file SSL_CertificateCallback.h
4 * @author Martin Corino <mcorino@remedy.nl>
5 */
7 #ifndef ACE_SSL_CERTIFICATECALLBACK_H
8 #define ACE_SSL_CERTIFICATECALLBACK_H
10 #include /**/ "ace/pre.h"
12 #include "ace/SString.h"
13 #include "ace/SSL/SSL_Context.h"
14 #include "ace/INet/SSL_X509Cert.h"
15 #include "ace/INet/INet_SSL_Export.h"
17 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
19 namespace ACE
21 namespace INet
23 /**
24 * @class ACE_INet_SSL_CertificateCallbackArg
26 * @brief Encapsulates the arguments for an SSL certificate
27 * verification callback.
30 class ACE_INET_SSL_Export SSL_CertificateCallbackArg
32 public:
33 SSL_CertificateCallbackArg (const ACE_SSL_Context* ssl_ctx,
34 ::X509_STORE_CTX* cert_ctx);
35 ~SSL_CertificateCallbackArg ();
37 const ACE_SSL_Context& context () const;
39 SSL_X509Cert& certificate ();
41 int error_depth () const;
43 int error_code () const;
45 ACE_CString error_message () const;
47 bool ignore_error () const;
49 void ignore_error (bool f);
51 private:
52 const ACE_SSL_Context* ssl_ctx_;
53 SSL_X509Cert ssl_cert_;
54 int err_depth_;
55 int err_code_;
56 bool ignore_err_;
59 /**
60 * @class ACE_INet_SSL_CertificateCallback
62 * @brief Abstract base class for SSL certificate
63 * verification callbacks.
66 class ACE_INET_SSL_Export SSL_CertificateCallback
68 public:
69 SSL_CertificateCallback ();
70 virtual ~SSL_CertificateCallback ();
72 virtual void handle_certificate_failure (SSL_CertificateCallbackArg& arg) = 0;
75 /**
76 * @class ACE_INet_SSL_CertificateAcceptor
78 * @brief Implements an SSL certificate callback that accepts
79 * all peer certificates.
82 class ACE_INET_SSL_Export SSL_CertificateAcceptor
83 : public SSL_CertificateCallback
85 public:
86 SSL_CertificateAcceptor ();
87 virtual ~SSL_CertificateAcceptor ();
89 virtual void handle_certificate_failure (SSL_CertificateCallbackArg& arg);
94 ACE_END_VERSIONED_NAMESPACE_DECL
96 #if defined (__ACE_INLINE__)
97 #include "ace/INet/SSL_CertificateCallback.inl"
98 #endif
100 #include /**/ "ace/post.h"
101 #endif /* ACE_SSL_CERTIFICATECALLBACK_H */