OLD | NEW |
---|---|
(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 class X509Certificate; | |
20 | |
21 // SSLServerSocket takes an already connected socket and performs SSL on top of | |
22 // it. | |
23 // | |
24 // This class is designed to work in peer-to-peer connection in pair with | |
agl
2010/12/17 18:30:50
s/in/in a/
| |
25 // SSLClientSocket and is not intended to be used as a standaline SSL server. | |
wtc
2010/12/17 18:08:04
Remove "in pair with SSLClientSocket", because the
agl
2010/12/17 18:30:50
s/standaline/standalone/
Alpha Left Google
2010/12/17 20:31:12
Done.
Alpha Left Google
2010/12/17 20:31:12
Done.
| |
26 class SSLServerSocket : public Socket { | |
27 public: | |
28 virtual ~SSLServerSocket() {} | |
29 | |
30 // Performs SSL server handshaking on an existing socket. The socket given | |
agl
2010/12/17 18:30:50
"Performs an SSL server handshake on the existing
Alpha Left Google
2010/12/17 20:31:12
Done.
| |
31 // to this object has to be already connected. | |
32 // | |
33 // This method takes a callback. Return true value of this method is the | |
agl
2010/12/17 18:30:50
"Accept either returns ERR_IO_PENDING, in which ca
Alpha Left Google
2010/12/17 20:31:12
Done.
| |
34 // error code of the handshaking operation. If the return value is | |
35 // net::ERR_IO_PENDING the given callback will be invoked in the future with | |
36 // an error code. Other values of error code returned by this method indicate | |
37 // the handshaking operation has completed synchronously. | |
38 virtual int Accept(CompletionCallback* callback) = 0; | |
39 }; | |
40 | |
41 // Creates an SSL server socket using an already connected socket. A certificate | |
42 // and private key needs to be provided. | |
43 // | |
44 // This created server socket will take ownership of |socket|. However |key| | |
45 // is copied. | |
46 // TODO(hclam): Defines ServerSocketFactory to create SSLServerSocket. This will | |
47 // make mocking easier. | |
48 SSLServerSocket* CreateSSLServerSocket( | |
49 Socket* socket, X509Certificate* certificate, base::RSAPrivateKey* key); | |
50 | |
51 } // namespace net | |
52 | |
53 #endif // NET_SOCKET_SSL_SERVER_SOCKET_NSS_H_ | |
OLD | NEW |