Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Unified Diff: net/base/x509_util_ios.h

Issue 10928107: Support x509 certificate on iOS. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix windows compilation Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/x509_certificate_unittest.cc ('k') | net/base/x509_util_ios.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/x509_util_ios.h
diff --git a/net/base/x509_util_ios.h b/net/base/x509_util_ios.h
new file mode 100644
index 0000000000000000000000000000000000000000..641ddba136041179919cbef059dcf228db0f8cff
--- /dev/null
+++ b/net/base/x509_util_ios.h
@@ -0,0 +1,43 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// This file contains functions for iOS to glue NSS and Security.framework
+// together.
+
+#ifndef NET_BASE_X509_UTIL_IOS_H_
+#define NET_BASE_X509_UTIL_IOS_H_
+
+#include <Security/Security.h>
+
+// Forward declaration; real one in <cert.h>
+typedef struct CERTCertificateStr CERTCertificate;
+
+namespace net {
+namespace x509_util_ios {
+
+// Converts a Security.framework certificate handle (SecCertificateRef) into
+// an NSS certificate handle (CERTCertificate*).
+CERTCertificate* CreateNSSCertHandleFromOSHandle(SecCertificateRef cert_handle);
+
+// Converts an NSS certificate handle (CERTCertificate*) into a
+// Security.framework handle (SecCertificateRef)
+SecCertificateRef CreateOSCertHandleFromNSSHandle(
+ CERTCertificate* nss_cert_handle);
+
+// This is a wrapper class around the native NSS certificate handle.
+// The constructor copies the certificate data from |cert_handle| and
+// uses the NSS library to parse it.
+class NSSCertificate {
+ public:
+ explicit NSSCertificate(SecCertificateRef cert_handle);
+ ~NSSCertificate();
+ CERTCertificate* cert_handle();
+ private:
+ CERTCertificate* nss_cert_handle_;
+};
+
+} // namespace x509_util_ios
+} // namespace net
+
+#endif // NET_BASE_X509_UTIL_IOS_H_
« no previous file with comments | « net/base/x509_certificate_unittest.cc ('k') | net/base/x509_util_ios.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698