/* * Copyright (c) 2012 Tobias Markmann * Licensed under the simplified BSD license. * See Documentation/Licenses/BSD-simplified.txt for more information. */ #pragma once #include #include #include #include #include #include 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 getPeerCertificateChain() const; boost::shared_ptr getPeerCertificateVerificationError() const; virtual ByteArray getFinishMessage() const; private: enum State { Start, Connecting, Connected, Error }; State state_; }; }