OLD | NEW |
(Empty) | |
| 1 // Copyright 2013 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_PAIRING_HOST_AUTHENTICATOR_H_ |
| 6 #define REMOTING_PROTOCOL_PAIRING_HOST_AUTHENTICATOR_H_ |
| 7 |
| 8 #include "base/memory/weak_ptr.h" |
| 9 #include "remoting/protocol/pairing_authenticator_base.h" |
| 10 |
| 11 namespace remoting { |
| 12 |
| 13 class RsaKeyPair; |
| 14 |
| 15 namespace protocol { |
| 16 |
| 17 class PairingRegistry; |
| 18 |
| 19 class PairingHostAuthenticator : public PairingAuthenticatorBase { |
| 20 public: |
| 21 PairingHostAuthenticator( |
| 22 scoped_refptr<PairingRegistry> pairing_registry, |
| 23 const std::string& local_cert, |
| 24 scoped_refptr<RsaKeyPair> key_pair, |
| 25 const std::string& pin); |
| 26 virtual ~PairingHostAuthenticator(); |
| 27 |
| 28 // Authenticator interface. |
| 29 virtual State state() const OVERRIDE; |
| 30 virtual RejectionReason rejection_reason() const OVERRIDE; |
| 31 virtual void ProcessMessage(const buzz::XmlElement* message, |
| 32 const base::Closure& resume_callback) OVERRIDE; |
| 33 |
| 34 private: |
| 35 // PairingAuthenticatorBase interface. |
| 36 virtual void CreateV2AuthenticatorWithPIN( |
| 37 State initial_state, |
| 38 const SetAuthenticatorCallback& callback) OVERRIDE; |
| 39 virtual void AddPairingElements(buzz::XmlElement* message) OVERRIDE; |
| 40 |
| 41 // Protocol state. |
| 42 scoped_refptr<PairingRegistry> pairing_registry_; |
| 43 std::string local_cert_; |
| 44 scoped_refptr<RsaKeyPair> key_pair_; |
| 45 const std::string& pin_; |
| 46 bool protocol_error_; |
| 47 |
| 48 base::WeakPtrFactory<PairingHostAuthenticator> weak_factory_; |
| 49 |
| 50 DISALLOW_COPY_AND_ASSIGN(PairingHostAuthenticator); |
| 51 }; |
| 52 |
| 53 } // namespace protocol |
| 54 } // namespace remoting |
| 55 |
| 56 #endif // REMOTING_PROTOCOL_PAIRING_AUTHENTICATOR_H_ |
OLD | NEW |