blob: a6b1904e5b59e8780fd3a5ba08dff80e259f15e8 [file] [log] [blame]
[email protected]d7c6cc22012-02-05 05:19:271// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]dd9ce7c7f2011-08-02 01:54:082// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef REMOTING_PROTOCOL_CHANNEL_AUTHENTICATOR_H_
6#define REMOTING_PROTOCOL_CHANNEL_AUTHENTICATOR_H_
7
8#include <string>
9
[email protected]34deb102011-12-22 13:06:0410#include "base/callback_forward.h"
[email protected]dd9ce7c7f2011-08-02 01:54:0811
[email protected]dd9ce7c7f2011-08-02 01:54:0812namespace remoting {
13namespace protocol {
14
sergeyuaa22c082015-07-20 19:41:1315class P2PStreamSocket;
16
[email protected]8d1f8752011-11-23 03:58:4317// Interface for channel authentications that perform channel-level
18// authentication. Depending on implementation channel authenticators
19// may also establish SSL connection. Each instance of this interface
20// should be used only once for one channel.
21class ChannelAuthenticator {
[email protected]dd9ce7c7f2011-08-02 01:54:0822 public:
dcheng0765c492016-04-06 22:41:5323 typedef base::Callback<void(int error, std::unique_ptr<P2PStreamSocket>)>
[email protected]8d1f8752011-11-23 03:58:4324 DoneCallback;
[email protected]dd9ce7c7f2011-08-02 01:54:0825
[email protected]8d1f8752011-11-23 03:58:4326 virtual ~ChannelAuthenticator() {}
[email protected]dd9ce7c7f2011-08-02 01:54:0827
sergeyu9cb142f2014-09-12 20:43:0128 // Start authentication of the given |socket|. |done_callback| is called when
29 // authentication is finished. Callback may be invoked before this method
30 // returns, and may delete the calling authenticator.
dcheng0765c492016-04-06 22:41:5331 virtual void SecureAndAuthenticate(std::unique_ptr<P2PStreamSocket> socket,
32 const DoneCallback& done_callback) = 0;
[email protected]dd9ce7c7f2011-08-02 01:54:0833};
34
35} // namespace protocol
36} // namespace remoting
37
38#endif // REMOTING_PROTOCOL_CHANNEL_AUTHENTICATOR_H_