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/base/x509_certificate.h" | 5 #include "net/base/x509_certificate.h" |
6 | 6 |
7 #include <CommonCrypto/CommonDigest.h> | 7 #include <CommonCrypto/CommonDigest.h> |
8 #include <CoreServices/CoreServices.h> | 8 #include <CoreServices/CoreServices.h> |
9 #include <Security/Security.h> | 9 #include <Security/Security.h> |
10 #include <time.h> | 10 #include <time.h> |
(...skipping 1547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1558 CFArrayAppendValue(cert_list, os_cert_handle()); | 1558 CFArrayAppendValue(cert_list, os_cert_handle()); |
1559 for (size_t i = 0; i < intermediate_ca_certs_.size(); ++i) | 1559 for (size_t i = 0; i < intermediate_ca_certs_.size(); ++i) |
1560 CFArrayAppendValue(cert_list, intermediate_ca_certs_[i]); | 1560 CFArrayAppendValue(cert_list, intermediate_ca_certs_[i]); |
1561 | 1561 |
1562 return cert_list; | 1562 return cert_list; |
1563 } | 1563 } |
1564 | 1564 |
1565 // static | 1565 // static |
1566 X509Certificate::OSCertHandle | 1566 X509Certificate::OSCertHandle |
1567 X509Certificate::ReadOSCertHandleFromPickle(const Pickle& pickle, | 1567 X509Certificate::ReadOSCertHandleFromPickle(const Pickle& pickle, |
1568 void** pickle_iter) { | 1568 PickleIterator* pickle_iter) { |
1569 const char* data; | 1569 const char* data; |
1570 int length; | 1570 int length; |
1571 if (!pickle.ReadData(pickle_iter, &data, &length)) | 1571 if (!pickle.ReadData(pickle_iter, &data, &length)) |
1572 return NULL; | 1572 return NULL; |
1573 | 1573 |
1574 return CreateOSCertHandleFromBytes(data, length); | 1574 return CreateOSCertHandleFromBytes(data, length); |
1575 } | 1575 } |
1576 | 1576 |
1577 // static | 1577 // static |
1578 bool X509Certificate::WriteOSCertHandleToPickle(OSCertHandle cert_handle, | 1578 bool X509Certificate::WriteOSCertHandleToPickle(OSCertHandle cert_handle, |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1625 *type = kPublicKeyTypeDH; | 1625 *type = kPublicKeyTypeDH; |
1626 break; | 1626 break; |
1627 default: | 1627 default: |
1628 *type = kPublicKeyTypeUnknown; | 1628 *type = kPublicKeyTypeUnknown; |
1629 *size_bits = 0; | 1629 *size_bits = 0; |
1630 break; | 1630 break; |
1631 } | 1631 } |
1632 } | 1632 } |
1633 | 1633 |
1634 } // namespace net | 1634 } // namespace net |
OLD | NEW |