xref: /aosp_15_r20/external/cronet/net/tools/cert_verify_tool/verify_using_path_builder.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2016 The Chromium Authors
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_TOOLS_CERT_VERIFY_TOOL_VERIFY_USING_PATH_BUILDER_H_
6 #define NET_TOOLS_CERT_VERIFY_TOOL_VERIFY_USING_PATH_BUILDER_H_
7 
8 #include <vector>
9 
10 #include "base/memory/scoped_refptr.h"
11 
12 namespace base {
13 class FilePath;
14 class Time;
15 }
16 
17 namespace net {
18 class CertNetFetcher;
19 class SystemTrustStore;
20 }
21 
22 struct CertInput;
23 struct CertInputWithTrustSetting;
24 
25 // Verifies |target_der_cert| using bssl::CertPathBuilder. Returns true if the
26 // certificate verified successfully, false if it failed to verify or there was
27 // some other error.
28 // Informational messages will be printed to stdout/stderr as appropriate.
29 bool VerifyUsingPathBuilder(
30     const CertInput& target_der_cert,
31     const std::vector<CertInput>& intermediate_der_certs,
32     const std::vector<CertInputWithTrustSetting>& der_certs_with_trust_settings,
33     const base::Time at_time,
34     const base::FilePath& dump_prefix_path,
35     scoped_refptr<net::CertNetFetcher> cert_net_fetcher,
36     net::SystemTrustStore* system_trust_store);
37 
38 #endif  // NET_TOOLS_CERT_VERIFY_TOOL_VERIFY_USING_PATH_BUILDER_H_
39