| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef REMOTING_PROTOCOL_IT2ME_HOST_AUTHENTICATOR_FACTORY_H_ | 5 #ifndef REMOTING_PROTOCOL_IT2ME_HOST_AUTHENTICATOR_FACTORY_H_ |
| 6 #define REMOTING_PROTOCOL_IT2ME_HOST_AUTHENTICATOR_FACTORY_H_ | 6 #define REMOTING_PROTOCOL_IT2ME_HOST_AUTHENTICATOR_FACTORY_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "remoting/protocol/authenticator.h" | 13 #include "remoting/protocol/authenticator.h" |
| 14 | 14 |
| 15 namespace crypto { | |
| 16 class RSAPrivateKey; | |
| 17 } // namespace crypto | |
| 18 | |
| 19 namespace remoting { | 15 namespace remoting { |
| 20 namespace protocol { | 16 namespace protocol { |
| 21 | 17 |
| 18 class KeyPair; |
| 19 |
| 22 // It2MeHostAuthenticatorFactory implements AuthenticatorFactory and | 20 // It2MeHostAuthenticatorFactory implements AuthenticatorFactory and |
| 23 // understands both the V2 and legacy V1 authentication mechanisms. | 21 // understands both the V2 and legacy V1 authentication mechanisms. |
| 24 class It2MeHostAuthenticatorFactory : public AuthenticatorFactory { | 22 class It2MeHostAuthenticatorFactory : public AuthenticatorFactory { |
| 25 public: | 23 public: |
| 26 It2MeHostAuthenticatorFactory( | 24 It2MeHostAuthenticatorFactory( |
| 27 const std::string& local_cert, | 25 const std::string& local_cert, |
| 28 const crypto::RSAPrivateKey& local_private_key, | 26 scoped_ptr<KeyPair> key_pair, |
| 29 const std::string& shared_secret); | 27 const std::string& shared_secret); |
| 30 virtual ~It2MeHostAuthenticatorFactory(); | 28 virtual ~It2MeHostAuthenticatorFactory(); |
| 31 | 29 |
| 32 // AuthenticatorFactory interface. | 30 // AuthenticatorFactory interface. |
| 33 virtual scoped_ptr<Authenticator> CreateAuthenticator( | 31 virtual scoped_ptr<Authenticator> CreateAuthenticator( |
| 34 const std::string& local_jid, | 32 const std::string& local_jid, |
| 35 const std::string& remote_jid, | 33 const std::string& remote_jid, |
| 36 const buzz::XmlElement* first_message) OVERRIDE; | 34 const buzz::XmlElement* first_message) OVERRIDE; |
| 37 | 35 |
| 38 private: | 36 private: |
| 39 std::string local_cert_; | 37 std::string local_cert_; |
| 40 scoped_ptr<crypto::RSAPrivateKey> local_private_key_; | 38 scoped_ptr<KeyPair> key_pair_; |
| 41 std::string shared_secret_; | 39 std::string shared_secret_; |
| 42 | 40 |
| 43 DISALLOW_COPY_AND_ASSIGN(It2MeHostAuthenticatorFactory); | 41 DISALLOW_COPY_AND_ASSIGN(It2MeHostAuthenticatorFactory); |
| 44 }; | 42 }; |
| 45 | 43 |
| 46 } // namespace protocol | 44 } // namespace protocol |
| 47 } // namespace remoting | 45 } // namespace remoting |
| 48 | 46 |
| 49 #endif // REMOTING_PROTOCOL_IT2ME_HOST_AUTHENTICATOR_FACTORY_H_ | 47 #endif // REMOTING_PROTOCOL_IT2ME_HOST_AUTHENTICATOR_FACTORY_H_ |
| OLD | NEW |