summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-11-09 22:12:48 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-11-09 22:15:47 (GMT)
commitafae15f7cf212c993da8264a4ae89cf8729b3f86 (patch)
treea165f41a8c7b9fd3e6eee90bdf961013204bf09e /Swiften/TLS
parentbc5b3a02de2e9131bff940c9667f28b2ae588807 (diff)
downloadswift-contrib-afae15f7cf212c993da8264a4ae89cf8729b3f86.zip
swift-contrib-afae15f7cf212c993da8264a4ae89cf8729b3f86.tar.bz2
Added Doxygen documentation for some certificate APIs.
Diffstat (limited to 'Swiften/TLS')
-rw-r--r--Swiften/TLS/BlindCertificateTrustChecker.h8
-rw-r--r--Swiften/TLS/Certificate.h4
-rw-r--r--Swiften/TLS/CertificateTrustChecker.h8
3 files changed, 20 insertions, 0 deletions
diff --git a/Swiften/TLS/BlindCertificateTrustChecker.h b/Swiften/TLS/BlindCertificateTrustChecker.h
index 26a7f94..fc7fbe8 100644
--- a/Swiften/TLS/BlindCertificateTrustChecker.h
+++ b/Swiften/TLS/BlindCertificateTrustChecker.h
@@ -9,6 +9,14 @@
#include "Swiften/TLS/CertificateTrustChecker.h"
namespace Swift {
+ /**
+ * A certificate trust checker that trusts any ceritficate.
+ *
+ * This can be used to ignore any TLS certificate errors occurring
+ * during connection.
+ *
+ * \see Client::setAlwaysTrustCertificates()
+ */
class BlindCertificateTrustChecker : public CertificateTrustChecker {
public:
virtual bool isCertificateTrusted(Certificate::ref, const String&) {
diff --git a/Swiften/TLS/Certificate.h b/Swiften/TLS/Certificate.h
index 4a3cc8b..89c1de6 100644
--- a/Swiften/TLS/Certificate.h
+++ b/Swiften/TLS/Certificate.h
@@ -18,6 +18,10 @@ namespace Swift {
virtual ~Certificate();
+ /**
+ * Returns the textual representation of the full Subject
+ * name.
+ */
virtual String getSubjectName() const = 0;
virtual std::vector<String> getCommonNames() const = 0;
diff --git a/Swiften/TLS/CertificateTrustChecker.h b/Swiften/TLS/CertificateTrustChecker.h
index 070c4bb..7400dac 100644
--- a/Swiften/TLS/CertificateTrustChecker.h
+++ b/Swiften/TLS/CertificateTrustChecker.h
@@ -12,10 +12,18 @@
#include "Swiften/TLS/Certificate.h"
namespace Swift {
+ /**
+ * A class to implement a check for certificate trust.
+ */
class CertificateTrustChecker {
public:
virtual ~CertificateTrustChecker();
+ /**
+ * This method is called to find out whether a certificate is
+ * trusted. This usually happens when a certificate's validation
+ * fails, to check whether to proceed with the connection or not.
+ */
virtual bool isCertificateTrusted(Certificate::ref certificate, const String& domain) = 0;
};
}