summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2015-10-23 14:31:09 (GMT)
committerSwift Review <review@swift.im>2015-10-30 17:37:59 (GMT)
commit4a6950af0f324091553f7ab7271de45721b8667f (patch)
treeed595c54d3d7e3047ed0a5f452ce95dfc188051a /Swiften/TLS/SecureTransport/SecureTransportCertificate.h
parent7f321edd9ada1f531b1fbc3325ef61449218f40c (diff)
downloadswift-4a6950af0f324091553f7ab7271de45721b8667f.zip
swift-4a6950af0f324091553f7ab7271de45721b8667f.tar.bz2
Add support for OS X Secure Transport TLS backend
Added integration tests for certificate validation and revocation behavior checking. Test-Information: Tested client login over TLS against Prosody and M-Link. Verified client certificate authentication works against M-Link. Change-Id: I6ad870f17adbf279f3bac913a3076909308a0021
Diffstat (limited to 'Swiften/TLS/SecureTransport/SecureTransportCertificate.h')
-rw-r--r--Swiften/TLS/SecureTransport/SecureTransportCertificate.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/Swiften/TLS/SecureTransport/SecureTransportCertificate.h b/Swiften/TLS/SecureTransport/SecureTransportCertificate.h
new file mode 100644
index 0000000..b8d3728
--- /dev/null
+++ b/Swiften/TLS/SecureTransport/SecureTransportCertificate.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2015 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
+#pragma once
+
+#include <boost/shared_ptr.hpp>
+#include <boost/type_traits.hpp>
+
+#include <Security/SecCertificate.h>
+
+#include <Swiften/TLS/Certificate.h>
+
+namespace Swift {
+
+class SecureTransportCertificate : public Certificate {
+public:
+ SecureTransportCertificate(SecCertificateRef certificate);
+ SecureTransportCertificate(const ByteArray& der);
+ virtual ~SecureTransportCertificate();
+
+ virtual std::string getSubjectName() const;
+ virtual std::vector<std::string> getCommonNames() const;
+ virtual std::vector<std::string> getSRVNames() const;
+ virtual std::vector<std::string> getDNSNames() const;
+ virtual std::vector<std::string> getXMPPAddresses() const;
+
+ virtual ByteArray toDER() const;
+
+private:
+ void parse();
+ typedef boost::remove_pointer<SecCertificateRef>::type SecCertificate;
+
+private:
+ boost::shared_ptr<SecCertificate> certificateHandle_;
+ std::string subjectName_;
+ std::vector<std::string> commonNames_;
+ std::vector<std::string> srvNames_;
+ std::vector<std::string> dnsNames_;
+ std::vector<std::string> xmppAddresses_;
+};
+
+}