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 <string> |
| 9 |
| 10 #include "base/ref_counted.h" |
| 11 #include "base/scoped_ptr.h" |
| 12 #include "base/task.h" |
| 13 |
| 14 namespace base { |
| 15 class RSAPrivateKey; |
| 16 } // namespace base |
| 17 |
| 18 namespace remoting { |
| 19 |
| 20 class HostConfig; |
| 21 class MutableHostConfig; |
| 22 |
| 23 class HostKeyPair { |
| 24 public: |
| 25 HostKeyPair(); |
| 26 ~HostKeyPair(); |
| 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 DISABLE_RUNNABLE_METHOD_REFCOUNT(remoting::HostKeyPair); |
| 45 |
| 46 #endif // REMOTING_HOST_HOST_KEY_PAIR_H_ |
OLD | NEW |