SecureSocket.h revision 5ebdc799
1/*
2 * Copyright 2011, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
4 */
5#ifndef _SECURE_SOCKET_H
6#define _SECURE_SOCKET_H
7
8
9#include <Socket.h>
10
11
12class BCertificate;
13
14
15class BSecureSocket : public BSocket {
16public:
17								BSecureSocket();
18								BSecureSocket(const BNetworkAddress& peer,
19									bigtime_t timeout = B_INFINITE_TIMEOUT);
20								BSecureSocket(const BSecureSocket& other);
21	virtual						~BSecureSocket();
22
23	virtual bool				CertificateVerificationFailed(BCertificate);
24
25	// BSocket implementation
26
27	virtual	status_t			Connect(const BNetworkAddress& peer,
28									bigtime_t timeout = B_INFINITE_TIMEOUT);
29	virtual	void				Disconnect();
30
31	virtual	status_t			WaitForReadable(bigtime_t timeout
32										= B_INFINITE_TIMEOUT) const;
33
34	// BDataIO implementation
35
36	virtual ssize_t				Read(void* buffer, size_t size);
37	virtual ssize_t				Write(const void* buffer, size_t size);
38
39private:
40	friend class BCertificate;
41			class Private;
42			Private*			fPrivate;
43};
44
45
46#endif	// _SECURE_SOCKET_H
47