| OLD | NEW |
| 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" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 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 |
| 41 // Generates self-signed certificate using the key pair. Returns empty string |
| 42 // if cert generation fails (e.g. it may happen when the system clock is off). |
| 40 std::string GenerateCertificate() const; | 43 std::string GenerateCertificate() const; |
| 41 | 44 |
| 42 private: | 45 private: |
| 43 scoped_ptr<crypto::RSAPrivateKey> key_; | 46 scoped_ptr<crypto::RSAPrivateKey> key_; |
| 44 }; | 47 }; |
| 45 | 48 |
| 46 } // namespace remoting | 49 } // namespace remoting |
| 47 | 50 |
| 48 #endif // REMOTING_HOST_HOST_KEY_PAIR_H_ | 51 #endif // REMOTING_HOST_HOST_KEY_PAIR_H_ |
| OLD | NEW |