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

Side by Side Diff: remoting/host/host_key_pair.h

Issue 10007048: Cleanup and simplify HostConfig and JsonHostConfig. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 months 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
« no previous file with comments | « remoting/host/host_config.h ('k') | remoting/host/host_key_pair.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_HOST_HOST_KEY_PAIR_H_ 5 #ifndef REMOTING_HOST_HOST_KEY_PAIR_H_
6 #define REMOTING_HOST_HOST_KEY_PAIR_H_ 6 #define REMOTING_HOST_HOST_KEY_PAIR_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 12
13 namespace crypto { 13 namespace crypto {
14 class RSAPrivateKey; 14 class RSAPrivateKey;
15 } // namespace base 15 } // namespace base
16 16
17 namespace remoting { 17 namespace remoting {
18 18
19 class HostConfig; 19 class HostConfig;
20 class MutableHostConfig; 20 class MutableHostConfig;
21 21
22 class HostKeyPair { 22 class HostKeyPair {
23 public: 23 public:
24 HostKeyPair(); 24 HostKeyPair();
25 ~HostKeyPair(); 25 ~HostKeyPair();
26 26
27 void Generate(); 27 void Generate();
28 bool LoadFromString(const std::string& key_base64); 28 bool LoadFromString(const std::string& key_base64);
29 bool Load(HostConfig* host_config); 29 bool Load(const HostConfig& host_config);
30 void Save(MutableHostConfig* host_config); 30 void Save(MutableHostConfig* host_config);
31 31
32 crypto::RSAPrivateKey* private_key() { return key_.get(); } 32 crypto::RSAPrivateKey* private_key() { return key_.get(); }
33 33
34 std::string GetAsString() const; 34 std::string GetAsString() const;
35 std::string GetPublicKey() const; 35 std::string GetPublicKey() const;
36 std::string GetSignature(const std::string& message) const; 36 std::string GetSignature(const std::string& message) const;
37 37
38 // Make a new copy of private key. Caller will own the generated private key. 38 // Make a new copy of private key. Caller will own the generated private key.
39 crypto::RSAPrivateKey* CopyPrivateKey() const; 39 crypto::RSAPrivateKey* CopyPrivateKey() const;
40 std::string GenerateCertificate() const; 40 std::string GenerateCertificate() const;
41 41
42 private: 42 private:
43 scoped_ptr<crypto::RSAPrivateKey> key_; 43 scoped_ptr<crypto::RSAPrivateKey> key_;
44 }; 44 };
45 45
46 } // namespace remoting 46 } // namespace remoting
47 47
48 #endif // REMOTING_HOST_HOST_KEY_PAIR_H_ 48 #endif // REMOTING_HOST_HOST_KEY_PAIR_H_
OLDNEW
« no previous file with comments | « remoting/host/host_config.h ('k') | remoting/host/host_key_pair.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698