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

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

Issue 27832002: Sign self-signed certs with SHA256. (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 2 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
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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 std::vector<uint8> signature_buf; 86 std::vector<uint8> signature_buf;
87 signature_creator->Final(&signature_buf); 87 signature_creator->Final(&signature_buf);
88 std::string signature_str(signature_buf.begin(), signature_buf.end()); 88 std::string signature_str(signature_buf.begin(), signature_buf.end());
89 std::string signature_base64; 89 std::string signature_base64;
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 std::string der_cert; 95 std::string der_cert;
96 net::x509_util::CreateSelfSignedCert( 96 net::x509_util::CreateSha1SelfSignedCert(
97 key_.get(), 97 key_.get(),
98 "CN=chromoting", 98 "CN=chromoting",
99 base::RandInt(1, std::numeric_limits<int>::max()), 99 base::RandInt(1, std::numeric_limits<int>::max()),
100 base::Time::Now(), 100 base::Time::Now(),
101 base::Time::Now() + base::TimeDelta::FromDays(1), 101 base::Time::Now() + base::TimeDelta::FromDays(1),
102 &der_cert); 102 &der_cert);
103 return der_cert; 103 return der_cert;
104 } 104 }
105 105
106 } // namespace remoting 106 } // namespace remoting
OLDNEW
« net/cert/x509_util_nss.cc ('K') | « net/ssl/server_bound_cert_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698