| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |