| OLD | NEW |
| 1 /* ***** BEGIN LICENSE BLOCK ***** | 1 /* ***** BEGIN LICENSE BLOCK ***** |
| 2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
| 3 * | 3 * |
| 4 * The contents of this file are subject to the Mozilla Public License Version | 4 * The contents of this file are subject to the Mozilla Public License Version |
| 5 * 1.1 (the "License"); you may not use this file except in compliance with | 5 * 1.1 (the "License"); you may not use this file except in compliance with |
| 6 * the License. You may obtain a copy of the License at | 6 * the License. You may obtain a copy of the License at |
| 7 * http://www.mozilla.org/MPL/ | 7 * http://www.mozilla.org/MPL/ |
| 8 * | 8 * |
| 9 * Software distributed under the License is distributed on an "AS IS" basis, | 9 * Software distributed under the License is distributed on an "AS IS" basis, |
| 10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | 10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 #ifndef NET_THIRD_PARTY_MOZILLA_SECURITY_MANAGER_NSPKCS12BLOB_H_ | 38 #ifndef NET_THIRD_PARTY_MOZILLA_SECURITY_MANAGER_NSPKCS12BLOB_H_ |
| 39 #define NET_THIRD_PARTY_MOZILLA_SECURITY_MANAGER_NSPKCS12BLOB_H_ | 39 #define NET_THIRD_PARTY_MOZILLA_SECURITY_MANAGER_NSPKCS12BLOB_H_ |
| 40 | 40 |
| 41 #include <string> | 41 #include <string> |
| 42 #include <vector> | 42 #include <vector> |
| 43 | 43 |
| 44 #include "base/string16.h" | 44 #include "base/string16.h" |
| 45 #include "base/ref_counted.h" | 45 #include "base/ref_counted.h" |
| 46 | 46 |
| 47 typedef struct CERTCertificateStr CERTCertificate; | 47 typedef struct CERTCertificateStr CERTCertificate; |
| 48 typedef struct PK11SlotInfoStr PK11SlotInfo; |
| 48 namespace net { | 49 namespace net { |
| 49 class X509Certificate; | 50 class X509Certificate; |
| 50 typedef std::vector<scoped_refptr<X509Certificate> > CertificateList; | 51 typedef std::vector<scoped_refptr<X509Certificate> > CertificateList; |
| 51 } // namespace net | 52 } // namespace net |
| 52 | 53 |
| 53 namespace mozilla_security_manager { | 54 namespace mozilla_security_manager { |
| 54 | 55 |
| 55 // Initialize NSS PKCS#12 libs. | 56 // Initialize NSS PKCS#12 libs. |
| 56 void EnsurePKCS12Init(); | 57 void EnsurePKCS12Init(); |
| 57 | 58 |
| 58 // Import certificate from PKCS#12 blob. | 59 // Import certificate from PKCS#12 blob into the slot. |
| 59 // Returns a net error code. | 60 // Returns a net error code. |
| 60 int nsPKCS12Blob_Import(const char* pkcs12_data, | 61 int nsPKCS12Blob_Import(PK11SlotInfo* slot, |
| 62 const char* pkcs12_data, |
| 61 size_t pkcs12_len, | 63 size_t pkcs12_len, |
| 62 const string16& password); | 64 const string16& password); |
| 63 | 65 |
| 64 // Export the given certificates into a PKCS#12 blob, storing into output. | 66 // Export the given certificates into a PKCS#12 blob, storing into output. |
| 65 // Returns the number of certificates exported. | 67 // Returns the number of certificates exported. |
| 66 // TODO(mattm): provide better error return status? | 68 // TODO(mattm): provide better error return status? |
| 67 int nsPKCS12Blob_Export(std::string* output, | 69 int nsPKCS12Blob_Export(std::string* output, |
| 68 const net::CertificateList& certs, | 70 const net::CertificateList& certs, |
| 69 const string16& password); | 71 const string16& password); |
| 70 | 72 |
| 71 } // namespace mozilla_security_manager | 73 } // namespace mozilla_security_manager |
| 72 | 74 |
| 73 #endif // NET_THIRD_PARTY_MOZILLA_SECURITY_MANAGER_NSPKCS12BLOB_H_ | 75 #endif // NET_THIRD_PARTY_MOZILLA_SECURITY_MANAGER_NSPKCS12BLOB_H_ |
| OLD | NEW |