Move pending tile priorities to active on tree activation
[chromium-blink-merge.git] / net / base / cert_test_util.h
blob9f23b7debf1dbb3dec7cf7cda6ce33b0d7104f39
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.
5 #ifndef NET_BASE_CERT_TEST_UTIL_H_
6 #define NET_BASE_CERT_TEST_UTIL_H_
8 #include <string>
10 #include "base/memory/ref_counted.h"
11 #include "net/base/x509_cert_types.h"
12 #include "net/base/x509_certificate.h"
14 class FilePath;
16 namespace net {
18 class EVRootCAMetadata;
20 CertificateList CreateCertificateListFromFile(const FilePath& certs_dir,
21 const std::string& cert_file,
22 int format);
24 // Imports a certificate file in the directory net::GetTestCertsDirectory()
25 // returns.
26 // |certs_dir| represents the test certificates directory. |cert_file| is the
27 // name of the certificate file. If cert_file contains multiple certificates,
28 // the first certificate found will be returned.
29 scoped_refptr<X509Certificate> ImportCertFromFile(const FilePath& certs_dir,
30 const std::string& cert_file);
32 // ScopedTestEVPolicy causes certificates marked with |policy|, issued from a
33 // root with the given fingerprint, to be treated as EV. |policy| is expressed
34 // as a string of dotted numbers: i.e. "1.2.3.4".
35 // This should only be used in unittests as adding a CA twice causes a CHECK
36 // failure.
37 class ScopedTestEVPolicy {
38 public:
39 ScopedTestEVPolicy(EVRootCAMetadata* ev_root_ca_metadata,
40 const SHA1HashValue& fingerprint,
41 const char* policy);
42 ~ScopedTestEVPolicy();
44 private:
45 SHA1HashValue fingerprint_;
46 EVRootCAMetadata* const ev_root_ca_metadata_;
49 } // namespace net
51 #endif // NET_BASE_CERT_TEST_UTIL_H_