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

Side by Side Diff: remoting/host/host_key_pair.cc

Issue 8414047: Make X509Certificate::GetDEREncoded a static function taking an OSCertHandle (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase and tweak comment to wtc's verbiage Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/socket_stream/socket_stream.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "remoting/host/host_key_pair.h" 5 #include "remoting/host/host_key_pair.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 CHECK(key_->ExportPrivateKey(&key_bytes)); 93 CHECK(key_->ExportPrivateKey(&key_bytes));
94 return crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(key_bytes); 94 return crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(key_bytes);
95 } 95 }
96 96
97 std::string HostKeyPair::GenerateCertificate() const { 97 std::string HostKeyPair::GenerateCertificate() const {
98 scoped_refptr<net::X509Certificate> cert = 98 scoped_refptr<net::X509Certificate> cert =
99 net::X509Certificate::CreateSelfSigned( 99 net::X509Certificate::CreateSelfSigned(
100 key_.get(), "CN=chromoting", 100 key_.get(), "CN=chromoting",
101 base::RandInt(1, std::numeric_limits<int>::max()), 101 base::RandInt(1, std::numeric_limits<int>::max()),
102 base::TimeDelta::FromDays(1)); 102 base::TimeDelta::FromDays(1));
103 std::string result; 103 std::string encoded;
104 CHECK(cert->GetDEREncoded(&result)); 104 bool result = net::X509Certificate::GetDEREncoded(cert->os_cert_handle(),
105 return result; 105 &encoded);
106 CHECK(result);
107 return encoded;
106 } 108 }
107 109
108 } // namespace remoting 110 } // namespace remoting
OLDNEW
« no previous file with comments | « net/socket_stream/socket_stream.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698