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

Side by Side Diff: net/test/cert_test_util.h

Issue 394013005: Remove NSSCertDatabase from ClientCertStoreChromeOS unittest. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments. Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/ssl/client_cert_store_chromeos_unittest.cc ('k') | net/test/cert_test_util_nss.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef NET_TEST_CERT_TEST_UTIL_H_ 5 #ifndef NET_TEST_CERT_TEST_UTIL_H_
6 #define NET_TEST_CERT_TEST_UTIL_H_ 6 #define NET_TEST_CERT_TEST_UTIL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "net/cert/x509_cert_types.h" 11 #include "net/cert/x509_cert_types.h"
12 #include "net/cert/x509_certificate.h" 12 #include "net/cert/x509_certificate.h"
13 13
14 #if defined(USE_NSS)
15 #include "base/memory/scoped_ptr.h"
16
17 // From <pk11pub.h>
18 typedef struct PK11SlotInfoStr PK11SlotInfo;
19 #endif
20
14 namespace base { 21 namespace base {
15 class FilePath; 22 class FilePath;
16 } 23 }
17 24
25 namespace crypto {
26 class RSAPrivateKey;
27 }
28
18 namespace net { 29 namespace net {
19 30
20 class EVRootCAMetadata; 31 class EVRootCAMetadata;
21 32
22 // Imports all of the certificates in |cert_file|, a file in |certs_dir|, 33 #if defined(USE_NSS)
23 // // into a CertificateList. 34 // Imports a private key from file |key_filename| in |dir|. The file must
35 // contain a PKCS#8 PrivateKeyInfo in DER encoding. The key is imported to
36 // |slot|.
37 scoped_ptr<crypto::RSAPrivateKey> ImportSensitiveKeyFromFile(
38 const base::FilePath& dir,
39 const std::string& key_filename,
40 PK11SlotInfo* slot);
41 #endif
42
43 // Imports all of the certificates in |cert_file|, a file in |certs_dir|, into a
44 // CertificateList.
24 CertificateList CreateCertificateListFromFile(const base::FilePath& certs_dir, 45 CertificateList CreateCertificateListFromFile(const base::FilePath& certs_dir,
25 const std::string& cert_file, 46 const std::string& cert_file,
26 int format); 47 int format);
27 48
28 // Imports all of the certificates in |cert_file|, a file in |certs_dir|, into 49 // Imports all of the certificates in |cert_file|, a file in |certs_dir|, into
29 // a new X509Certificate. The first certificate in the chain will be used for 50 // a new X509Certificate. The first certificate in the chain will be used for
30 // the returned cert, with any additional certificates configured as 51 // the returned cert, with any additional certificates configured as
31 // intermediate certificates. 52 // intermediate certificates.
32 scoped_refptr<X509Certificate> CreateCertificateChainFromFile( 53 scoped_refptr<X509Certificate> CreateCertificateChainFromFile(
33 const base::FilePath& certs_dir, 54 const base::FilePath& certs_dir,
(...skipping 20 matching lines...) Expand all
54 ~ScopedTestEVPolicy(); 75 ~ScopedTestEVPolicy();
55 76
56 private: 77 private:
57 SHA1HashValue fingerprint_; 78 SHA1HashValue fingerprint_;
58 EVRootCAMetadata* const ev_root_ca_metadata_; 79 EVRootCAMetadata* const ev_root_ca_metadata_;
59 }; 80 };
60 81
61 } // namespace net 82 } // namespace net
62 83
63 #endif // NET_TEST_CERT_TEST_UTIL_H_ 84 #endif // NET_TEST_CERT_TEST_UTIL_H_
OLDNEW
« no previous file with comments | « net/ssl/client_cert_store_chromeos_unittest.cc ('k') | net/test/cert_test_util_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698