Index: remoting/base/rsa_key_pair.cc |
diff --git a/remoting/base/rsa_key_pair.cc b/remoting/base/rsa_key_pair.cc |
index 9f8b11f03c690911b028cada25e744be0f9b7743..3461d4a4156063de907895f8fadccb6e1984037e 100644 |
--- a/remoting/base/rsa_key_pair.cc |
+++ b/remoting/base/rsa_key_pair.cc |
@@ -14,7 +14,7 @@ |
#include "base/time.h" |
#include "crypto/rsa_private_key.h" |
#include "crypto/signature_creator.h" |
-#include "net/cert/x509_certificate.h" |
+#include "net/cert/x509_util.h" |
namespace remoting { |
@@ -92,17 +92,14 @@ std::string RsaKeyPair::SignMessage(const std::string& message) const { |
} |
std::string RsaKeyPair::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)); |
- if (!cert.get()) |
- return std::string(); |
- |
std::string encoded; |
wtc
2013/06/20 21:35:56
Nit: not we can name this variable |cert| or |der_
|
- bool result = net::X509Certificate::GetDEREncoded(cert->os_cert_handle(), |
- &encoded); |
+ bool result = net::x509_util::CreateSelfSignedCert( |
+ key_.get(), |
+ "CN=chromoting", |
+ base::RandInt(1, std::numeric_limits<int>::max()), |
+ base::Time::Now(), |
+ base::Time::Now() + base::TimeDelta::FromDays(1), |
+ &encoded); |
CHECK(result); |
return encoded; |
} |