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 <CommonCrypto/CommonDigest.h> | 7 #include <CommonCrypto/CommonDigest.h> |
8 #include <Security/Security.h> | 8 #include <Security/Security.h> |
9 | 9 |
10 #include <cert.h> | 10 #include <cert.h> |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "crypto/nss_util.h" | 29 #include "crypto/nss_util.h" |
30 #include "crypto/scoped_nss_types.h" | 30 #include "crypto/scoped_nss_types.h" |
31 #include "net/base/net_errors.h" | 31 #include "net/base/net_errors.h" |
32 #include "net/cert/asn1_util.h" | 32 #include "net/cert/asn1_util.h" |
33 #include "net/cert/cert_status_flags.h" | 33 #include "net/cert/cert_status_flags.h" |
34 #include "net/cert/cert_verify_result.h" | 34 #include "net/cert/cert_verify_result.h" |
35 #include "net/cert/ev_root_ca_metadata.h" | 35 #include "net/cert/ev_root_ca_metadata.h" |
36 #include "net/cert/x509_util_ios.h" | 36 #include "net/cert/x509_util_ios.h" |
37 #include "net/cert/x509_util_nss.h" | 37 #include "net/cert/x509_util_nss.h" |
38 | 38 |
39 using base::mac::ScopedCFTypeRef; | 39 using base::ScopedCFTypeRef; |
40 | 40 |
41 namespace net { | 41 namespace net { |
42 namespace { | 42 namespace { |
43 // Returns true if a given |cert_handle| is actually a valid X.509 certificate | 43 // Returns true if a given |cert_handle| is actually a valid X.509 certificate |
44 // handle. | 44 // handle. |
45 // | 45 // |
46 // SecCertificateCreateFromData() does not always force the immediate parsing of | 46 // SecCertificateCreateFromData() does not always force the immediate parsing of |
47 // the certificate, and as such, may return a SecCertificateRef for an | 47 // the certificate, and as such, may return a SecCertificateRef for an |
48 // invalid/unparsable certificate. Force parsing to occur to ensure that the | 48 // invalid/unparsable certificate. Force parsing to occur to ensure that the |
49 // SecCertificateRef is correct. On later versions where | 49 // SecCertificateRef is correct. On later versions where |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 | 237 |
238 // static | 238 // static |
239 void X509Certificate::GetPublicKeyInfo(OSCertHandle cert_handle, | 239 void X509Certificate::GetPublicKeyInfo(OSCertHandle cert_handle, |
240 size_t* size_bits, | 240 size_t* size_bits, |
241 PublicKeyType* type) { | 241 PublicKeyType* type) { |
242 x509_util_ios::NSSCertificate nss_cert(cert_handle); | 242 x509_util_ios::NSSCertificate nss_cert(cert_handle); |
243 x509_util::GetPublicKeyInfo(nss_cert.cert_handle(), size_bits, type); | 243 x509_util::GetPublicKeyInfo(nss_cert.cert_handle(), size_bits, type); |
244 } | 244 } |
245 | 245 |
246 } // namespace net | 246 } // namespace net |
OLD | NEW |