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 // This file contains functions for iOS to glue NSS and Security.framework | 5 // This file contains functions for iOS to glue NSS and Security.framework |
6 // together. | 6 // together. |
7 | 7 |
8 #ifndef NET_CERT_X509_UTIL_IOS_H_ | 8 #ifndef NET_CERT_X509_UTIL_IOS_H_ |
9 #define NET_CERT_X509_UTIL_IOS_H_ | 9 #define NET_CERT_X509_UTIL_IOS_H_ |
10 | 10 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 SHA1HashValue CalculateFingerprintNSS(CERTCertificate* cert); | 42 SHA1HashValue CalculateFingerprintNSS(CERTCertificate* cert); |
43 | 43 |
44 // This is a wrapper class around the native NSS certificate handle. | 44 // This is a wrapper class around the native NSS certificate handle. |
45 // The constructor copies the certificate data from |cert_handle| and | 45 // The constructor copies the certificate data from |cert_handle| and |
46 // uses the NSS library to parse it. | 46 // uses the NSS library to parse it. |
47 class NSSCertificate { | 47 class NSSCertificate { |
48 public: | 48 public: |
49 explicit NSSCertificate(SecCertificateRef cert_handle); | 49 explicit NSSCertificate(SecCertificateRef cert_handle); |
50 ~NSSCertificate(); | 50 ~NSSCertificate(); |
51 CERTCertificate* cert_handle() const; | 51 CERTCertificate* cert_handle() const; |
| 52 |
52 private: | 53 private: |
53 CERTCertificate* nss_cert_handle_; | 54 CERTCertificate* nss_cert_handle_; |
54 }; | 55 }; |
55 | 56 |
56 // A wrapper class that loads a certificate and all of its intermediates into | 57 // A wrapper class that loads a certificate and all of its intermediates into |
57 // NSS. This is necessary for libpkix path building to be able to locate | 58 // NSS. This is necessary for libpkix path building to be able to locate |
58 // needed intermediates. | 59 // needed intermediates. |
59 class NSSCertChain { | 60 class NSSCertChain { |
60 public: | 61 public: |
61 explicit NSSCertChain(X509Certificate* certificate); | 62 explicit NSSCertChain(X509Certificate* certificate); |
62 ~NSSCertChain(); | 63 ~NSSCertChain(); |
63 CERTCertificate* cert_handle() const; | 64 CERTCertificate* cert_handle() const; |
64 const std::vector<CERTCertificate*>& cert_chain() const; | 65 const std::vector<CERTCertificate*>& cert_chain() const; |
| 66 |
65 private: | 67 private: |
66 std::vector<CERTCertificate*> certs_; | 68 std::vector<CERTCertificate*> certs_; |
67 }; | 69 }; |
68 | 70 |
69 } // namespace x509_util_ios | 71 } // namespace x509_util_ios |
70 } // namespace net | 72 } // namespace net |
71 | 73 |
72 #endif // NET_CERT_X509_UTIL_IOS_H_ | 74 #endif // NET_CERT_X509_UTIL_IOS_H_ |
OLD | NEW |