| 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_ME2ME_HOST_AUTHENTICATOR_FACTORY_H_ | 5 #ifndef REMOTING_PROTOCOL_ME2ME_HOST_AUTHENTICATOR_FACTORY_H_ |
| 6 #define REMOTING_PROTOCOL_ME2ME_HOST_AUTHENTICATOR_FACTORY_H_ | 6 #define REMOTING_PROTOCOL_ME2ME_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/authentication_method.h" | 13 #include "remoting/protocol/authentication_method.h" |
| 14 #include "remoting/protocol/authenticator.h" | 14 #include "remoting/protocol/authenticator.h" |
| 15 | 15 |
| 16 namespace crypto { | |
| 17 class RSAPrivateKey; | |
| 18 } // namespace crypto | |
| 19 | |
| 20 namespace remoting { | 16 namespace remoting { |
| 21 namespace protocol { | 17 namespace protocol { |
| 22 | 18 |
| 19 class KeyPair; |
| 20 |
| 23 class Me2MeHostAuthenticatorFactory : public AuthenticatorFactory { | 21 class Me2MeHostAuthenticatorFactory : public AuthenticatorFactory { |
| 24 public: | 22 public: |
| 25 // Doesn't take ownership of |local_private_key|. | 23 // Doesn't take ownership of |local_private_key|. |
| 26 Me2MeHostAuthenticatorFactory( | 24 Me2MeHostAuthenticatorFactory( |
| 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 SharedSecretHash& shared_secret_hash); | 27 const SharedSecretHash& shared_secret_hash); |
| 30 virtual ~Me2MeHostAuthenticatorFactory(); | 28 virtual ~Me2MeHostAuthenticatorFactory(); |
| 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_jid_prefix_; | 37 std::string local_jid_prefix_; |
| 40 std::string local_cert_; | 38 std::string local_cert_; |
| 41 scoped_ptr<crypto::RSAPrivateKey> local_private_key_; | 39 scoped_ptr<KeyPair> key_pair_; |
| 42 SharedSecretHash shared_secret_hash_; | 40 SharedSecretHash shared_secret_hash_; |
| 43 | 41 |
| 44 DISALLOW_COPY_AND_ASSIGN(Me2MeHostAuthenticatorFactory); | 42 DISALLOW_COPY_AND_ASSIGN(Me2MeHostAuthenticatorFactory); |
| 45 }; | 43 }; |
| 46 | 44 |
| 47 } // namespace protocol | 45 } // namespace protocol |
| 48 } // namespace remoting | 46 } // namespace remoting |
| 49 | 47 |
| 50 #endif // REMOTING_PROTOCOL_ME2ME_HOST_AUTHENTICATOR_FACTORY_H_ | 48 #endif // REMOTING_PROTOCOL_ME2ME_HOST_AUTHENTICATOR_FACTORY_H_ |
| OLD | NEW |