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/cert/x509_certificate.h" |
6 | 6 |
7 #include <CommonCrypto/CommonDigest.h> | 7 #include <CommonCrypto/CommonDigest.h> |
8 #include <Security/Security.h> | 8 #include <Security/Security.h> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
| 11 #include <cert.h> |
11 #include <cryptohi.h> | 12 #include <cryptohi.h> |
12 #include <cert.h> | |
13 #include <keyhi.h> | 13 #include <keyhi.h> |
14 #include <nss.h> | 14 #include <nss.h> |
15 #include <pk11pub.h> | 15 #include <pk11pub.h> |
16 #include <prerror.h> | 16 #include <prerror.h> |
17 #include <prtime.h> | 17 #include <prtime.h> |
18 #include <prtypes.h> | 18 #include <prtypes.h> |
19 #include <secder.h> | 19 #include <secder.h> |
20 #include <secerr.h> | 20 #include <secerr.h> |
21 #include <sslerr.h> | 21 #include <sslerr.h> |
22 | 22 |
23 #include "base/logging.h" | 23 #include "base/logging.h" |
24 #include "base/mac/scoped_cftyperef.h" | 24 #include "base/mac/scoped_cftyperef.h" |
25 #include "base/memory/scoped_ptr.h" | 25 #include "base/memory/scoped_ptr.h" |
26 #include "base/pickle.h" | 26 #include "base/pickle.h" |
27 #include "base/time.h" | 27 #include "base/time.h" |
28 #include "crypto/nss_util.h" | 28 #include "crypto/nss_util.h" |
29 #include "crypto/scoped_nss_types.h" | 29 #include "crypto/scoped_nss_types.h" |
30 #include "net/base/asn1_util.h" | |
31 #include "net/base/cert_status_flags.h" | |
32 #include "net/base/cert_verify_result.h" | |
33 #include "net/base/ev_root_ca_metadata.h" | |
34 #include "net/base/net_errors.h" | 30 #include "net/base/net_errors.h" |
35 #include "net/base/x509_util_ios.h" | 31 #include "net/cert/asn1_util.h" |
36 #include "net/base/x509_util_nss.h" | 32 #include "net/cert/cert_status_flags.h" |
| 33 #include "net/cert/cert_verify_result.h" |
| 34 #include "net/cert/ev_root_ca_metadata.h" |
| 35 #include "net/cert/x509_util_ios.h" |
| 36 #include "net/cert/x509_util_nss.h" |
37 | 37 |
38 using base::mac::ScopedCFTypeRef; | 38 using base::mac::ScopedCFTypeRef; |
39 | 39 |
40 namespace net { | 40 namespace net { |
41 namespace { | 41 namespace { |
42 // Returns true if a given |cert_handle| is actually a valid X.509 certificate | 42 // Returns true if a given |cert_handle| is actually a valid X.509 certificate |
43 // handle. | 43 // handle. |
44 // | 44 // |
45 // SecCertificateCreateFromData() does not always force the immediate parsing of | 45 // SecCertificateCreateFromData() does not always force the immediate parsing of |
46 // the certificate, and as such, may return a SecCertificateRef for an | 46 // the certificate, and as such, may return a SecCertificateRef for an |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 | 236 |
237 // static | 237 // static |
238 void X509Certificate::GetPublicKeyInfo(OSCertHandle cert_handle, | 238 void X509Certificate::GetPublicKeyInfo(OSCertHandle cert_handle, |
239 size_t* size_bits, | 239 size_t* size_bits, |
240 PublicKeyType* type) { | 240 PublicKeyType* type) { |
241 x509_util_ios::NSSCertificate nss_cert(cert_handle); | 241 x509_util_ios::NSSCertificate nss_cert(cert_handle); |
242 x509_util::GetPublicKeyInfo(nss_cert.cert_handle(), size_bits, type); | 242 x509_util::GetPublicKeyInfo(nss_cert.cert_handle(), size_bits, type); |
243 } | 243 } |
244 | 244 |
245 } // namespace net | 245 } // namespace net |
OLD | NEW |