blob: 9d5522e7f93712a64489a05a9eea165eef7ed2ae [file] [log] [blame]
Bence Békybac04052022-04-07 15:44:29 -04001// Copyright (c) 2019 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 QUICHE_COMMON_PLATFORM_API_QUICHE_DEFAULT_PROOF_PROVIDERS_H_
6#define QUICHE_COMMON_PLATFORM_API_QUICHE_DEFAULT_PROOF_PROVIDERS_H_
7
8#include <memory>
9
10#include "quiche_platform_impl/quiche_default_proof_providers_impl.h"
11#include "quiche/quic/core/crypto/proof_source.h"
12#include "quiche/quic/core/crypto/proof_verifier.h"
13
14namespace quiche {
15
16// Provides a default proof verifier that can verify a cert chain for |host|.
17// The verifier has to do a good faith attempt at verifying the certificate
18// against a reasonable root store, and not just always return success.
19inline std::unique_ptr<quic::ProofVerifier> CreateDefaultProofVerifier(
20 const std::string& host) {
21 return CreateDefaultProofVerifierImpl(host);
22}
23
24// Provides a default proof source for CLI-based tools. The actual certificates
25// used in the proof source should be confifgurable via command-line flags.
26inline std::unique_ptr<quic::ProofSource> CreateDefaultProofSource() {
27 return CreateDefaultProofSourceImpl();
28}
29
30} // namespace quiche
31
32#endif // QUICHE_COMMON_PLATFORM_API_QUICHE_DEFAULT_PROOF_PROVIDERS_H_