cert_verifier_creation.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Copyright 2020 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. #ifndef SERVICES_CERT_VERIFIER_CERT_VERIFIER_CREATION_H_
  5. #define SERVICES_CERT_VERIFIER_CERT_VERIFIER_CREATION_H_
  6. #include <memory>
  7. #include "base/component_export.h"
  8. #include "base/memory/scoped_refptr.h"
  9. #include "net/cert/cert_net_fetcher.h"
  10. #include "net/cert/cert_verifier.h"
  11. #include "services/cert_verifier/public/mojom/cert_verifier_service_factory.mojom.h"
  12. namespace net {
  13. class ChromeRootStoreData;
  14. } // namespace net
  15. // Set of utility functions to help with creation of CertVerifiers for
  16. // CertVerifyServiceFactory.
  17. namespace cert_verifier {
  18. // Certain platforms and build configurations require a net::CertNetFetcher in
  19. // order to instantiate a net::CertVerifier. Callers of CreateCertVerifier() can
  20. // call IsUsingCertNetFetcher() to decide whether or not to pass a
  21. // net::CertNetFetcher.
  22. bool IsUsingCertNetFetcher();
  23. // Creates a concrete net::CertVerifier based on the platform and the particular
  24. // build configuration. |creation_params| and |root_store_data| are optional.
  25. std::unique_ptr<net::CertVerifierWithUpdatableProc> CreateCertVerifier(
  26. mojom::CertVerifierCreationParams* creation_params,
  27. scoped_refptr<net::CertNetFetcher> cert_net_fetcher,
  28. const net::ChromeRootStoreData* root_store_data);
  29. } // namespace cert_verifier
  30. #endif // SERVICES_CERT_VERIFIER_CERT_VERIFIER_CREATION_H_