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

Side by Side Diff: remoting/base/rsa_key_pair.cc

Issue 15782010: Update remoting/ and jingle/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/base/compound_buffer_unittest.cc ('k') | remoting/base/rsa_key_pair_unittest.cc » ('j') | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/base/rsa_key_pair.h" 5 #include "remoting/base/rsa_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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 base::Base64Encode(signature_str, &signature_base64); 90 base::Base64Encode(signature_str, &signature_base64);
91 return signature_base64; 91 return signature_base64;
92 } 92 }
93 93
94 std::string RsaKeyPair::GenerateCertificate() const { 94 std::string RsaKeyPair::GenerateCertificate() const {
95 scoped_refptr<net::X509Certificate> cert = 95 scoped_refptr<net::X509Certificate> cert =
96 net::X509Certificate::CreateSelfSigned( 96 net::X509Certificate::CreateSelfSigned(
97 key_.get(), "CN=chromoting", 97 key_.get(), "CN=chromoting",
98 base::RandInt(1, std::numeric_limits<int>::max()), 98 base::RandInt(1, std::numeric_limits<int>::max()),
99 base::TimeDelta::FromDays(1)); 99 base::TimeDelta::FromDays(1));
100 if (!cert) 100 if (!cert.get())
101 return std::string(); 101 return std::string();
102 102
103 std::string encoded; 103 std::string encoded;
104 bool result = net::X509Certificate::GetDEREncoded(cert->os_cert_handle(), 104 bool result = net::X509Certificate::GetDEREncoded(cert->os_cert_handle(),
105 &encoded); 105 &encoded);
106 CHECK(result); 106 CHECK(result);
107 return encoded; 107 return encoded;
108 } 108 }
109 109
110 } // namespace remoting 110 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/base/compound_buffer_unittest.cc ('k') | remoting/base/rsa_key_pair_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698