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

Side by Side Diff: net/cert/x509_certificate.cc

Issue 2084153003: Remove the test-only X509Certificate constructor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 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
« no previous file with comments | « net/cert/x509_certificate.h ('k') | net/cert/x509_util_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 "net/cert/x509_certificate.h" 5 #include "net/cert/x509_certificate.h"
6 6
7 #include <limits.h> 7 #include <limits.h>
8 #include <stdlib.h> 8 #include <stdlib.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 *left = src; 217 *left = src;
218 right->clear(); 218 right->clear();
219 } else { 219 } else {
220 *left = src.substr(0, pos); 220 *left = src.substr(0, pos);
221 *right = src.substr(pos); 221 *right = src.substr(pos);
222 } 222 }
223 } 223 }
224 224
225 } // namespace 225 } // namespace
226 226
227 X509Certificate::X509Certificate(const std::string& subject,
228 const std::string& issuer,
229 base::Time start_date,
230 base::Time expiration_date)
231 : subject_(subject),
232 issuer_(issuer),
233 valid_start_(start_date),
234 valid_expiry_(expiration_date),
235 cert_handle_(NULL) {
236 }
237
238 // static 227 // static
239 scoped_refptr<X509Certificate> X509Certificate::CreateFromHandle( 228 scoped_refptr<X509Certificate> X509Certificate::CreateFromHandle(
240 OSCertHandle cert_handle, 229 OSCertHandle cert_handle,
241 const OSCertHandles& intermediates) { 230 const OSCertHandles& intermediates) {
242 DCHECK(cert_handle); 231 DCHECK(cert_handle);
243 return new X509Certificate(cert_handle, intermediates); 232 return new X509Certificate(cert_handle, intermediates);
244 } 233 }
245 234
246 // static 235 // static
247 scoped_refptr<X509Certificate> X509Certificate::CreateFromDERCertChain( 236 scoped_refptr<X509Certificate> X509Certificate::CreateFromDERCertChain(
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 RemoveFromCache(cert_handle_); 712 RemoveFromCache(cert_handle_);
724 FreeOSCertHandle(cert_handle_); 713 FreeOSCertHandle(cert_handle_);
725 } 714 }
726 for (size_t i = 0; i < intermediate_ca_certs_.size(); ++i) { 715 for (size_t i = 0; i < intermediate_ca_certs_.size(); ++i) {
727 RemoveFromCache(intermediate_ca_certs_[i]); 716 RemoveFromCache(intermediate_ca_certs_[i]);
728 FreeOSCertHandle(intermediate_ca_certs_[i]); 717 FreeOSCertHandle(intermediate_ca_certs_[i]);
729 } 718 }
730 } 719 }
731 720
732 } // namespace net 721 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/x509_certificate.h ('k') | net/cert/x509_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698