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

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

Issue 13006020: net: extract net/cert out of net/base (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 8 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/base/cert_status_flags.cc ('k') | net/base/cert_test_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 #ifndef NET_BASE_CERT_TEST_UTIL_H_
6 #define NET_BASE_CERT_TEST_UTIL_H_
7
8 #include <string>
9
10 #include "base/memory/ref_counted.h"
11 #include "net/base/x509_cert_types.h"
12 #include "net/base/x509_certificate.h"
13
14 namespace base {
15 class FilePath;
16 }
17
18 namespace net {
19
20 class EVRootCAMetadata;
21
22 CertificateList CreateCertificateListFromFile(const base::FilePath& certs_dir,
23 const std::string& cert_file,
24 int format);
25
26 // Imports a certificate file in the directory net::GetTestCertsDirectory()
27 // returns.
28 // |certs_dir| represents the test certificates directory. |cert_file| is the
29 // name of the certificate file. If cert_file contains multiple certificates,
30 // the first certificate found will be returned.
31 scoped_refptr<X509Certificate> ImportCertFromFile(const base::FilePath& certs_di r,
32 const std::string& cert_file);
33
34 // ScopedTestEVPolicy causes certificates marked with |policy|, issued from a
35 // root with the given fingerprint, to be treated as EV. |policy| is expressed
36 // as a string of dotted numbers: i.e. "1.2.3.4".
37 // This should only be used in unittests as adding a CA twice causes a CHECK
38 // failure.
39 class ScopedTestEVPolicy {
40 public:
41 ScopedTestEVPolicy(EVRootCAMetadata* ev_root_ca_metadata,
42 const SHA1HashValue& fingerprint,
43 const char* policy);
44 ~ScopedTestEVPolicy();
45
46 private:
47 SHA1HashValue fingerprint_;
48 EVRootCAMetadata* const ev_root_ca_metadata_;
49 };
50
51 } // namespace net
52
53 #endif // NET_BASE_CERT_TEST_UTIL_H_
OLDNEW
« no previous file with comments | « net/base/cert_status_flags.cc ('k') | net/base/cert_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698