diff options
Diffstat (limited to 'remoting/host')
-rw-r--r-- | remoting/host/host_key_pair.cc | 14 | ||||
-rw-r--r-- | remoting/host/host_key_pair.h | 6 |
2 files changed, 10 insertions, 10 deletions
diff --git a/remoting/host/host_key_pair.cc b/remoting/host/host_key_pair.cc index 948b4ad..576bc1b 100644 --- a/remoting/host/host_key_pair.cc +++ b/remoting/host/host_key_pair.cc @@ -94,11 +94,15 @@ crypto::RSAPrivateKey* HostKeyPair::CopyPrivateKey() const { return crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(key_bytes); } -net::X509Certificate* HostKeyPair::GenerateCertificate() const { - return net::X509Certificate::CreateSelfSigned( - key_.get(), "CN=chromoting", - base::RandInt(1, std::numeric_limits<int>::max()), - base::TimeDelta::FromDays(1)); +std::string HostKeyPair::GenerateCertificate() const { + scoped_refptr<net::X509Certificate> cert = + net::X509Certificate::CreateSelfSigned( + key_.get(), "CN=chromoting", + base::RandInt(1, std::numeric_limits<int>::max()), + base::TimeDelta::FromDays(1)); + std::string result; + CHECK(cert->GetDEREncoded(&result)); + return result; } } // namespace remoting diff --git a/remoting/host/host_key_pair.h b/remoting/host/host_key_pair.h index c1f6082..32a15d0 100644 --- a/remoting/host/host_key_pair.h +++ b/remoting/host/host_key_pair.h @@ -15,10 +15,6 @@ namespace crypto { class RSAPrivateKey; } // namespace base -namespace net { -class X509Certificate; -} // namespace net - namespace remoting { class HostConfig; @@ -39,7 +35,7 @@ class HostKeyPair { // Make a new copy of private key. Caller will own the generated private key. crypto::RSAPrivateKey* CopyPrivateKey() const; - net::X509Certificate* GenerateCertificate() const; + std::string GenerateCertificate() const; private: scoped_ptr<crypto::RSAPrivateKey> key_; |