Mercurial > trustbridge > trustbridge
diff ui/sslconnection.h @ 1255:2a1aa9df8f11
(issue133) Improve API documentation
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Thu, 25 Sep 2014 17:58:12 +0200 |
parents | 78798d3af8f0 |
children |
line wrap: on
line diff
--- a/ui/sslconnection.h Thu Sep 25 17:37:03 2014 +0200 +++ b/ui/sslconnection.h Thu Sep 25 17:58:12 2014 +0200 @@ -10,7 +10,7 @@ /** * @file sslconnection.h - * @brief Qt wrapper around polarssl ssl api + * @brief Controller of the downloader network connection */ #include <QDebug> @@ -18,18 +18,38 @@ #include <QString> #include <QByteArray> +/** @brief Controller of the downloader network connection + * + * Base class of the SSL connection used. Offers a high + * level API that the downloader can use regardless of the + * concrete SSL implementation. + * + */ class SSLConnection { public: + /** + * @enum ErrorCode + * @brief Possible Errors of the SSL connection. + */ enum ErrorCode { + /*! Everything OK */ NoError, + /*! Failure before the SSL Handshake. Connection failure.*/ NoConnection, + /*! SSL Handshake failed. Probably unsupported ciphersuites.*/ SSLHandshakeFailed, + /*! The pinned certificate did not match with the server cert.*/ InvalidCertificate, + /*! The pinned certificate could not be parsed. Coding error!.*/ InvalidPinnedCertificate, + /*! The response from the server could not be parsed.*/ InvalidResponse, + /*! The connection was established but lost at one point.*/ ConnectionLost, + /*! A connection timeout was hit.*/ Timeout, + /*! The unexpected.*/ ErrUnknown }; @@ -44,7 +64,16 @@ virtual ~SSLConnection() {}; + /**@brief wether or not everything could be parsed and all options could be set. + * + * This should usually be true. Otherwise it is likely something wrong + * with the internal data or the used library versions. + * + * @returns false when some error occured during initalization. + **/ bool initialized() { return mInitialized; } + + /** @brief wether or not the connection has been established */ bool connected() { return mConnected; } ErrorCode getLastError() { return mErrorState; }