Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(568)

Unified Diff: remoting/base/rsa_key_pair.cc

Issue 17265013: Remove platform-specific implementations of RSAPrivateKey and SignatureCreator (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update includes Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« net/cert/x509_util_nss.cc ('K') | « net/cert/x509_util_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« net/cert/x509_util_nss.cc ('K') | « net/cert/x509_util_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698