1 // 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 
12 #include "quiche/quic/core/crypto/proof_source.h"
13 #include "quiche/quic/core/crypto/proof_verifier.h"
14 
15 namespace quiche {
16 
17 // Provides a default proof verifier that can verify a cert chain for |host|.
18 // The verifier has to do a good faith attempt at verifying the certificate
19 // against a reasonable root store, and not just always return success.
CreateDefaultProofVerifier(const std::string & host)20 inline std::unique_ptr<quic::ProofVerifier> CreateDefaultProofVerifier(
21     const std::string& host) {
22   return CreateDefaultProofVerifierImpl(host);
23 }
24 
25 // Provides a default proof source for CLI-based tools.  The actual certificates
26 // used in the proof source should be confifgurable via command-line flags.
CreateDefaultProofSource()27 inline std::unique_ptr<quic::ProofSource> CreateDefaultProofSource() {
28   return CreateDefaultProofSourceImpl();
29 }
30 
31 }  // namespace quiche
32 
33 #endif  // QUICHE_COMMON_PLATFORM_API_QUICHE_DEFAULT_PROOF_PROVIDERS_H_
34