OLD | NEW |
| (Empty) |
1 // Copyright (c) 2012 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 REMOTING_PROTOCOL_V1_AUTHENTICATOR_H_ | |
6 #define REMOTING_PROTOCOL_V1_AUTHENTICATOR_H_ | |
7 | |
8 #include "base/basictypes.h" | |
9 #include "base/compiler_specific.h" | |
10 #include "base/memory/scoped_ptr.h" | |
11 #include "remoting/protocol/authenticator.h" | |
12 | |
13 namespace crypto { | |
14 class RSAPrivateKey; | |
15 } // namespace base | |
16 | |
17 namespace remoting { | |
18 namespace protocol { | |
19 | |
20 class V1ClientAuthenticator : public Authenticator { | |
21 public: | |
22 V1ClientAuthenticator(const std::string& local_jid, | |
23 const std::string& shared_secret); | |
24 virtual ~V1ClientAuthenticator(); | |
25 | |
26 // Authenticator interface. | |
27 virtual State state() const OVERRIDE; | |
28 virtual RejectionReason rejection_reason() const OVERRIDE; | |
29 virtual void ProcessMessage(const buzz::XmlElement* message) OVERRIDE; | |
30 virtual scoped_ptr<buzz::XmlElement> GetNextMessage() OVERRIDE; | |
31 virtual scoped_ptr<ChannelAuthenticator> | |
32 CreateChannelAuthenticator() const OVERRIDE; | |
33 | |
34 private: | |
35 std::string local_jid_; | |
36 std::string shared_secret_; | |
37 std::string remote_cert_; | |
38 State state_; | |
39 RejectionReason rejection_reason_; | |
40 | |
41 DISALLOW_COPY_AND_ASSIGN(V1ClientAuthenticator); | |
42 }; | |
43 | |
44 class V1HostAuthenticator : public Authenticator { | |
45 public: | |
46 // Doesn't take ownership of |local_private_key|. | |
47 V1HostAuthenticator(const std::string& local_cert, | |
48 const crypto::RSAPrivateKey& local_private_key, | |
49 const std::string& shared_secret, | |
50 const std::string& remote_jid); | |
51 virtual ~V1HostAuthenticator(); | |
52 | |
53 // Authenticator interface. | |
54 virtual State state() const OVERRIDE; | |
55 virtual RejectionReason rejection_reason() const OVERRIDE; | |
56 virtual void ProcessMessage(const buzz::XmlElement* message) OVERRIDE; | |
57 virtual scoped_ptr<buzz::XmlElement> GetNextMessage() OVERRIDE; | |
58 virtual scoped_ptr<ChannelAuthenticator> | |
59 CreateChannelAuthenticator() const OVERRIDE; | |
60 | |
61 private: | |
62 std::string local_cert_; | |
63 scoped_ptr<crypto::RSAPrivateKey> local_private_key_; | |
64 std::string shared_secret_; | |
65 std::string remote_jid_; | |
66 State state_; | |
67 RejectionReason rejection_reason_; | |
68 | |
69 DISALLOW_COPY_AND_ASSIGN(V1HostAuthenticator); | |
70 }; | |
71 | |
72 } // namespace protocol | |
73 } // namespace remoting | |
74 | |
75 #endif // REMOTING_PROTOCOL_V1_AUTHENTICATOR_H_ | |
OLD | NEW |