Index: remoting/protocol/key_pair.h |
diff --git a/remoting/host/host_key_pair.h b/remoting/protocol/key_pair.h |
similarity index 77% |
rename from remoting/host/host_key_pair.h |
rename to remoting/protocol/key_pair.h |
index f7aa651a8d3d3f1db33e375fcb8ecfb957342ad3..a0e0a66549c5ef2843463651a5ef0159682f103c 100644 |
--- a/remoting/host/host_key_pair.h |
+++ b/remoting/protocol/key_pair.h |
@@ -2,8 +2,8 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef REMOTING_HOST_HOST_KEY_PAIR_H_ |
-#define REMOTING_HOST_HOST_KEY_PAIR_H_ |
+#ifndef REMOTING_PROTOCOL_KEY_PAIR_H_ |
+#define REMOTING_PROTOCOL_KEY_PAIR_H_ |
Wez
2013/02/23 03:43:20
remoting/base/ might be a better place for this, s
Sergey Ulanov
2013/02/26 00:14:13
+1 on putting it in remoting/base
rmsousa
2013/02/26 02:38:52
Done.
rmsousa
2013/02/26 02:38:52
Done.
|
#include <string> |
@@ -15,26 +15,19 @@ class RSAPrivateKey; |
} // namespace base |
namespace remoting { |
+namespace protocol { |
-class HostConfig; |
-class MutableHostConfig; |
- |
-class HostKeyPair { |
+class KeyPair { |
Sergey Ulanov
2013/02/26 00:14:13
Maybe call it RsaKeyPair? Or do you think we may w
rmsousa
2013/02/26 02:38:52
Its API isn't tied to RSA specifically, but on of
|
public: |
- HostKeyPair(); |
- ~HostKeyPair(); |
+ KeyPair(); |
+ ~KeyPair(); |
void Generate(); |
Wez
2013/02/23 03:43:20
Would you mind adding some comments to explain wha
rmsousa
2013/02/26 02:38:52
Done.
|
bool LoadFromString(const std::string& key_base64); |
- bool Load(const HostConfig& host_config); |
- void Save(MutableHostConfig* host_config); |
+ scoped_ptr<KeyPair> Copy(); |
crypto::RSAPrivateKey* private_key() { return key_.get(); } |
- std::string GetAsString() const; |
- std::string GetPublicKey() const; |
- std::string GetSignature(const std::string& message) const; |
- |
// Make a new copy of private key. Caller will own the generated private key. |
crypto::RSAPrivateKey* CopyPrivateKey() const; |
Wez
2013/02/23 03:43:20
Do we ever use this?
rmsousa
2013/02/26 02:38:52
Nope.
|
@@ -42,10 +35,15 @@ class HostKeyPair { |
// if cert generation fails (e.g. it may happen when the system clock is off). |
std::string GenerateCertificate() const; |
+ std::string GetAsString() const; |
Wez
2013/02/23 03:43:20
What does this get as a string? The private key?
Wez
2013/02/23 03:43:20
I'd move this back up to come after LoadFromString
rmsousa
2013/02/26 02:38:52
FromString() sounds a bit like a constructor, rath
rmsousa
2013/02/26 02:38:52
Done.
|
+ std::string GetPublicKey() const; |
+ std::string GetSignature(const std::string& message) const; |
Wez
2013/02/23 03:43:20
nit: SignMessage
|
+ |
private: |
scoped_ptr<crypto::RSAPrivateKey> key_; |
}; |
Wez
2013/02/23 03:43:20
DISALLOW_COPY...
rmsousa
2013/02/26 02:38:52
Done.
|
+} // namespace protocol |
} // namespace remoting |
-#endif // REMOTING_HOST_HOST_KEY_PAIR_H_ |
+#endif // REMOTING_PROTOCOL_KEY_PAIR_H_ |