From 5bdf2b4b687c33bb83ed28bab6ed35da20a4d50e Mon Sep 17 00:00:00 2001 From: "rsleevi@chromium.org" Date: Tue, 1 Nov 2011 03:15:29 +0000 Subject: Make X509Certificate::GetDEREncoded a static function taking an OSCertHandle Rather than require an X509Certificate*, which has additional processing overhead, make X509Certificate::GetDEREncoded a static function which takes an OSCertHandle. Callers which already have an X509Certificate* can easily use ->os_cert_handle(), while those that have an OSCertHandle, such as by way of GetIntermediateCertificates(), can use the OSCertHandle directly. BUG=91464 TEST=none Review URL: http://codereview.chromium.org/8414047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108067 0039d316-1c4b-4281-b951-d872f2087c98 --- remoting/host/host_key_pair.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'remoting') diff --git a/remoting/host/host_key_pair.cc b/remoting/host/host_key_pair.cc index 576bc1b..4f81aa8 100644 --- a/remoting/host/host_key_pair.cc +++ b/remoting/host/host_key_pair.cc @@ -100,9 +100,11 @@ std::string HostKeyPair::GenerateCertificate() const { key_.get(), "CN=chromoting", base::RandInt(1, std::numeric_limits::max()), base::TimeDelta::FromDays(1)); - std::string result; - CHECK(cert->GetDEREncoded(&result)); - return result; + std::string encoded; + bool result = net::X509Certificate::GetDEREncoded(cert->os_cert_handle(), + &encoded); + CHECK(result); + return encoded; } } // namespace remoting -- cgit v1.1