Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1461)

Side by Side Diff: net/socket/ssl_server_socket.h

Issue 5746003: Defines SSLServerSocket and implements SSLServerSocketNSS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: convert cert and key Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/socket/ssl_client_socket_nss.cc ('k') | net/socket/ssl_server_socket_nss.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef NET_SOCKET_SSL_SERVER_SOCKET_H_
6 #define NET_SOCKET_SSL_SERVER_SOCKET_H_
7
8 #include "base/basictypes.h"
9 #include "net/base/completion_callback.h"
10 #include "net/socket/socket.h"
11
12 namespace base {
13 class RSAPrivateKey;
14 } // namespace base
15
16 namespace net {
17
18 class IOBuffer;
19 struct SSLConfig;
20 class X509Certificate;
21
22 // SSLServerSocket takes an already connected socket and performs SSL on top of
23 // it.
24 //
25 // This class is designed to work in a peer-to-peer connection and is not
26 // intended to be used as a standalone SSL server.
27 class SSLServerSocket : public Socket {
28 public:
29 virtual ~SSLServerSocket() {}
30
31 // Performs an SSL server handshake on the existing socket. The given socket
32 // must have already been connected.
33 //
34 // Accept either returns ERR_IO_PENDING, in which case the given callback
35 // will be called in the future with the real result, or it completes
36 // synchronously, returning the result immediately.
37 virtual int Accept(CompletionCallback* callback) = 0;
38 };
39
40 // Creates an SSL server socket using an already connected socket. A certificate
41 // and private key needs to be provided.
42 //
43 // This created server socket will take ownership of |socket|. However |key|
44 // is copied.
45 // TODO(hclam): Defines ServerSocketFactory to create SSLServerSocket. This will
46 // make mocking easier.
47 SSLServerSocket* CreateSSLServerSocket(
48 Socket* socket, X509Certificate* certificate, base::RSAPrivateKey* key,
49 const SSLConfig& ssl_config);
50
51 } // namespace net
52
53 #endif // NET_SOCKET_SSL_SERVER_SOCKET_NSS_H_
OLDNEW
« no previous file with comments | « net/socket/ssl_client_socket_nss.cc ('k') | net/socket/ssl_server_socket_nss.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698