Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Side by Side Diff: remoting/protocol/v1_authenticator.h

Issue 8727014: Implement RSAPrivateKey::Copy() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_V1_AUTHENTICATOR_H_ 5 #ifndef REMOTING_PROTOCOL_V1_AUTHENTICATOR_H_
6 #define REMOTING_PROTOCOL_V1_AUTHENTICATOR_H_ 6 #define REMOTING_PROTOCOL_V1_AUTHENTICATOR_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 virtual ~V1HostAuthenticator(); 47 virtual ~V1HostAuthenticator();
48 48
49 // Authenticator interface. 49 // Authenticator interface.
50 virtual State state() const OVERRIDE; 50 virtual State state() const OVERRIDE;
51 virtual void ProcessMessage(const buzz::XmlElement* message) OVERRIDE; 51 virtual void ProcessMessage(const buzz::XmlElement* message) OVERRIDE;
52 virtual buzz::XmlElement* GetNextMessage() OVERRIDE; 52 virtual buzz::XmlElement* GetNextMessage() OVERRIDE;
53 virtual ChannelAuthenticator* CreateChannelAuthenticator() const OVERRIDE; 53 virtual ChannelAuthenticator* CreateChannelAuthenticator() const OVERRIDE;
54 54
55 private: 55 private:
56 std::string local_cert_; 56 std::string local_cert_;
57 crypto::RSAPrivateKey* local_private_key_; 57 scoped_ptr<crypto::RSAPrivateKey> local_private_key_;
58 std::string shared_secret_; 58 std::string shared_secret_;
59 std::string remote_jid_; 59 std::string remote_jid_;
60 State state_; 60 State state_;
61 61
62 DISALLOW_COPY_AND_ASSIGN(V1HostAuthenticator); 62 DISALLOW_COPY_AND_ASSIGN(V1HostAuthenticator);
63 }; 63 };
64 64
65 class V1HostAuthenticatorFactory : public AuthenticatorFactory { 65 class V1HostAuthenticatorFactory : public AuthenticatorFactory {
66 public: 66 public:
67 // Doesn't take ownership of |local_private_key|. 67 // Doesn't take ownership of |local_private_key|.
68 V1HostAuthenticatorFactory(const std::string& local_cert, 68 V1HostAuthenticatorFactory(const std::string& local_cert,
69 crypto::RSAPrivateKey* local_private_key, 69 const crypto::RSAPrivateKey* local_private_key,
70 const std::string& shared_secret); 70 const std::string& shared_secret);
71 virtual ~V1HostAuthenticatorFactory(); 71 virtual ~V1HostAuthenticatorFactory();
72 72
73 // AuthenticatorFactory interface. 73 // AuthenticatorFactory interface.
74 virtual Authenticator* CreateAuthenticator( 74 virtual Authenticator* CreateAuthenticator(
75 const std::string& remote_jid, 75 const std::string& remote_jid,
76 const buzz::XmlElement* first_message) OVERRIDE; 76 const buzz::XmlElement* first_message) OVERRIDE;
77 77
78 private: 78 private:
79 std::string local_cert_; 79 std::string local_cert_;
80 scoped_ptr<crypto::RSAPrivateKey> local_private_key_; 80 scoped_ptr<crypto::RSAPrivateKey> local_private_key_;
81 std::string shared_secret_; 81 std::string shared_secret_;
82 82
83 DISALLOW_COPY_AND_ASSIGN(V1HostAuthenticatorFactory); 83 DISALLOW_COPY_AND_ASSIGN(V1HostAuthenticatorFactory);
84 }; 84 };
85 85
86 } // namespace protocol 86 } // namespace protocol
87 } // namespace remoting 87 } // namespace remoting
88 88
89 #endif // REMOTING_PROTOCOL_V1_AUTHENTICATOR_H_ 89 #endif // REMOTING_PROTOCOL_V1_AUTHENTICATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698