OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2010 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_HOST_HOST_KEY_PAIR_H_ | |
6 #define REMOTING_HOST_HOST_KEY_PAIR_H_ | |
7 | |
8 #include <vector> | |
9 #include <string> | |
10 | |
11 #include "base/ref_counted.h" | |
12 #include "base/scoped_ptr.h" | |
13 | |
14 namespace base { | |
15 class RSAPrivateKey; | |
16 } | |
awong
2010/08/02 19:53:49
namespace :P
Sergey Ulanov
2010/08/03 02:10:39
Done.
| |
17 | |
18 namespace remoting { | |
19 | |
20 class HostConfig; | |
21 class MutableHostConfig; | |
22 | |
23 class HostKeyPair : public base::RefCountedThreadSafe<HostKeyPair> { | |
awong
2010/08/02 19:53:49
Does this thing really need to be refcounted? Do
Sergey Ulanov
2010/08/03 02:10:39
The only reason it needs to be ref-counted is beca
awong
2010/08/03 19:21:02
Ah! we solved that!
See the DISABLE_RUNNABLE_MET
| |
24 public: | |
25 HostKeyPair(); | |
26 virtual ~HostKeyPair(); | |
awong
2010/08/02 19:53:49
The HearbeatSender class didn't have a virtual des
Sergey Ulanov
2010/08/03 02:10:39
removed it.
| |
27 | |
28 void Generate(); | |
29 bool LoadFromString(const std::string& key_base64); | |
30 bool Load(HostConfig* host_config); | |
31 void Save(MutableHostConfig* host_config); | |
32 | |
33 std::string GetPublicKey() const; | |
34 std::string GetSignature(const std::string& message) const; | |
35 | |
36 private: | |
37 void DoSave(MutableHostConfig* host_config) const; | |
38 | |
39 scoped_ptr<base::RSAPrivateKey> key_; | |
40 }; | |
41 | |
42 } // namespace remoting | |
43 | |
44 #endif // REMOTING_HOST_HOST_KEY_PAIR_H_ | |
OLD | NEW |