summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2012-08-30 18:56:46 (GMT)
committerTobias Markmann <tm@ayena.de>2012-08-30 18:56:46 (GMT)
commit49aa0ddd615ac5694cec69e380ce3773a1fe32ed (patch)
tree63714caffacba172f3e71724d7d145a525b31ad9 /Swiften/TLS/SecureTransport/SecureTransportContext.h
parent6856199274e9c5e581220fccf520b8f011519d17 (diff)
downloadswift-contrib-49aa0ddd615ac5694cec69e380ce3773a1fe32ed.zip
swift-contrib-49aa0ddd615ac5694cec69e380ce3773a1fe32ed.tar.bz2
Dummy SecureTransport TLS backend. Mostly scons integration fail.tobias/cocoa-ssl
Diffstat (limited to 'Swiften/TLS/SecureTransport/SecureTransportContext.h')
-rw-r--r--Swiften/TLS/SecureTransport/SecureTransportContext.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/Swiften/TLS/SecureTransport/SecureTransportContext.h b/Swiften/TLS/SecureTransport/SecureTransportContext.h
new file mode 100644
index 0000000..95fb929
--- /dev/null
+++ b/Swiften/TLS/SecureTransport/SecureTransportContext.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2012 Tobias Markmann
+ * Licensed under the simplified BSD license.
+ * See Documentation/Licenses/BSD-simplified.txt for more information.
+ */
+
+#pragma once
+
+#include <Security/SecureTransport.h>
+#include <Swiften/Base/boost_bsignals.h>
+#include <boost/noncopyable.hpp>
+
+#include <Swiften/TLS/TLSContext.h>
+#include <Swiften/Base/ByteArray.h>
+#include <Swiften/TLS/CertificateWithKey.h>
+
+namespace Swift {
+
+ class SecureTransportContext : public TLSContext, boost::noncopyable {
+ public:
+ SecureTransportContext();
+ ~SecureTransportContext();
+
+ void connect();
+ bool setClientCertificate(CertificateWithKey::ref cert);
+
+ void handleDataFromNetwork(const SafeByteArray&);
+ void handleDataFromApplication(const SafeByteArray&);
+
+ std::vector<Certificate::ref> getPeerCertificateChain() const;
+ boost::shared_ptr<CertificateVerificationError> getPeerCertificateVerificationError() const;
+
+ virtual ByteArray getFinishMessage() const;
+
+
+ private:
+ enum State { Start, Connecting, Connected, Error };
+
+ State state_;
+
+ };
+}