OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // This file contains functions for iOS to glue NSS and Security.framework |
| 6 // together. |
| 7 |
| 8 #ifndef NET_BASE_X509_UTIL_IOS_H_ |
| 9 #define NET_BASE_X509_UTIL_IOS_H_ |
| 10 |
| 11 #include <Security/Security.h> |
| 12 |
| 13 // Forward declaration; real one in <cert.h> |
| 14 typedef struct CERTCertificateStr CERTCertificate; |
| 15 |
| 16 namespace net { |
| 17 |
| 18 namespace x509_util { |
| 19 |
| 20 // Converts a Security.framework certificate handle (SecCertificateRef) into |
| 21 // an NSS certificate handle (CERTCertificate*). |
| 22 CERTCertificate* CreateNSSCertHandleFromOSHandle(SecCertificateRef cert_handle); |
| 23 |
| 24 // Converts an NSS certificate handle (CERTCertificate*) into a |
| 25 // Security.framework handle (SecCertificateRef) |
| 26 SecCertificateRef CreateOSCertHandleFromNSSHandle( |
| 27 CERTCertificate* nss_cert_handle); |
| 28 |
| 29 // This is a wrapper class around the native NSS certificate handle. |
| 30 // The constructor copies the certificate data from |cert_handle| and |
| 31 // use the NSS library to parse it. |
| 32 class NSSCertificate { |
| 33 public: |
| 34 explicit NSSCertificate(SecCertificateRef cert_handle); |
| 35 ~NSSCertificate(); |
| 36 CERTCertificate* cert_handle(); |
| 37 private: |
| 38 CERTCertificate* nss_cert_handle_; |
| 39 }; |
| 40 |
| 41 } // namespace x509_util |
| 42 |
| 43 } // namespace net |
| 44 |
| 45 #endif // NET_BASE_X509_UTIL_IOS_H_ |
OLD | NEW |